11/06/2023
11/06/2023
Hi Randy
I have created 3 custom structure DataTypes and trying to read the value as mentioned above.
By reading objects I mean, I have created node in address space and trying to read the node from address space. node is type of Test DataType.
While reading node in Value attribute I have testData but in testData I can only see parent field not child field, but I have assigned Child type so client should be able to decode it correctly.
Please let me know If any other information I can provide
Thanks
Rahul
10/18/2019
If I understand the topic, this is the scenario:
- TestStructure
- TestParentStructure testData;
- TestParentStructure
- Int32 parent1;
- TestChildStructure
- Double child1;
- Question:
- During runtime instantiation, if testData == an instance of TestChildStructure, then how DOES the client know it?
@Rahul, I guess this is what your question is.
11/06/2023
Yes Mohit,
Client decode the ExtentionObject using encoding id but how client will know the encoding id of Fields. I didn't find anything on UA Specs related to this if Fields are also ExtentionObject. How should server encode the data so that Client will know the actual type of Fields.
I have checked couple of OpcUa Clients that are decoding the extention object based on encoding id and after getting actual type of ExtentionObject, Fields are decoded based on DataTypes. This can be wrong in the situation where fields are storing subtypes as in my case.
If there is any documentation or reference for this situation please let me know.
Thanks
Rahul
05/30/2017
The UABinary encoding is defined completely here:
https://reference.opcfoundatio.....5/docs/5.2
It explains that each field in a structure is encoded using the encoding for the datatype.
It also explains that embedded structures are encoded directly with no type id.
That said, if the DataType of the field has the AllowSubtypes flag set then the Structure is encoded as a ExtensionObject.
1 Guest(s)