Keywords and Scope
Keyword | Variable usage |
VAR | Internal to organization unit. |
VAR_INPUT | Externally supplied. |
VAR_OUTPUT | Supplied by organization unit to external entities. |
VAR_IN_OUT | Supplied by external entities, can be modified within organization unit. |
VAR_EXTERNAL | Supplied by configuration via VAR_GLOBAL, can be modified within organization unit. |
VAR_GLOBAL | Global variable declaration. |
- any program organization unit attempts to modify the value of a variable that has been declared with the CONSTANT qualifier;
- a variable declared as VAR_GLOBAL CONSTANT in a configuration element or POU (the “containing element”) is used in a VAR_EXTERNAL declaration (without the CONSTANT qualifier) of any element contained within the containing element.