Changing Address Space at runtime

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

Moderator: uasdkc

Post Reply
Full Member
Full Member
Posts: 5
Joined: 27 Feb 2013, 22:23

Changing Address Space at runtime

Post by harlix »


I'd like to add / remove Nodes during runtime when my physical device infrastructure changes (e. g. when a subdevice is connected or disconnected). Is it possible to change the address space structure without re-establishing the whole server-client connection? Actually, I'm managing an internal linked list with refernces to all my nodes (as OpcUa_BaseNode* ). For testing purposes, I've tried to iterate over the list and call UaServer_RemoveNode() on every node, then rebuilding the whole address space (like CustomProvider_CreateAddressSpace() in the examples), but I sometimes get segfaults then.

Is there any cleanup method I'm missing to call or any pointers I've to zeroize before I can rebuild the address space or single nodes? Which are the necessary steps to remove a single node from the address space and clear it properly, and to add a new node and append it to the address space? Or is it necessary to close all connections and re-initialize the whole stack when the infrastructure changes?

Furthermore, if it's possible to change the address space dynamically, is there any possibility to notify the changes to connected clients?

Edit: I'm using the Linux Ansi C SDK.

Thanks a lot in advance for your help.

best regards,


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

Re: Changing Address Space at runtime

Post by Support Team »


the SDK supports adding and removing nodes at runtime. There is no need to recreate the whole address space.
The demo server contains an example for that.

In the folder Demo/0008_DynamicNodes there is a DynamicNode that can be added and removed to demonstrate this feature.
We created two methods CreateDynamicNode and DeleteDynamicNode so that you can trigger this using a client like UaExpert.

This example also send a ModelChangeEvent when the address space is changed.

http://documentation.unified-automation ... s_1_c.html


Unified Automation Support Team

Post Reply