Using a Global Variable in a Scan Program or Task
To use a global variable in a scan program or task, it must be declared as a VAR_EXTERNAL variable type for that scan program. This variable type can be found in the drop down when creating a variable.
-
VAR_EXTERNAL_CONSTANT is used the same way for a Global constant variable.
Example:
This example shows declaring the VAR_EXTERNAL to allow the “NewProgram” scan program to use the GlobalTest1 global variable in code.
LM109-3