UaModeler  1.6.3.454
DataTypes

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.

add_enum_2.png

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 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_enum.png

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.

add_structure_2.png

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.
Type
This specifies the data type of the field.
IsArray
Specifies if the field is a scalar value or an array.
Description
Here you can add descriptive text which is displayed in the generated code or in a GUI.
Optional
Specifies if the field is optional.
ArrayDimensions
If the field is an array, you can specify the maximum array length for the field.
MaxStringLength
If the DataType of the field is String or ByteString, you can specify the

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.

It is possible to define optional fields. Clicking on the respective entry in the “Optional” column will display a check box to toggle the value between false and true.

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.
add_structure.png

Add a Union DataType

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

A Union is a special case of a structured DataType. In contrast to “normal” structured DataTypes not all fields of the structure have to be set when creating a value of the DataType, e.g. only one field can be set. Unions can be null, that means it is also possible that no field is set.

Add an OptionSet DataType

A new OptionSet DataType can be a subtype of

  • DataTypes → BaseDataType → Number → UInteger → Byte
  • DataTypes → BaseDataType → Number → UInteger → UInt16
  • DataTypes → BaseDataType → Number → UInteger → UInt32
  • DataTypes → BaseDataType → Number → UInteger → UInt64
  • DataTypes → BaseDataType → Structure → OptionSet

To create an OptionSet data type, use the context menu of the parent type in the Information Model window or use the “Add Subtype” button in the types view when “OptionSet” is selected (only available for OptionSet data types that are subtypes of a Structure).

OptionSet DataTypes represent bit mask. For example, a DataType describing access rights has three options: readable, writable and executable. There are eight different combinations of these options, which can be described by 3 bits.

When using OptionSet DataTypes that are subtypes of a Number, the whole bit mask has to be written in a Write operation, just like writing “normal” number DataTypes.

For OptionSet DataTypes that are a subtype of Structure, a special handling is defined. These OptionSets consist of a ByteString Value and a ByteString ValidBits. The ValidBits define the bits of Value to be written to the node.

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.