Variables are symbolic names for input contacts, output contacts and memory areas in the PLC. The symbolic names are used in the program instead of explicit user addresses.
Avoid using explicit user addresses. We recommend using global variables or system variables.
A distinction is made between global and local variables:
Global variables are valid for the entire project. They are, for example, the input and output contacts of a process or they are used for touch terminals and visualization. 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 delete all global variable lists from the project except for one list, which is mandatory for each project.
Local variables are placeholders for intermediate results that the system saves in an arbitrary location. They are declared in the POU header of the respective POU.
Once a variable has been declared, it can be changed, assigned to an input or output directly in the program, or it can be assigned to groups of variables, e.g. ARRAYs or data unit types. For complex control procedures, you can also create recipes.
Cross–reference lists help you to keep track of all variables and their uses in the program.