In all editors, you must capitalize keywords that for example denote scopes, data types, or operators. Keywords cannot be used as variable names.
Example
VAR END_VAR BOOL_TO_INT IF THEN ELSE LTIME MUL XOR PERSISTENT PROGRAM
CODESYS checks the correct use of keywords automatically and highlights errors immediately during input with a wavy underline.
When CODESYS creates implicit code, variables and functions are generally given a name that is prepended with two underscores "__". The use of double underscores in the implementation code is prevented automatically. This eliminates conflicts between internal system identifiers and identifiers assigned by the programmer.
The following keywords are used in the CODESYS export format. Therefore, you may not use them as identifiers:
-
ACTION
-
END_ACTION
-
END_FUNCTION
-
END_FUNCTION_BLOCK
-
END_PROGRAM
Other valid keywords:
-
VAR_ACCESS
-
READ_ONLY
-
READ_WRITE
-
PARAMS