Unnamed complex structure in complex structure

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
smueller
Full Member
Full Member
Posts: 5
Joined: 08 Feb 2013, 08:11

Unnamed complex structure in complex structure

Post 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

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

Re: Unnamed complex structure in complex structure

Post 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

Post Reply