19:43, EEST
May 19, 2023
7:52, EEST
April 3, 2012
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).
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, edgardo3518Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1