UaModeler  1.6.3.454
Object- and VariableTypes

Add New Type

You can create a new Object- or VariableType to your model using the context menu in the Information Model window. Adding either type is very similar. The only difference is to select an ObjectType for adding a new ObjectType and to select a VariableType for adding a new VariableType. The selected Type will be the parent of the newly created Type.

Choose “Add New Type” from the context menu in the Information Model window or click on the button “Add Subtype” in the Main Window while in Types View.

new_type.png

Now you can perform basic settings for your new type node in the Main Window.

add_objecttype_document.png

Attributes

ObjectTypes

You can edit the basic settings of the new type node within the Type tab of the document. The Name field will set the browse name as well as the display name. This name is also used as the SymbolicName of the name and is used as the TypeName in the generated code. If the color of the name just typed turns red, the name cannot be used in the code.

With the IsAbstract checkbox you can set the IsAbstract attribute of the node.

The Namespace drop down box specifies the model the new type will belong to. Note that you can only choose user defined models here.

With the Override button you can select children of supertypes. You can get more information about this topic in Children of a Type.

In the Additional Attributes tab you can set the DisplayName, the BrowseName and the description attribute. If editing NodeIds is enabled (see Edit NodeIds), you can also edit the NodeId. Note that display name and browse name will receive initial values when editing the Name field.

VariableTypes

Setting the attributes of the new VariableType is similar to setting the attributes of an ObjectType. In addition to the Namespace, Name and IsAbstract field in the Types tab, it is possible to set the Data Type. Instances of the VariableType have the same or a subtype of the selected data type.

The Additional Attributes tab contains in addition to the fields NodeId, DisplayName, BrowseName and Description the possibilitiy to set the Value, ValueRank and ArrayDimensions.

Parent of the New Node

In the Parent tab you can change the parent of the new type to another ObjectType or a VariableType respectively. By default the parent is the selected node in the treeview when opening the document. Only other ObjectTypes (when adding am ObjectType) or VariableTypes (when adding a VariableType) can be selected because the new type always will be a subtype of another type. Creating a new ObjectType that is not derived from BaseObjectType directly or indirectly is not supported by the UaModeler.

Children of a Type

In the Children tab you can add instance declarations to the new type. By selcting a node class a new entry will be added to the table. For ObjectTypes you can select between Object, Variable and Method. For each of these node classes you will have to set a name and a modelling rule. For Objects and Variables you also have to set a type definition. If the name has not been edited when setting the type definition, a default name will be inserted to the name field.

Variables additionally have a datatype which has to be selected. Depending on the selected type definition the data type that can be selected may be resticted.

Finally you can set additional attributes for the children by expanding their entries.

add_objecttype_expand.png

These attributes are display name, browse name and the description. Again, these attributes receive initial values when the name of the child is set. In addition to that, you also can select the reference type between the newly created Type and its child.

Depending on the node class of the child you also can set the following attributes:

Object

  • EventNotifier

Variable

  • Value
  • ValueRank
  • ArrayDimensions
  • AccessLevel
  • AccessLevelEx
  • MinimumSamplingInterval
  • IsHistorizing

Method

  • Executable

By clicking the green “+” symbol the current instance declaration will be cloned and by clicking the red “x” symbol the instance declaration will be removed.

You can add method arguments by clicking at the green down arrow symbol and setting names and data types to Input- and OutputArguments. A new argument is created by setting the name. Then you can select the data type, the description and the value rank of the argument. By clicking the “+” symbol the actual argument will be cloned and by clicking the “x” symbol the actual argument will be removed.

add_objecttype_method.png

The children of VariableTypes must have the node class Variable.

Overriding Members

In object orientated programming languages, method overriding is one of the most comfortable ways to design good code. With this feature, a subclass can replace the implementation of the method of a base class by another concrete implementation. The method must have the same signature in the derived class as in the base class. It is recommended that the overriding method should do the same as the method in the base class, but in a more concrete way.

Equipollently to this you can override instance declarations in OPC UA, which means that a child of a base type can occurr also at a subtype. The node at the subtype must have the same browse name as the node at the base type, what is the equivalent to the same method signature in object orientated programming languages. The type definitions of this overriding nodes must be the same or subtypes of the type definition of the overriden nodes.

Supporting this feature, the UaModeler provides the Override button in the Add ObjectType and Add VariableType documents. When clicking this button, a dialog appears where all children of the super types are listed. The selected nodes will be added to the children view and the attriributes of these children cannot be modified. Only the type definition and the data type can be constrained.

If you create an instance of this type (see Instances), only the overriding members are created and not the overriden members of the base classes.

gui_override.png

Additional References of a Type

In the References tab you can add additonal references to the new ObjectType. The HasSubtype reference from the parent node to the new node as well as the hierrarchical references from the new node to its children are not shown in this tab and do not have to be inserted here. The user is responsible for a reasonable use of the additional references.

An additional reference is created by selcting a reference type and a target node. The target node must already exist when the document is opened, i.e. additional references to own child nodes cannot been added. To do this you must create the type by clicking OK and then modify the type.

Modify a Type

You can modify any user defined Object- or VariableType by using the context menu of a node in the Information Model Window or by using the Types View. In the same way that nodes are added you can modify them.

By clicking the green “+” this node and all children are copied. By clicking the red “x” the node and its children are removed.

If you are not allowed to modify all attributes of a child, because the child is overriding a member of a base class, the corresponding editors are disabled (see Instances and Children of a Type).

Modifying an Object- or a VariableType has effect on instances and instance declarations: All the changes on the type will be applied to these nodes.

Delete a Type

An Object- or a VariableType can be deleted using the contect menu of a type node in the Information Model window. When a type is deleted all hierarchically referenced nodes are deleted, too.

Deleting a type can have an effect on other nodes. The concept of these effects is explained in the following short examples.

Effect on Instances

When an ObjectType is deleted, all instances of this type receive the type definition of the super type of the deleted type.

To show this, we add an ObjectType and a subtype of this type, each with two children. Afterwards, we create an instance of the subtype. The information model view should look like this:

delete_instance1.png

Then we delete the subtype. Since the instance of the deleted type receives the typedefinition of the super type, the children derived from the deleted type will be removed. The next image shows the resulting information model.

delete_instance2.png

Effect on Instance Declarations

When an ObjectType is deleted, all instance declarations of this type receive the type definition of the super type of the deleted type.

To show this, we add an ObjectType and a subtype of this type, each with two children. Afterwards we create another ObjectType that has a child with the sub type as type definition. The information model view should look like this:

delete_instancedecl1.png

Then we delete the subtype. Since the instance declaration of the deleted type receives the typedefinition of the super type, the children derived from the deleted type will be removed. The next image shows the resulting information model.

delete_instancedecl2.png

One can see that the ObjectType AABType has been modified. These changes will be applied to all instances of this type (See Modify a Type).