Page 1 of 1

Structure with optional fields not decoded correctly

Posted: 02 Jun 2022, 21:52
by elliotg
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:
Image
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

Re: Structure with optional fields not decoded correctly

Posted: 03 Jun 2022, 09:02
by Support Team
Hi,

What version of UaExpert do you use?
Does your server provide a DataTypeDictionary for the DataType(s)?

UaExpert is reading first the DataTypeDictionaries and is using the DataTypeDefinition Attribute only if the DataTypeDictrionary does not exist.

Can you provide a XML UANodeset with the DataType?
Can you provide a stand alone demo server that we can use for testing (or online access)?

Please open a ticket for UaExpert if you are able to provide more information to us:
https://webdav.unifiedautomation.com/support/support_form.html