Skip to main content

Variable: VAR_CONFIG

Configuration variables assign the full address to variables which are declared in function blocks with incomplete address information and that should be mapped to device I/Os.

The declaration is made in a global variable list between the VAR_CONFIG and END_VAR keywords with the full instance path and with the correct address. This kind of global variable list is called a "variable configuration".

Example 90. Example

Declaration of the xLocIn variable with an incomplete %I* address 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