Status code to return when writing the value of a read-only variable node|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
Status code to return when writing the value of a read-only variable node
Avatar
Jonas Green
Halmstad, Sweden
Member
Members
Forum Posts: 23
Member Since:
05/24/2017
sp_UserOfflineSmall Offline
1
10/24/2017 - 01:12
sp_Permalink sp_Print

We have posted a question about this in the OPC Certification and Interoperability Testing forum a while ago and haven't received any response so I try to post it here (https://opcfoundation.org/foru.....ble-nodes/)

My question is what status code to return when a client tries to set the value of a variable node when only the read bit of the AccessLevel attribute is set? The UA CTT expects either Good or BadNotWritable. But in Part 3 table 3 (Bit mask for WriteMask and UserWriteMask), it is stated, for ValueForVariableType, that “It does not apply for Variables since this is handled by the AccessLevel and UserAccessLevel Attributes for the Variable. For Variables this bit shall be set to 0.”

Doesn’t this mean that the accepted status code in addition to Good should be BadUserAccessDenied?

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
10/25/2017 - 10:21
sp_Permalink sp_Print

When in doubt go with what the CTT does unless the specification directly contradicts the specification or if there is some unique aspect of your system that could justify adjustments to the CTT. Simply returning a different error code does not seem to a big issue.

Avatar
Paul Hunkar
Member
Members
Forum Posts: 27
Member Since:
07/05/2017
sp_UserOfflineSmall Offline
3
10/25/2017 - 12:43
sp_Permalink sp_Print

Can you provide the actual CTT test case you are looking at, including the version of the CTT you are using?  This allows us to look at the actual test that you are having an issue with.  Some additional information on what you are asking:

Table 3 Part 3 - Bit mask for WriteMask and UserWriteMask describe what the bits in the writemask/userwritemask apply to.  there is no bit for value, since the value is handle separately.  The ValueForVariableType bit is if the value field is in a VariableType definition - i.e. what it is stating is that this bit is only for a VariableType not a Variable.

The value field is only governed by the fields described in table 8 - i.e. AccessLevel and UserAccessLevel

So an Access level of read is not a user access level restriction, it is just not writeable.  Typically the write operation would check if the variable is even writeable, before it check if the user has write access.  If you provide more information on the actual test case and ctt version we can check if it needs to be updated.

Paul

Avatar
Christoffer Lind
Member
Members
Forum Posts: 4
Member Since:
07/03/2017
sp_UserOfflineSmall Offline
4
10/26/2017 - 01:26
sp_Permalink sp_Print

We agree that there is a difference between user access level and access level and that if a variable is writeable or not should be checked before the access level for the current user. We went ahead and made this change in our implementation and returned an error code that we believe is appropriate in this case (Bad_NotWritable). The CTT expects a different error code though, either Good (0x00000000) or BadWriteNotSupported (0x80730000).

Table 60 - Write Operation Level Result Codes (Part 4 1.03) lists all acceptable StatusCode for the write service. As I understand it Bad_WriteNotSupported (which the CTT suggests) shall be used if the write combination isn't supported or if writing and IndexRange isn't supported. If the variable itself isn't writable I think Bad_NotWritable should be used instead, do you agree?

The underlying problem here though is probably that the CTT expects all nodes specified in "Server Test->NodeIds->Static->All Profiles" to be both readable and writable (as suggested by the tooltip for those nodes). Our implementation doesn't support any writable nodes so this is a problem for us as we can't specify such nodes.

You can see the error output from the CTT as well as the relevant test case in the image below (is there a way to export the log in any other way?).

View post on imgur.com

Christoffer

Avatar
Paul Hunkar
Member
Members
Forum Posts: 27
Member Since:
07/05/2017
sp_UserOfflineSmall Offline
5
10/31/2017 - 20:41
sp_Permalink sp_Print

Christoffer,

We are aware of the issue in the CTT with Servers that are ReadOnly.  There are a number of information models that provide ReadOnly data.  We have a Mantis issue on the CTT.   The test lab can work around this problem and certify a product that only has ReadOnly nodes, but we agree that the CTT should be able to support a ReadOnly configuration. 

https://opcfoundation-onlineap.....hp?id=4042

The list of Test cases that need to be fixed is long, thus we are targeting fixing this issue in the 1.04 build of the CTT.

Paul

Avatar
Christoffer Lind
Member
Members
Forum Posts: 4
Member Since:
07/03/2017
sp_UserOfflineSmall Offline
6
11/06/2017 - 02:47
sp_Permalink sp_Print

Thank you for your support. I guess we will have to live with the errors we are getting from the CTT for now and wait for a new version. I have added a note to your Mantis issue regarding periodically changing points.

Christoffer

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Piotr Iwanowski
Guest(s) 35
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1350
Posts: 4578