Page 1 of 1

Unnamed complex structure in complex structure

Posted: 31 Jul 2014, 14:02
by smueller
Hello,

we're are looking for a way to define an unnamed complex structure under a defined complex structure. In other words we want to have a structure in a structure without to define the data type of the substructure by itself, e.g. as it is possible in XML schemas. Is this possible by using the ANSI C SDK or is it not supported by OPC UA at all?
We did try out the following data structure:

Code: Select all

 <opc:StructuredType BaseType="ua:ExtensionObject" Name="TestDataType">
  <opc:Field TypeName="ua:ExtensionObject" Name="TestStruct">
  <opc:StructuredType BaseType="ua:ExtensionObject">
  <opc:Field TypeName="opc:String" Name="AxisName"/>
  <opc:Field TypeName="opc:Double" Name="Position"/>
  <opc:Field TypeName="opc:String" Name="Unit"/>
  </opc:StructuredType>
  </opc:Field> 
 </opc:StructuredType>
Thanks and greetz
smueller

Re: Unnamed complex structure in complex structure

Posted: 05 Aug 2014, 15:03
by Support Team
Hello,

OPC UA allows to define structured DataTypes that have fields with another structured DataType. This structure definition needs not to be exposed by an own OPC UA DataType node in addressspace.
However, in the DataType dictionary the nested structured DataType must be exposed by an own <opc:StructuredType> node.

UaModeler does not support this feature.
So you have to add the DataType node, the encoding methods and the dictionary by hand.
Or you decide to add the nested structure definition as a second DataType and create the DataType code and the dictionary by UaModeler.

Best regards
Support Team