UaModeler  1.3.2.273
 All Pages
DataTypes

This section provides the following parts:

Add an Enumeration

You can create a new enumeration data type by using the context menu of Types → DataTypes → BaseDataType → Enumeration in the Information Model window or by using the “Add Subtype” button in the types view when “Enumeration” is selected.

As described previously for ObjectTypes, you can set the name and the IsAbstract attribute in the “Types” tab, as well as Display Name, Browse Name and Description in the “Additional Attributes” tab. You cannot change Parent in the “Parent” tab or add additional references in the “References” tab.

Instead of the “Children” tab for adding additional nodes, the main window contains the tab “EnumValues” for adding string-number pairs for the human-readable representation of the enumeration.

At the top of this tab you can find radio buttons to choose between

Ascending
The enum values are ascending, beginning with 0.
Mask
The enum values double for each value, e.g. 1, 2, 4, 8. This can be used to define flags.
Gap
The enum values can be chosen freely.

Depending on your choice an EnumStrings- or an EnumValues-property is created.

The EnumString field is used to display enum values, the SymbolicName field is used for the enum representation in the generated code. You must not use a string twice for the SymbolicName. Otherwise the generated code will not compile.

You can add a Description for each enum value. Click the “up” and “down” arrows to change the position of the current entry. You can use the tab key to move to the next line and add a new string.

Clicking the green “+” adds a new enum string to the view. The new name will be created from the enum string in the current line and a counter to keep the enum values unique. If you click the red “x” the enum string in this line will be removed.

Note
If you add the same SymbolicName twice, the UaModeler will not generate compilable code.

Add a Structured DataType

You can create a new structured data type by using the context menu of Types → DataTypes → BaseDataType → Structure in the Information Model window or by using the “Add Subtype” button in the types view when a structure is selected.

As described previously for ObjectTypes, you can set the name and the IsAbstract attribute in the “Types” tab, as well as Display Name, Browse Name and Description in the “Additional Attributes” tab. You cannot change Parent in the “Parent” tab or add additional references in the “References” tab.

A structure consists of at least one field containing following entries:

DisplayName
This is the name of the field displayed in a GUI.
SymbolicName
This name is used as the representation of the field in the code.
DataType
This specifies the data type of the field.
Description
Here you can add descriptive text which is displayed in the generated code or in a GUI.

Each field can be an array. Clicking on the green “+” adds a new field to the view. The new name will be created from the DisplayName in the current line and a counter to keep the field names unique. If you click the red “x” the enum string in this line will be removed.

You can add a Description for each field. Click the “up” and “down” arrows to change the position of the current entry. You can use the tab key to move to the next line and add a new field.

If the Add VariableType check box in the “Type” tab is selected, the UaModeler will automatically create a VariableType that contains a child for each field of the structure. This type makes the individual fields visible/readable to clients.

Note
Structured DataTypes are not supported by all TemplateSets. See Template Set for further information.

Modify a DataType

All attributes of an Enumeration or a Structure that you can edit when creating the DataType can be modified later. You can also edit the EnumStrings or the fields of the Structure. See Add an Enumeration or Add a Structured DataType for further information.

Delete a DataType

You can delete a DataType using the context menu of the Information Model window. If the DataType is already in use as data type of a Variable or a VariableType, its data type gets invalid.

So do NOT delete a DataType that is already in use.