DataTypeDefinition attribute

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

Moderator: uasdkcpp

Post Reply
mari21
Jr. Member
Jr. Member
Posts: 2
Joined: 16 Jun 2021, 08:58

DataTypeDefinition attribute

Post by mari21 »

Hello!

I'm new to OPC UA. I need to parse data from DataTypeDefinition attribute? I have looked through examples, but didn't find the one how StructureDefinition is extracted. Based on my understanding, after reading a DataType Node (with attributeId =OpcUa_Attributes_DataTypeDefinition) I extract an ExtensionObject from UaVariant value. Then I somehow should get UaStructureDefinition object from the ExtensionObject. And I'm not sure how to do it.
I would be appreciated if an example can be posted for retrieving data from DataTypeDefinition attribute.
Thank you!

mari21
Jr. Member
Jr. Member
Posts: 2
Joined: 16 Jun 2021, 08:58

Re: DataTypeDefinition attribute

Post by mari21 »

I've figured out that I can create an instance of the class UaStructureDefinitionDataType initialized with value from a UaExtensionObject and this will contain struct in DataTypeDefinition attribute. Also because OpcUa_StructureDefinition is known to client side stack it is automatically decoded by the stack and can be accessed directly. Is it a right way to consume data from DataTypeDefinition attribute?

Another question, how can UaStructureDefinitionDataType help decode a complex structure value of this type from an ExtensionObject?
Examples show how to do decoding using UaStructureDefinition, not UaStructureDefinitionDataType.

Thank you!

Post Reply