Configuration Variables - VAR_CONFIG¶
Use configuration variables for assigning complete addresses to variables that are declared in function blocks with incomplete addresses and will be mapped on device I/Os.
Declare the variables in a global variables list between VAR_CONFIG
and END_VAR
. The global variables list is termed “variables configuration”, where you type the configuration variables with a complete instance path and the correct address.
Example
Declaration of the variable xLocIn
with incomplete address %I\*
in a function block:
FUNCTION_BLOCK locio
VAR
\ xLocIn AT %I* : BOOL := TRUE;
END_VAR
The locio
function block is used in the PLC_PRG
program:
PROGRAM PLC_PRG
VAR
\ locioVar1 : locio;
END_VAR
The correct variables configuration in the global variable list is as follows:
VAR_CONFIG
PLC_PRG.locioVar1.xLocIn AT %IX1.0 : BOOL;
END_VAR
See also