In the programming, a variable is identified by its name and has an address in the memory of the target system. Accordingly, variable names are identifiers under which the allocated memory is addressed. The size of the variable is determined by its data type. This determines how much memory is reserved for the variable and how the values in memory are to be interpreted. The data type also determines which operators are allowed.
In CODESYS, there is also the capability of instantiating function blocks. Function block instances then use memory like variables do. The memory requirement is determined by the function block.
The following groups of data types are available:
-
Standard data types
-
Extensions of the IECĀ 61131-3 standard
-
User-defined data types
-
Data Type: BOOL
-
Integer data types
-
Data Type: REAL, LREAL
-
Data Type: STRING
-
Time Data Types
-
Date and Time Data Types
-
Data Type: ANY, ANY_<type>
-
Data Type: WSTRING
-
Data Type: BIT
-
Data Type: __UXINT, __XINT, __XWORD
-
Data Type: POINTER TO
-
Data Type: REFERENCE TO
-
Data Type: ARRAY OF
-
User-defined data type: TYPE
-
Data Type: __VECTOR