Variant Bytes of Variant in WriteValue missing

Questions regarding the use of the UaExpert.

Moderator: uaexpert

Post Reply
sschwinn
Full Member
Full Member
Posts: 6
Joined: 06 Oct 2021, 08:17

Variant Bytes of Variant in WriteValue missing

Post by sschwinn »

Hello dear support team,
It appears to be, that the data of Variants of writeValues is not encoded when writing a value. I created two types, a structure and a union, each containing a field of Variant(BaseDataType). When I want to write a value to a variable of these types the data does not contain the Variant.

Example 1 Union:
Field 3 is a Variant/BaseDataType. If I select the Variant in the Edit Value window it does not appear to contain any data. In the right frame you can see the data type definition. Below that is an excerpt of the encoded data, captured using wireshark. The ByteString of the ExtensionObject only contains 4 bytes, the bytes of the union switch field. The Variant (which is by default at least 1 byte) is completely missing.
Image

Example 2 Structure:
I also tested this in a structure. It is structured as follows:
  • 1. Field is the mandatory Variant
    2. Field is a mandatory 2 byte integer
    3. Field is a mandatory array of a 2 byte integer
    4. Field is an optional 2 byte integer
    5. Field is an optional array of the 2 byte integer type
As can be seen in the picture, the Variant is displayed in the attribute window (Field0) but it is missing in the Edit Value window. This behavior can be also seen in the encoded data, captured by wireshark. The ByteString of the ExtensionObject contains 10 bytes, but at least 11 bytes are expected:
  • 4 bytes for the optional field of the structure
    1 byte for the Variant Field0
    2 bytes for the 2 mandatory 2 byte integer
    4 bytes for the length of the mandatory array. In the message no data of the array is encoded, so only the length is encoded
Image

The used Version is 1.7.0 526.

If you need any further informations feel free to contact me.

Greetings,
Sebastian Schwinn

sschwinn
Full Member
Full Member
Posts: 6
Joined: 06 Oct 2021, 08:17

Re: Variant Bytes of Variant in WriteValue missing

Post by sschwinn »

Hello all,
I am sorry, I used the wrong links for the images:

Union:
Image

Structure:
Image

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

Re: Variant Bytes of Variant in WriteValue missing

Post by Support Team »

Hi,

thank you for the good description and analysis.

The bug you are describing is a known issue in UaExpert v1.7.0 (in fact it is an issue in the SDK the UaExpert is baed on) we are working on an update for both, the UaExpert and the SDK.

The UaExpert can not write to a structure field that has BaseDataType. With the previous UaExpert 1.6.3 this was possible, however having other issues. When downgraging to old UaExpert, make sure to manually uninstall the the 1.7.0 before. In any case your best option is to wait for UaExpert v1.7.1 comming within the next few weeks.
Best regards
Unified Automation Support Team

Post Reply