Modifying UA-Nodes at runtime

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
User avatar
h2k_toy
Sr. Member
Sr. Member
Posts: 14
Joined: 24 Sep 2020, 09:13

Modifying UA-Nodes at runtime

Post by h2k_toy »

Hello again,

i have a use case where i wanna connect to an uaserver, show several nodes and later, while the client is connected, remove that node and add other nodes to the ua tree.

Is it possible to remove/add nodes during a client is connected/and after a server instance is configured in the overriden startup method ?

Does the client need to be seperatedly informed by the server app or is the structural change of nodes implemented completely by the ua api on server side?

I think the server should need no extra treatment except removing/adding nodes. But the client would need some handling. Is this handling supported by the api or do i need to make an own "StructuralChangeEvent" or something?

If existing it would be great you could lead me to an example for this use case.

Background:
When the UaSErver is started it connects through an underlying system to our device components. If the the data model of the underlying system is not buffered in the actual version of the components it will download the underlying model from the components. Since this is done through a very slow bus,this will take some time. During this time i would like to expose a "ModelDownload" Folder with a double value "Progress" so our client app could display. After the Model is downloaded the node shall disappear and instead it shall display the model of the device's components.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Modifying UA-Nodes at runtime

Post by Support Team »

Hello,

A server can add and remove nodes when it is running. The client can be informed about the change of the address space by so called ModelChangeEvents. There is an example in the DemoServer. Please see http://documentation.unified-automation.com/uasdkdotnet/3.0.6/html/L2ServerTutDemoServer.html#DemoServerExampleModelChangeEvents.
Best regards
Unified Automation Support Team

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Modifying UA-Nodes at runtime

Post by Support Team »

Hello,

yes it is forseen by the OPC UA standard that a server can (during runtime) change, modify, update it's own address space (including add/remove individual nodes). The server must fire the so-called "ModelChangeEvent" to inform the connected clients that they better rebrowse a certain sub tree of the information model to check out what exactly was changed. BTW the UaExpert is subscribing for the model change event just right after connecting to a server to get informed whenever the server decides to change the information model.

If the client is subscribed to a node that the server suddenly decides to remove, this would be (of course) expressed through the StatusCode (e.g. truning into BadOutOfService or BadUnknownNodeID), which should be checked constantly when monitoring tags.

That said: the "hack" that you propose by writing code yourself is not required, you should use the feature set that the UA standard has forseen for such scenario.
Best regards
Unified Automation Support Team

Post Reply