4.4.3.6 Data types
Of the data types defined in CoDeSys the following are approved for creating safety-oriented applications:
Table 11: Simple data type
Keyword Suitable (Yes / To a limited extent / No) (comment)
BOOL Yes
BYTE, SINT, USINT Yes
WORD, INT, UINT Yes
DWORD, DINT, UDINT Yes
TIME, TOD, DATE, DT Yes
STRING To a limited extent (technically possible, although it makes little sense due to
the lack of safety-oriented input/output devices)
REAL To a limited extent (prone to error through rounding errors, therefore no query
with EQ operator, note invalid operations such as division by zero, square
root of a negative number, logarithm of a negative number)
Table 12: Complex data types
Keyword Suitable (Yes / To a limited extent / No) (comment)
ARRAY To a limited extent (Only with explicit range check, otherwise too prone to
errors)
STRUCT Yes
Listing types Yes
Subrange types Yes
POINTER To a limited extent (Recommended measures: no pointer arithmetic, range
check, new allocation of pointer value at the start of each cycle)
The following rules must be followed when complex data types are used:
n For complex data types we recommend using type declarations
n Before each access to an array an explicit range check of the index should be carried out. In the event of
a violation that cannot be explained through the application, the control system should be switched to
safe state.
DANGER!
The memory access using POINTERs (e.g., ADR function) is error-prone and is generally NOT recom-
mended. If used in safety applications, then the responsibility for correct usage of these and related
functions lies entirely with the organization and persons who use those functions in AC500-S safety
PLC.
Configuration and programming
CoDeSys Safety programming guidelines > Language-specific programming guidelines
30.03.2017 AC500-S 215