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
Unable to set WriteMask
February 6, 2020
13:23, EET
Avatar
prasha173
Member
Members
Forum Posts: 9
Member Since:
January 16, 2020
sp_UserOfflineSmall Offline

Hi
I am new to OPC UA , And as per my understanding if I want to write any attribute except ‘Value’ then we should set bit WriteMask/ UserWriteMask for that attribute.
But when i try to write on WriteMask attribute itself then I am getting following error.

attribute: WriteMask
Writing to node ns=3;s=var10 – var10
Enter the value to write: 1

com.prosysopc.ua.StatusException: Bad_NotWritable (0x803B0000) “The access level does not allow writing to the Node.” StatusCode=Bad_NotWritable (0x803B0000) “The access level does not allow writing to the Node.”

And how can I map that WriteMask to particular attribute so as to write on it.

February 7, 2020
14:22, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Well, technically yes, however in practice almost no server support this and/or have that feature turned on. That is to say, you can only write to WriteMask, if the WriteMask itself allows you to write to WriteMask. If a server were to support that, it would usually require logging in with “Administrator” or equivalent and requires some internal user-system to control the writes etc. otherwise a client could mess up the server nodes for other clients.

The WriteMask value is UInt32, and the specification tells what bits map to what Attributes. In OPC UA 1.04 it was subtyped to AttributeWriteMask, and SDK has equivalent class. See e.g. ComplianceNodeManager in the sampleconsoleserver example how that could be set in the server side. In the client side you can pass that AttributeWriteMask object to DataValue/Variant/Object in place for write methods of UaClient.

And to reiterate, the samples are samples. I guess in theory it should work, I doubt anyone has ever tried to write to WriteMask with it, but assuming you enter the raw unsignedinteger as number, it should work. Though not very useful. In a real application would need to build some controls for setting the individual bits etc. and in the case of our SDK that would be the equivalent of having control to manipulate AttributeWriteMask.Fields enum, that does list all the bits.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 75

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 707

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1