CODESYS supported
access
Data types and data conversion
The CODESYS driver supports the CODESYS PLC data types and their mapping to runtime data types as follows:
CODESYS data type | Runtime data type |
---|---|
SINT | INT1 |
INT | INT2 |
DINT | INT4 |
LINT | INT8 |
USINT | UINT1 |
BYTE | UINT1 |
UINT | UINT2 |
WORD | UINT2 |
UDINT | UINT4 |
DWORD | UINT4 |
ULINT | UINT8 |
REAL | FLOAT4 |
LREAL | FLOAT8 |
BOOL | BOOL |
BIT | BOOL |
BITORBYTE | BOOL |
STRING | STRING(n) where n is the string size. The default size is 80 characters, if not specified in the PLC definition. |
DATE | TIMESTAMP |
DT | TIMESTAMP |
DATA | STRUCT |
ENUM | UINT1, UINT2, UINT4, or UINT8 depending on the data represented in the enumeration list. |
The CODESYS driver supports CODESYS PLC user defined datatypes and ARRAYS, for all of the above data types, up to three levels (x, y, z). The driver does not currently support TIME, TIME OF DAY, DATE AND TIME, POINTER, and ALIAS data types.
The CODESYS PLC data types are supported in the the runtime environment wherever a variable is accessed and the variable is associated with a CODESYS PLC device. Some examples are:
- Workbench Variables window Read as and Write as functions
- Transport map data type parameters
- Trigger data type parameters
- Trigger action variable data type parameters.
The data representations in the CODESYS PLC, the runtime and the Workbench are supported by the necessary data conversion functions (e.g. Real and Float4). CODESYS tags can be organized as items in a group. The group / item relationship is maintained by driver.