Function SysLibGetSymbolAddress

This function of type DWORD of the library The Library SysLibSymbols.lib returns the physical address for the given symbol. A variable must be specified by its full name, e.g. “PLC_PRG.a’ or “*.global_var’.

As a precondition the symbol file must be available on the PLC and the symbol must be entered in the symbol file. The appropriate settings are to be done in the project options and in the target settings dialogs.

There is still the possibility to get the address of a variable by the ADR operator (e.g. ADR(PLC_PRG.a)). But in this case the symbol must be known already at compile time. The SysLibGetSymbolAddress function Function SysLibGetSymbolAddress however allows to adapt the symbol name during runtime.

The return value is the address of the variable or 0 in case the symbol could not be found.

Input Variable Data Type Description
pszSymbol STRING Name of the variable