Structure with optional fields not decoded correctly

Questions regarding the use of the UaExpert.

Moderator: uaexpert

Post Reply
Jr. Member
Jr. Member
Posts: 1
Joined: 02 Jun 2022, 21:08

Structure with optional fields not decoded correctly

Post by elliotg »


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
-Optional UInt32

Here is how the structure looks:

Captured on WireShark, the Variant looks as follows:

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?


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

Re: Structure with optional fields not decoded correctly

Post by Support Team »


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:
Best regards
Unified Automation Support Team

Post Reply