Subscribing to a hierarchy of nodes

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

Moderator: uasdknet

Post Reply
floriansegginger
Jr. Member
Jr. Member
Posts: 1
Joined: 10 Jun 2014, 15:22

Subscribing to a hierarchy of nodes

Post by floriansegginger »

We are trying to evaluate the possibilities of subscribing to a very large amount of data points, about 1 million in total.

These points are all inside a hierarchy, like so

Code: Select all

RootNode
  |
  |__ NodeA
  |       |
  |       |__ NodeAA
  |       |       |
  |       |       |__ NodeAAA
  |       |       |        |
  |       |       |        |_ NodeAAATheValue
  |       |       |
  |       |       |__ NodeAAB
  |       |                 |
  |       |                 |_ NodeAABTheValue     
  |       |
  |       |__ NodeAB
  |                |
...          
  |__ NodeB
What we wish to do, is to monitor all the "NodeXXXTheValue" for all nodes in NodeA, for example.

We've tried something like this:

Code: Select all

            Subscription subscription = new Subscription(_session);
            subscription.PublishingEnabled = true;
            subscription.PublishingInterval = 100; //Intervalle à laquelle on veut avoir des valeurs qui remontent
            subscription.DataChanged += subscription_DataChanged;

            subscription.Create();

            // Step 2 --------------------------------------------------
            // Prepare variables to monitor as data monitored item
            List<MonitoredItem> monitoredItems = new List<MonitoredItem>();
            // Default is monitoring Value attributes
            foreach (String variable in variables)
            {
                monitoredItems.Add(new DataMonitoredItem(new NodeId(variable, SelectedNamespace.Index))});
            }

            List<StatusCode> results = subscription.CreateMonitoredItems(monitoredItems);


            // Step 4 --------------------------------------------------
            // Display any errors.
            for (int i = 0; i < results.Count; i++)
            {
                Debug += results[i].ToString() + "\n";
            }
However, performance is really poor when subscribing to more than 15k variables (takes almost 50 seconds, and just keeps getting worse exponentially)

Is there some way to create a subscription to the root node? That way, we would be notified of all changes of all child nodes of all child values.

Thank you for your time!

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

Re: Subscribing to a hierarchy of nodes

Post by Support Team »

Hello,

OPC UA does not define specify a way to subscribe for a "root node". If a client wants to do this, the client has to browse recurively and collect the NodeIds of the Variables in the hierarchy. Since loops are allowed in OPC UA addresssapce, you have to be careful when writing your recursive browse method.

Second approach is to browse the nodes of interest once and persist for re-using them. This way typically HMI/SCADA systems work, where you browse once during "configuration" of the system and when being switched into "runtime" operation the client just uses all the NodeIDs from his persisted list.

Regarding your speed measurements:
However, performance is really poor when subscribing to more than 15k variables (takes almost 50 seconds, and just keeps getting worse exponentially)
Not sure which Server or Client you have measured, definately not one of ours. When using our latest .NET Server as shipped with the SDK, I can create 50k monitored items within 1sec. The 15k variables can be created within approx 0.3 seconds.


Best regards
Support Team

Post Reply