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.
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
- 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
The used Version is 1.7.0 526.
If you need any further informations feel free to contact me.
Greetings,
Sebastian Schwinn