How to handle ByteString Method input arguments?|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
How to handle ByteString Method input arguments?
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
06/16/2020 - 05:54
sp_Permalink sp_Print

For instance:

Server provides Method A with

    --> InputArgument 0 --> DataType: ByteString (Server internal there is a fixed length of e.g. 10 Byte ProcessData mapping)

Client calls Method A with

    --> InputArgument 0: length=1, data=0x42

 

What is the correct server behaviour?

Shall/Could the server response looks like

    --> Call operation level result code = Bad_InvalidArgument

           --> Call Input Argument result code = Bad_OutOfRange

Or is there a silent padding required? (IMHO not a preferable solution)

 

tia

    

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
06/16/2020 - 06:42
sp_Permalink sp_Print

If padding is required it is specific to the server.

The Bad_OutOfRange is a code that would come from application code rather than SDK code.

Have you tried a 10 byte ByteString?

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
3
06/17/2020 - 02:58
sp_Permalink sp_Print

"The Bad_OutOfRange is a code that would come from application code rather than SDK code."

Ok, so my assumption from the first post is correct?

 - operation level result code = Bad_InvalidArgument

 - input Argument result code = Bad_OutOfRange

Both are set from the server application not SDK.

 

"Have you tried a 10 byte ByteString?"

We implement it that way, that only ByteString length == 10 for this certain Method as valid input argument is accepted.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
06/17/2020 - 12:13
sp_Permalink sp_Print sp_EditHistory

The Srever should have modelled the argument as:

DataType = Byte

ValueRank = 1

ArrayDimensions = { 10 }

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
5
06/18/2020 - 06:19
sp_Permalink sp_Print

But ArrayDimension only specifies the maximum.

Any write unequal to the ByteString length of 10 shall fail.

And the server responds:

 - operation level result code = Bad_InvalidArgument

 - input Argument result code = Bad_OutOfRange

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
06/18/2020 - 18:57
sp_Permalink sp_Print

I guess the issue is the Server has an requirement which cannot be modeled with the Argument structure.

Servers are allowed to enforce any number of semantic checks on the argument.

i.e. a arg1 has to be less than arg2.

All the server can do is document the behavior in the method description.

If the arg is not the required length the expected behavior is

- operation level result code = Bad_InvalidArgument

- input Argument result code = Bad_OutOfRange

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 13
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855