Global Variables
Global variables are declared in a specific file (Text) and can be accessed from any part of the program. Their declaration must begin with the keyword VAR_GLOBAL and end with END_VAR.
It is also possible to declare retentive global variables using the keyword RETAIN, so that their values are preserved even after the device is restarted. Additionally, global constants can be defined using the keyword CONSTANT, representing fixed and immutable values during program execution.

Local Variables
Local variables are declared within the same block of code where they are used. Their declaration must be grouped, starting with the keyword VAR and ending with END_VAR.
These variables are accessible only within the scope in which they are declared, meaning they cannot be used by other parts of the program. This ensures better control over memory usage and helps prevent conflicts between different sections of code.

|
NOTE!
ยน There is no distinction between uppercase and lowercase letters in variable names (case-insensitive).
|