Defining ObjectTypes with nested arrays using the GUI

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
mwa
Jr. Member
Jr. Member
Posts: 2
Joined: 19 Apr 2016, 13:40

Defining ObjectTypes with nested arrays using the GUI

Post by mwa »

Hello,

using the UaModeler GUI (running version 1.4.2 342) I need to define ObjectTypes, which have children that consist of nested arrays of NodeIds:
Type ---contains---> ContainerArrays ---contains---> ArrayOfNodeIds, so that referencing a specific NodeID would look like this:
Type.ContainerArrays[1].ArrayOfNodeIds[2].

How can this be achieved using the GUI? As it seems, UaModeler does not allow to re-model structures like the nested arrays that come with the default NodeSets, defined as subtypes of BaseDataVariableType. However, it seems this is exactly what I would need...

Thanks for advice.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Defining ObjectTypes with nested arrays using the GUI

Post by Support Team »

Hello,

What do you mean with ContainerArrays and ArrayOfNodeIds?
Children ObjectTypes can have the NodeClasses Object, Variable and Method.
Is ContainerArrays a child of the ObjectType? What is the NodeClass?
Or are there many children of the type, i.e. ContainerArrays means many Container children?
Is ArrayOfNodeIds a child of ContainerArrays? Or is the a child (NodeClass Variable) of ContainerArrays with a value containg an array of NodeIds?

What do you mean with "nested arrays that come with the default NodeSets"?

Please be more precise or give a good example.

Best regards
Support Team

mwa
Jr. Member
Jr. Member
Posts: 2
Joined: 19 Apr 2016, 13:40

Re: Defining ObjectTypes with nested arrays using the GUI

Post by mwa »

I would like to learn the precise way of defining a structure (i.e. an ObjectType) with nested arrays of NodeIds as children using UaModeler, that is there should be a nesting of 1:n relationships for a BaseObject ("(1:n):m") consisting of:
  • one BaseDataVariableType "MyArrayOfNodeIdsType", which is an array of NodeIds (in C# this could be expressed like "ArrayList<NodeId>" (or Array or List instead of ArrayList)).
  • one BaseDataVariableType "MyContainerArray", which is an array of "MyArrayOfNodeIdsType" elements (in C#: "ArrayList<ArrayList<NodeId>>" (or Array or List instead of ArrayList)).
  • one BaseObjectType "MyObjectType", which needs to have one child of type "MyContainerArray" (in C#: "class MyObjectType () {MyContainerArray MyMember; [...]}" (or Array or List instead of ArrayList)).
In the default NodeSet of Namespace "http://opcfoundation.org/UA" there is e.g. the BaseDataVariableType of "SubscriptionDiagnosticsArrayType", which hosts as a child an array of elements with TypeDefinition "SubscriptionDiagnosticsType" and DataType "SubscriptionDiagnosticsDataType". However, this is defined using a ModelingRule "ExposesItsArray", which cannot be selected in the UI (as some other modeling rule, too). Also, under "Value" in "Additional Attributes" this shows a FieldName "ListOfSessionSecurityDiagnosticsArrayType" with Value "Empty Array".
It seems that structures like this are what I need, however UaModeler seems to not support the creation of these. At least I have not yet found a way of defining such array structures, which I presume has also something to do with that non-availability of the "ExposesItsArray" modeling rule in the UI.

Thank you for any advice.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Defining ObjectTypes with nested arrays using the GUI

Post by Support Team »

Hello,

The ModellingRule ExposesItArray is not supported by UaModeler (neither for modelling nor for code generation). Your server application can support this feature by creating nodes for each array element of the value. The application is responsible that the values of the parent and the children are constent.
We recommend to use only one variable with value and not to use multiple children the contain the same information in addition. Even generic clients like UaExpert can read arrays of structures. Splitting the the arrays to multiple nodes does only make sense if you expect that clients are interested in only single parts of the value.

Best regards
Support Team

Post Reply