Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Simulator returns an invalid variant type id for some attributes
September 26, 2019
15:26, EEST
Avatar
jonathancamp
Member
Members
Forum Posts: 3
Member Since:
August 2, 2019
sp_UserOfflineSmall Offline

When querying an attribute like `Description` the server responds with a a DataValue that has it’s variant type id set to 0x00 (which is invalid).

See github issue: https://github.com/gopcua/opcua/issues/283

// jonathan

September 26, 2019
16:24, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 402
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Correct if I misunderstood.

0x00 is valid, see specification 1.04 Part 6 section 5.2.2.16 Variant and Table 15, it mentions for the EncodingMask the following:

“EncodingMask Byte The type of data encoded in the stream.
A value of 0 specifies a NULL and that no other fields are encoded. …”

I think that was added in 1.04, previously it was sort of assumed.

To my understanding there is at least 3 different ways to encode e.g. a null String. 1) DataValue’s EncodingMask defines no Variant in stream 2) Variant EncodingMask 0 3) The actual null-encoding of a String type (-1 length for the UTF-8 byte array). Yes it is a pain. Basically client applications will have to deal with all of them. Additionally apparently a combination of Null value and Status Good should not be combined, but this is not mentioned in the specification (we’ll fix this at some point, but would like errata or future version to clarify this).

We could maybe improve this in a future version of our Java SDK, which is used to make the Simulation Server (currently SDK is at 4.1.2 and SimulationServer is at 4.0.0), as it is sort of unneeded bytes transmitted, but those code logics are quite old and have been interop tested in IOP workshops.

P.S. There is more than one way to interpret DataValue’s EncodingMask. One way is that a false bit -> not encoded in stream and has this default value, but that is just an option. Second is that if the value would be null, then the bit has to be false

September 27, 2019
9:42, EEST
Avatar
jonathancamp
Member
Members
Forum Posts: 3
Member Since:
August 2, 2019
sp_UserOfflineSmall Offline

Ah I see, I was only looking at the table in 5.1.2.

I’m ok with status = good and encoding mask = 0 translating to a null value. I was just expecting to see an explicit null type in 5.1.2.

// jonathan

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 78

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 91

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 880

Moderators: 12

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 892

Posts: 3744

Newest Members:

Fervic1991, ivfa, tplbev1272761848, vinwin, ancyss, dj, Thomas, Viral, nedumarans, Dhruvil Dhanani

Moderators: Jouni Aro: 833, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 402, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 16, Markus Johansson: 1

Administrators: admin: 0