DataTypeEncoding

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
sandeepraj
Full Member
Full Member
Posts: 6
Joined: 03 Jul 2013, 08:09

DataTypeEncoding

Post by sandeepraj »

Hi,

Can someone explain in detaila about the DataTypeEncoding, default binary & default xml ?
Can i use the HistoryReadResult->HistoryData.Body.Binary.Data in order to get the actual "value" of the node ? If so how is this different from HistoryReadResult->HistoryData.Body.Xml.Data ?

-Sandeep

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

Re: DataTypeEncoding

Post by Support Team »

Hi,

depending on the Encoding member of the ExtensionObject, one of the elements of the Body union of the ExtensionObject is set (Body.Binary, Body.Xml or Body.EncodeableObject).

For types that are known to the UaStack (e.g. OpcUa_HistoryData), the value is deserialized automatically and will be stored in Body.EncodeableObject, with Body.EncodeableObject.Type pointing to the according OpcUa_EncodeableType. In this case, Body.EncodeableObject.Object is a pointer to the deserialized structure.

Please refer to the examples of our SDKs to find sample uses of ExtensionObjects. For details and uses of dataEncoding, please refer to the UA specification, especially parts 4 and 6.

Best Regards,
Unified Automation Support Team

sandeepraj
Full Member
Full Member
Posts: 6
Joined: 03 Jul 2013, 08:09

Re: DataTypeEncoding

Post by sandeepraj »

Hi,

Many thanks for the reply !
I have another query, related to the extension object. Currently my implementation is in C++ and I see that in UA SDK the implementation for C#(extension object and other encodeable type objects) is different compared to C++.
Any pointer on how to proceed ?

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

Re: DataTypeEncoding

Post by Support Team »

Hi,

Extension object handling is definitely different in different programming languages and for SDKs / Stacks. The general OPC UA logic should be the same but coding and helper support may be completely different.

Best Regards,
Unified Automation Support Team

Post Reply