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
can I ad new node dynamically using UaClient?
May 19, 2023
19:43, EEST
Avatar
uzair4991
New Member
Members
Forum Posts: 2
Member Since:
May 19, 2023
sp_UserOfflineSmall Offline

I want to add new node using client. I have simulator which I got from internet . UaClient successfully connects from my simulator, but now i want to add new node using UaClient. Is it possible to Add Node dynamically?

May 22, 2023
7:52, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The SDK API to do this would be (UaClient) client.getAddressSpace().addNodes or addNode which do take in the AddNodesItem paramater. Or exactly addNode(NodeId parentNodeId, NodeId referenceTypeId, NodeId newNodeId, QualifiedName browseName, NodeClass nodeClass, NodeAttributes nodeAttributes, NodeId typeDefinition), which is just the AddNodesItem structure fields.
The methods taking in an ‘UaNode’ are separate and do not make the ‘AddNodes’ call, SDK uses that internally (and is basically a side-effect of shared UaAddressSpace interface).

However, note that this only works if the server side specifically supports it (https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.2). And just as a guess, I do assume this simulator doesn’t support it, as it would be extremely rare.

P.S.
If you would do a server with our SDK, the feature would be by default off for security reasons (as you could also delete nodes with this, https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.4). None of our Applications support it at the moment, but the SampleConsoleServer has an option to turn it on (see SampleConsoleServer.Action.ENABLE_NODE_MANAGEMENT).

Note that if you do this in a server application, you should most likely also do user authorization to limit this feature to only e.g. ‘admin users’. Also you will need to implement things (skipped here) if you wish to detect this in the server to e.g. persist the addition or actually make the node to do anything (otherwise it is just a temporary data-holder basically).

May 22, 2023
14:28, EEST
Avatar
uzair4991
New Member
Members
Forum Posts: 2
Member Since:
May 19, 2023
sp_UserOfflineSmall Offline

If I am getting you correct. What you mean is while server is running node can be created dynamically with out server to restart? correct me if I am wrong and secondly I am really thankful for your answer

May 22, 2023
16:01, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Basically meaning that the server must have been built to support this feature, which is not common. Generally speaking, do not expect a server to support this feature.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
43 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 734

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1