-

Data Types

This topic contains the following sections:

Two data type classes: standard and safety-related

Safety-related and standard (non-safety-related) code is strictly distinguished in PLCnext Engineer. Therefore, also safety-related and standard variables, or more precise, data types, are distinguished.

It is, for example, not possible to connect a variable with a standard data type to a formal parameter which expects a safety-related variable. In safety-related code worksheets, safety-related and standard variables can be mixed and directly connected to each other. This corresponds to an implicit data type conversion which requires some rules to be observed.

Standard (non-safety-related) data types

In contrast to user-defined data types, elementary and generic data types do not need to be declared as they are predefined in the system, and thus immediately available in each POU.

User-defined data types such as ARRAYs, STRUCTs and STRINGs must be declared in a data type worksheet using the text editor. The management of the data type worksheets is done in the 'Data Types' category in the COMPONENTS area on the right. Here you add new data type worksheets, open existing worksheets for editing or structure the category by inserting folders. Each data type declaration block starts with the TYPE keyword and ends with the END_TYPE keyword. A declaration block can contain one or more data type declarations.

Declaration example

Standard (non-safety-related) elementary data types can also be used in safety-related POUs. Rules have to be observed when mixing safety-related and standard data types.

Safety-related data types

Safety-related data types are exclusively elementary data types. Safety-related user-defined data types are not supported. The supported safety-related elementary and safety-related generic data types do not need to be declared as they are predefined in the system, and thus immediately available in each safety-related POU.

Safety-related data types can only be used in safety-related POUs.

Representation of safety-related and standard variables

For easier distinction of standard and safety-related variables, all safety-related variables are displayed with a yellow color marking in safety-related SNOLD code worksheets, variables grids and Data Lists. Variables of standard data types are shown without color marking.

While programming safety-related FBD/LD code in SNOLD worksheets, the continuous data flow analysis in the code highlights the leading safety-related signal paths of a network by displaying them as thick yellow lines. Refer to the topic "Mixing Safety-related and Standard Variables in the Code" for details.

User-defined data types and data types worksheets

The following descriptions only apply to standard data types.

Safety-related user-defined data types are not supported.

How to manage data type worksheets

How to open a data type worksheet

How to declare data types in a data type worksheet

How to declare local constants in a data type worksheet

How to define namespaces for user-defined data types

How to add a data type worksheet

How to import data types from another project or from a PLCopen XML file ‣ Importing Types from Another Project
×‣ Importing Types from PLCopen XML
×