In CODESYS Safety Extension, a distinction is made between non-safety-oriented data (the IEC standard data types) and safety-oriented data (with the prefix SAFE). When mapping input and output channels, those of safe field devices always have the type SAFExxx and those of non-safe field devices always have a non-SAFE type. The checking of the PLCopen linking rules for SAFEBOOL data and analogous linking rules for the other SAFEXXX data types is part of the check for error conditions in the programming system.
Table 6. IEC standard data types
|
Data Type |
Bit Length |
Value Range |
Description |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Duration |
|
|
|
( |
|
Tip |
|---|---|
|
The |
Table 7. SAFE data types
|
Data Type |
Bit Length |
Value Range |
Description |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
( |
|
Tip |
|---|---|
|
The |
The User-defined Types data type category contains function blocks of the safety application and the libraries. This category can be selected in the Input Assistant, which is opened in the Insert Variable Declaration dialog by clicking the
button. In the case of already declared variables the Input Assistant of the data type is opened as follows:
-
In the declaration window, select the type cell of the corresponding variable.
-
In the list box, click the ... symbol.
A value of the type INT or SAFEINT always has the type DINT or SAFEDINT as well. The linkage of INT and DINT leads to a DINT value (int + dint has the type DINT).
A value of the type SAFEXXX always has the type XXX as well; i.e. a value of high integrity can always also be used as a value of low integrity. This means that the conversion function SAFEBOOL_TO_BOOL mentioned in PLCopen is implicit in CODESYS Safety Extension and is not explicitly written.
Constants are always values of the highest integrity (i.e. SAFEXXX). Due to the SAFE polymorphism they can still serve as normal values. One thus saves having two different kinds of values (safebool#1 as well as bool#1).bool#1 is SAFEBOOL (and BOOL); the same applies to the other literal constants.