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: 469
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: 267

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 93

pramanj: 86

ibrahim: 69

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 957

Moderators: 13

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 935

Posts: 3932

Newest Members:

mattiee679022481, osvaldolennox12, brandenmallette, mellisafcm, P0001, launastanfill, Oleksandr, Matti Siponen, gselvas92, ashleighfinlay

Moderators: Jouni Aro: 834, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 469, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 18, Markus Johansson: 11, Matti Siponen: 6

Administrators: admin: 0