Global variables are available for the entire project. Global variables are declared in a global variable list under GVLs.
Several global variable lists are allowed in the GVL pool of the project. In user libraries, only one GVL is allowed. You can copy and paste global variables between different lists. If an identifier already exists in a global variable list, _copy1, _copy2... will be appended to the existing identifier. You can delete all global variable lists from the project except for one list, which is mandatory for each project.
Global variables can be transferred from a global variable list to a POU header. They can be declared very comfortably in the POU body (using LD/FBD, ST/IL or SFC). Or use the declaration editor to create global variables.
Do not assign addresses unless you have to! Provide addresses for PLC inputs and outputs (X, Y) or if access to certain memory areas is required. The compiler automatically assigns addresses after the power has been turned on. This prevents errors caused by duplicate outputs and ensures that the addresses are automatically updated when the PLC type is changed. The following variables must be declared in the global variable list:
Variables which are assigned to inputs and outputs, e.g. X0, Y0 of the PLC
Variables which need to be assigned to a certain address, e.g. DT0, to enable communication with an operator device
Variables which need to be accessible from other POUs (via VAR_EXTERNAL)
You can enter addresses in one of the following formats:
FP format, e.g. X0. The corresponding IEC address is generated automatically when you move to the next field.
IEC format, e.g. %IX0.0. I = input, X = bit and 0.0 for first unit and first input. The corresponding FP address is generated automatically when you move to the next field.