Data Types
In the programming, a variable is identified by its name and memory address in the target system. 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 will be reserved for the variable and how the values in memory are to be interpreted. The data type also determines which operators are allowed.
Function blocks can also be instantiated. Function block instances use memory like variables do. The memory requirement is determined by the function block.
The following groups of data types are available:
Elementary data type
An elementary data type is available predefined in CODESYS Development System.
__UXINT | __XINT | __XWORD | BIT | BOOL | BYTE | DATE | DATE_AND_TIME | DINT | DT | DWORD | INT | LDATE | LDATE_AND_TIME | LDT | LINT | LREAL | LTIME | LTOD | LWORD | REAL | SINT | TIME | TOD | TIME_OF_DAY | UDINT | UINT | ULINT | USINT | WORD
Besides the data types described in the IEC 61131-3 standard, there are the CODESYS-specific data types
BIT
,__UXINT
,__XINT
, and__XWORD
.Standard data type
A standard type (standard data type) is an elementary data type or a string data type.
__UXINT | __XINT | __XWORD | BIT | BOOL | BYTE | DATE | DATE_AND_TIME | DINT | DT | DWORD | INT | LDATE | LDATE_AND_TIME | LDT | LINT | LREAL | LTIME | LTOD | LWORD | REAL | SINT |STRING | TIME | TOD | TIME_OF_DAY | UDINT | UINT | ULINT | USINT | WORD | WSTRING
Integer data type
__UXINT | __XINT | __XWORD | BIT | BYTE | DINT | DWORD | INT | LINT | LWORD | SINT | UDINT | UINT | ULINT | USINT | WORD
Time data type
TIME
,LTIME
Date and time data type
DATE | DATE_AND_TIME | DT | TIME_OF_DAY | TOD | LDATE | LDATE_AND_TIME | LDT | LTIME_OF_DAY | LTOD
Extensions of the IEC 61131-3 standard
User-defined data types
For more information, see: Identifier Designation