Professional OPC
Development Tools


Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

[opcua] Browsing nodes

21 Feb 2022 13:48 #10643 by support
Replied by support on topic [opcua] Browsing nodes

please see the code below. I hope it helps.

// This example shows how to obtain "data nodes" under the "Objects" node, recursively.
using System;
using System.Diagnostics;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.AddressSpace.Standard;
using OpcLabs.EasyOpc.UA.OperationModel;
namespace UADocExamples._EasyUAClient
    partial class BrowseDataNodes
        public static void Recursive()
            UAEndpointDescriptor endpointDescriptor =
            // or "" (not in .NET Standard)
            // or ""
            // Instantiate the client object
            var client = new EasyUAClient();
                BrowseFromNode(client, endpointDescriptor, UAObjectIds.ObjectsFolder, level:0);
            catch (UAException uaException)
                Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}");
        private static void BrowseFromNode(
            EasyUAClient client,
            UAEndpointDescriptor endpointDescriptor,
            UANodeDescriptor parentNodeDescriptor,
            int level)
            Debug.Assert(!(client is null));
            Debug.Assert(!(endpointDescriptor is null));
            Debug.Assert(!(parentNodeDescriptor is null));
            // Obtain all node elements under parentNodeDescriptor
            UANodeElementCollection nodeElementCollection = 
                client.BrowseDataNodes(endpointDescriptor, parentNodeDescriptor);
            // Remark: BrowseDataNodes(...) may throw UAException; we handle it in the calling method.
            foreach (UANodeElement nodeElement in nodeElementCollection)
                Debug.Assert(!(nodeElement is null));
                Console.Write(new string(' ', level*2));    // indent
                // Browse recursively into the node.
                // The UANodeElement has an implicit conversion to UANodeDescriptor.
                BrowseFromNode(client, endpointDescriptor, nodeElement, level + 1);
                // Note that the number of nodes you obtain through recursive browsing may be very large, or even infinite.
                // Production code should contain appropriate safeguards for these cases.
        // Example output:
        //ServerStatus -> nsu= ;i=2256 (Variable) 
        //  StartTime -> nsu= ;i=2257 (Variable) 
        //  CurrentTime -> nsu= ;i=2258 (Variable) 
        //  State -> nsu= ;i=2259 (Variable) 
        //  BuildInfo -> nsu= ;i=2260 (Variable) 
        //    ProductUri -> nsu= ;i=2262 (Variable) 
        //    ManufacturerName -> nsu= ;i=2263 (Variable) 
        //    ProductName -> nsu= ;i=2261 (Variable) 
        //    SoftwareVersion -> nsu= ;i=2264 (Variable) 
        //    BuildNumber -> nsu= ;i=2265 (Variable) 
        //    BuildDate -> nsu= ;i=2266 (Variable) 
        //  SecondsTillShutdown -> nsu= ;i=2992 (Variable) 
        //  ShutdownReason -> nsu= ;i=2993 (Variable) 
        //ServerCapabilities -> nsu= ;i=2268 (Object) 
        //  OperationLimits -> nsu= ;i=11704 (Object) 
        //    MaxNodesPerRead -> nsu= ;i=11705 (Variable) 
        //    MaxNodesPerHistoryReadData -> nsu= ;i=12165 (Variable) 
        //    MaxNodesPerHistoryReadEvents -> nsu= ;i=12166 (Variable) 
        //    MaxNodesPerWrite -> nsu= ;i=11707 (Variable) 
        //    MaxNodesPerHistoryUpdateData -> nsu= ;i=12167 (Variable) 

Best regards
The following user(s) said Thank You: yong

Please Log in or Create an account to join the conversation.

21 Feb 2022 07:30 #10641 by yong
Replied by yong on topic [opcua] Browsing nodes
Yes, I would appreciate it if you could provide actual example code.

Best regards

Please Log in or Create an account to join the conversation.

21 Feb 2022 06:39 #10640 by support
Replied by support on topic [opcua] Browsing nodes

It is not clear what you are asking for. Do you want tor recursively browse into the nodes, and basically obtain the whole tree?

If so, it looks like that you already have an example code that gets you the first level. Each of the result "elements" contains a node Id of the node you obtained. You can use that to browse further from that node, passing it as starting element (an additional argument) to one of the BrowseXXXX methods (possible the BrowseDataNodes again).

With this, do you need an actual example code for that ?

Best regards

Please Log in or Create an account to join the conversation.

21 Feb 2022 06:26 #10639 by yong
[opcua] Browsing nodes was created by yong

I am using opclabs quick opcua version 5.23 for C# .NET core.
I need to find a way to programmatically browse like a program uaexpert node.

I couldn’t find any documentation for that, do you have any example code for that?
How do you browse beneath (forward) one of the nodes? For instance the node with display name “Data”?

Best regards,

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.058 seconds