Data Types

When programming in CODESYS, you can use different data types or instances of function blocks. Moreover, you assign a data type to every identifier. The data type defines how much memory CODESYS reserves and how these values are interpreted.

The following group of data types are provided:

Standard data types

CODESYS supports all IEC 61131-3 data types.

Data Type ‘BOOL’

Integer Data Types

REAL / LREAL

Data Type ‘STRING’

Data Type ‘WSTRING’

Time Data Types

Data Type ‘LTIME’

Extensions to the IEC 61131-3 standard

Data Type ‘UNION’

Data Type ‘BIT’

Special Data Types ‘__UXINT’ and ‘__XWORD’

Reference

Pointer

User-defined data types

You can create user-defined data types in two ways:

  • DUT object in the POU window
  • data type in a block in the declaration

Attention

Please note the recommendations for naming and object.

Data Type ‘ARRAY’

Structure

Enumerations

Reference

Pointer

Subrange Types

Identifier