Aggregating server: how to clone source nodes

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

Moderator: uasdkcpp

Post Reply
apetrashyk
Full Member
Full Member
Posts: 5
Joined: 23 Apr 2015, 22:37

Aggregating server: how to clone source nodes

Post by apetrashyk »

I'm working on an aggregating client/server that connects to multiple servers, aggregates and duplicates their address spaces, and then makes that new big aggregate address space available to clients that connect to it.

The big problem here is to duplicate the address space of the source server. I might be missing something, and was wondering if you could point me to an existing solution, because I'm not sure how such duplication of source server nodes should be implemented. The browse() method only returns reference descriptions that say very little about the source nodes. Am I supposed to be using it and then create new nodes based on the very few attributes I can extract from it? Is there a more full fledged service that can help me clone the node structure of the server?

Clearly, it's a known problem as the UA expert client already does something like that, considering how it makes the address space easily browseable in a GUI. Any advice will be much appreciated!

Thanks!

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

Re: Aggregating server: how to clone source nodes

Post by Support Team »

Hi,

There are two ways to implement aggregation, transparent and non transparent.

For transparent the aggregating server typically does not keep much knowledge about the aggregated server. It is mainly passing on requests from a client to the underlying server. You should start from the SDK level examples to implement such an aggregator.
http://documentation.unified-automation ... alSdk.html

For non transparent aggregation the parts of the relevant parts of address space of the underlying server is imported e.g. by recursive browsing of a sub tree. But you must be careful since OPC UA servers can have looping references and a recursive browser must make sure that every node is only browsed once.

Best Regards,
Unified Automation Support Team

RafaelCrespi
Hero Member
Hero Member
Posts: 26
Joined: 22 Jun 2017, 09:41

Re: Aggregating server: how to clone source nodes

Post by RafaelCrespi »

Hi,

I am trying too to developing an Aggregating Server.

I've been taking a look on the Server_SDK_Tutorial and I don't understand how the node addition to Address Space is implemented. There is no use of addNodeAndReference/AddNode methods and on MyTree::addTreeNode() is using:

// Add to map
m_mapTreeNodes[pNewNode->getNodeIdentifier()] = pNewNode;

1. Is this the way of add the nodes to the Address Space? Why is not using addNodeAndReference/AddNode?

I am trying to add the nodes dynamically, it means: The Aggregating Server browses the AS of a Server and every time it finds a Node, it adds to his A.S.
For that reason, I have implemented myNodeManager that inherits from nodemanager.h and he is doing the add action by AddNode.

2. It's a correct way to do this? I need to implement the TreeNodeInterface,TreeInterface,MyTree,... classes?

Thanks a lot,

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

Re: Aggregating server: how to clone source nodes

Post by Support Team »

Hello RafaelCrespi,

NodeManagerTree and IOManagerTree is just some sample code to show how to implement the NodeManager and IOManager interface directly. That is not part of the SDK.
You need to understand the difference between Toolkit Layer and SDK layer.

Toolkit Layer (DemoServer example):
- you use a NodeManager derived from NodeManagerBase
- NodeManagerBase provides a complete implementation of NodeManager and IOManager interface ( inherits from NodeManagerUaNode and IOManagerUaNode)
- All Node and Attributes exist in Memory.
- Create Nodes using toolkit classes e.g. OpcUa::BaseDataVariableType.
- those Nodes are added to the NodeManager with addNodeAndReference()

SDK Layer (Tree example):
- you implement your NodeManager derived from NodeManager
- you take care of organizing the Nodes, browse references etc...
- you don't use any toolkit class like OpcUa::BaseDataVariableType
Best regards
Unified Automation Support Team

RafaelCrespi
Hero Member
Hero Member
Posts: 26
Joined: 22 Jun 2017, 09:41

Re: Aggregating server: how to clone source nodes

Post by RafaelCrespi »

Hi,

So, regarding to your answer on this topic on 19 March 2016,

"For non transparent aggregation the parts of the relevant parts of address space of the underlying server is imported e.g. by recursive browsing of a sub tree. But you must be careful since OPC UA servers can have looping references and a recursive browser must make sure that every node is only browsed once"

Could I implement the Aggregating server by using the Toolkit Layer? (NodeManager derived from NodeManagerBase,
addNodeAndReference(),...)

Thank you very much,

Rafa

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

Re: Aggregating server: how to clone source nodes

Post by Support Team »

Hello RafaelCrespi,

of course you can. You just need to be aware that you copy the address space of underlying servers. This has several effects:
- the number of Nodes in your server can get very big
- you need to take care of keeping your address space in sync with the underlying servers.
Best regards
Unified Automation Support Team

thomas.steiner
Jr. Member
Jr. Member
Posts: 3
Joined: 04 Jul 2018, 15:23

Re: Aggregating server: how to clone source nodes

Post by thomas.steiner »

Hi,

I've an additional question about "transparent aggregating":
Support Team wrote:
19 Mar 2016, 20:20
For transparent the aggregating server typically does not keep much knowledge about the aggregated server. It is mainly passing on requests from a client to the underlying server. You should start from the SDK level examples to implement such an aggregator.
http://documentation.unified-automation.com/uasdkcpp/1.5.1/html/L2TutorialSdk.html
How would you implement "passing on requests from a client to the underlying server" (the aggregator)?
Would you instanciate a new UAClient inside your aggregating server and forward all requests (call, read, write, browse, ...) with this client instance to the aggregated server? Or is there a better way to do that?

Best Regards,
Thomas

Post Reply