Structure with optional fields not decoded correctly
Posted: 02 Jun 2022, 21:52
Hi,
I am having trouble getting UaExpert to read structures with optional fields. This occurs whether or not fields are specified or not - the problem seems to be the inclusion of the EncodingMask field which then causes UaExpert to read fields at the wrong offset. If I omit the EncodingMask field (i.e. violate OPC 10000-6 5.2.7) then UaExpert will be able to decode the field values.
The structure I am sending looks like:
-Optional UInt32
-LocalizedText
-Optional UInt32
Here is how the structure looks:
https://i.postimg.cc/vbF5QfkK/optional-fields.png
Captured on WireShark, the Variant looks as follows:
1601026103011d00000003000000aaaaaaaa0305000000656e2d55530300000058585855555555
In this capture, FieldA=0xAAAAAAAA, FieldB=("en-US", "XXX"), FieldC=0x55555555
Note the UInt32 value immediately prior to FieldA is "3", which is the EncodingMask indicating that both optional fields are specified.
Can you please see anything I am doing wrong?
Thanks
I am having trouble getting UaExpert to read structures with optional fields. This occurs whether or not fields are specified or not - the problem seems to be the inclusion of the EncodingMask field which then causes UaExpert to read fields at the wrong offset. If I omit the EncodingMask field (i.e. violate OPC 10000-6 5.2.7) then UaExpert will be able to decode the field values.
The structure I am sending looks like:
-Optional UInt32
-LocalizedText
-Optional UInt32
Here is how the structure looks:
https://i.postimg.cc/vbF5QfkK/optional-fields.png
Captured on WireShark, the Variant looks as follows:
1601026103011d00000003000000aaaaaaaa0305000000656e2d55530300000058585855555555
In this capture, FieldA=0xAAAAAAAA, FieldB=("en-US", "XXX"), FieldC=0x55555555
Note the UInt32 value immediately prior to FieldA is "3", which is the EncodingMask indicating that both optional fields are specified.
Can you please see anything I am doing wrong?
Thanks