Symbol:
-
for a DUT without text list support
-
for an enumeration data type with text list support
A DUT (Data Unit Type) declares a user-specific data type.
You can add this kind of object below the application or in the “POUs” view. When the object is created, the “Add DUT” dialog opens. There you select among the data types ⮫ Structure, ⮫ Enumeration, ⮫ Alias, or ⮫ Union.
Moreover, enumerations can have a stored text list to localize the enumeration values. As a result, the object also has a localization view.
Syntax
TYPE <identifier> : <data type declaration with optional initialization> END_TYPE
How the data type declaration has to be done syntactically depends in detail on the selected data type.
Examples
Declaration of a structure
TYPE S_POLYGONLINE : STRUCT aiStart : ARRAY[1..2] OF INT := [-99, -99]; aiPoint1 : ARRAY[1..2] OF INT; aiPoint2 : ARRAY[1..2] OF INT; aiPoint3 : ARRAY[1..2] OF INT; aiPoint4 : ARRAY[1..2] OF INT; aiEnd : ARRAY[1..2] OF INT := [99, 99]; END_STRUCT END_TYPE
Extension of a structure
TYPE S_PENTAGON EXTENDS S_POLYGONLINE : STRUCT aiPoint5 : ARRAY[1..2] OF INT; END_STRUCT END_TYPE
Declaration of an enumeration
{attribute 'qualified_only'} {attribute 'strict'} TYPE E_TRAFFICSIGNAL : ( eRed, eYellow, eGreen := 10 ); END_TYPE
Enumeration with text list support in the localization view

The
“Textual View” and
“Localization View” buttons are located on the right edge of the editor. Click the buttons to toggle
between the views.
Declaration of an alias
TYPE A_MESSAGE : STRING[50]; END_TYPE
Declaration of a union of components with different data types
TYPE U_DATA : UNION lrA : LREAL; liA : LINT; dwA : DWORD; END_UNION END_TYPE
-
Dialog: Add DUT