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
Adding a node permanently
June 14, 2020
16:45, EEST
Avatar
Tobs
Member
Members
Forum Posts: 4
Member Since:
December 1, 2019
sp_UserOfflineSmall Offline

Hello ProSys-Team,

is it possible to add a node permanently during runtime?
So they are still there when the server restarts and loads the information model.

Best regards

June 16, 2020
9:54, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 349
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

At the moment, the Prosys OPC UA SDK for Java doesn’t provide built-in support for persisting the AddressSpace. If you wish to add Nodes to a Server during runtime and have them stored to memory so that they can be loaded to the AddressSpace when you restart the Server, you will need to implement your own NodeManager that handles storing them to disk. You can use NodeManagerUaNode as a starting point and override methods related to adding Nodes with versions that store the added Node to disk. You can handle loading Nodes from disk in the constructor of your NodeManager.

However, saving Nodes to disk won’t be easy as you would have to solve how to serialize UaNode interface in a way that preserves all the information contained by it and interfaces that extend it. You could use NodeSet2 XML files at OPC Foundation github (https://github.com/OPCFoundation/UA-Nodeset/tree/v1.04) as an example. They are used to model OPC UA information models in XML form and the Prosys OPC UA SDK for Java can use them to generate AddressSpaces when a Server is started. If you serialized your Nodes in a similar form, you should be able to load your stored Nodes when the Server is restarted.

BR,

Matti

August 30, 2022
13:03, EEST
Avatar
mgrenier
Member
Members
Forum Posts: 13
Member Since:
February 4, 2021
sp_UserOfflineSmall Offline

Hello,

Is this functionnality exists now ?
If not, is this functionnality is in the roadmap ?

Thank you

August 30, 2022
14:25, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 349
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

The functionality for adding Nodes permanently to the AddressSpace by persisting the AddressSpace to disk in NodeSet2 XML format has not been added to the Prosys OPC UA SDK for Java.

But as a clarification, is the use of information models required? If the full capabilities of OPC UA information modelling are not required, then sufficient information on the Nodes could probably be persisted by using some custom XML or JSON format used by the Server application. Though, such format is not provided by the SDK either and would need to be designed by the developer of the Server application.

Do you have a specific use case where persisting Nodes would be required?

August 30, 2022
14:49, EEST
Avatar
mgrenier
Member
Members
Forum Posts: 13
Member Since:
February 4, 2021
sp_UserOfflineSmall Offline

Hello,

Thank you. Yes, in our specific case, OPC-UA client create object dynamically in a folder (add node to the address space of OPC-UA server).
In case of a crash or a shutdown of the OPC-UA server, we need to load theses objects at startup time.

Thank you,

PS: I’m agree with your proposal but I hope such a functionnality “sufficient information on the Nodes could probably be persisted by using some custom XML or JSON format used by the Server application” will exist in the sdk.

August 30, 2022
15:33, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 349
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

The definition of “sufficient information” depends on your application, which makes defining that outside the scope of the SDK. At SDK level, it would only make sense to persist all information, but at the moment such feature is not planned. Therefore, you will need to define what information you need to persist and how to persist it by yourself.

Can you be on more specific on what types of Nodes Clients are adding and what those Nodes are used for by the Server and possibly other Client applications?

August 30, 2022
15:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1032
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

I’ll note this, it might not be enough, but might be of help. IF you subtype NodeManagerUaNode and have that as the manager of the namespace, you can override

protected UaNode createNodeForAddNodesRequest(NodeId nodeId, QualifiedName browseName, NodeClass nodeClass, ExpandedNodeId typeDefinitionId, LocalizedText displayName)

By default that delegates to the NodeBuilder of the manager. This implementation should be kept (i.e. delegate to super; as the current AddNodes defines full instances shall be created by the server), but you can use the override to record that the node was added, then upon a restart you could re-create it.

August 30, 2022
16:59, EEST
Avatar
mgrenier
Member
Members
Forum Posts: 13
Member Since:
February 4, 2021
sp_UserOfflineSmall Offline

@Bjarne Boström : Tanks for the help.

@Matti Siponen : it is a specific object type to register functional properties (hasProperty/Variable/PropertyType with “simple” scalar data type) and one hasComponent relation on “simple” custom Object DataType. This object represents an operation with a simple lifecycle (the lifecycle is not managed by the OPC-UA server).
The created object is updated by other OPC-UA client (change “simple” properties).
As you said, I need to contact my client to understand what is important to restore in case of reboot.
Thank you

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
18 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: 728

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7

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

Administrators: admin: 1