OPC Studio User's Guide and Reference
UABrowsePathElement Class
Members  Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.Navigation Namespace : UABrowsePathElement Class
Represents an element in the OPC-UA browse path.
Object Model
UABrowsePathElement ClassUANodeId ClassUANodeId ClassUAQualifiedName Class
Syntax
'Declaration
 
<CLSCompliantAttribute(True)>
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement)>
<ComVisibleAttribute(True)>
<GuidAttribute("3CE3E988-805D-42AF-AC15-974D93E91240")>
<TypeConverterAttribute(OpcLabs.EasyOpc.UA.Navigation.Implementation.UABrowsePathElementConverter)>
<ValueControlAttribute("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.80.82.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=False, 
   Export=True, 
   PageId=10001)>
<SerializableAttribute()>
Public NotInheritable Class UABrowsePathElement 
   Inherits OpcLabs.BaseLib.Info
   Implements LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement, IUABrowsePathElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable 
'Usage
 
Dim instance As UABrowsePathElement
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement)]
[ComVisible(true)]
[Guid("3CE3E988-805D-42AF-AC15-974D93E91240")]
[TypeConverter(OpcLabs.EasyOpc.UA.Navigation.Implementation.UABrowsePathElementConverter)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.80.82.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public sealed class UABrowsePathElement : OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement, IUABrowsePathElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement)]
[ComVisible(true)]
[Guid("3CE3E988-805D-42AF-AC15-974D93E91240")]
[TypeConverter(OpcLabs.EasyOpc.UA.Navigation.Implementation.UABrowsePathElementConverter)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.80.82.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public ref class UABrowsePathElement sealed : public OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.Navigation.ComTypes._UABrowsePathElement, IUABrowsePathElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
Remarks

 

OPC UA browse path elements are represented by UABrowsePathElement objects. Each browse path element has following data members:

The UABrowsePathElement has various constructor overloads with different combinations of these parameters. In addition, there are static methods on the UABrowsePathElement Class that allow you to easily create commonly used browse path elements:

The created browse path elements can then be added to a UABrowsePathElementCollection Class, forming a relative path.

 

Example

.NET

// This example shows how to read a Low state of a limit alarm. Note that you should not normally read a state of an alarm
// from inside its event notification, because the state might have already changed. Instead, include the information you
// need in the Select clauses when subscribing for the event.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

using System;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.Navigation;

namespace UADocExamples.AlarmsAndConditions
{
    class ReadAlarmState
    {
        public static void Main1()
        {
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://opcua.demo-this.com:62544/Quickstarts/AlarmConditionServer";

            UANodeDescriptor alarmNodeDescriptor = new UANodeId(
                namespaceUriString:"http://opcfoundation.org/Quickstarts/AlarmCondition", 
                identifier:"1:Colours/EastTank?Yellow");

            // Knowing the alarm node, and the fact that is an instance of NonExclusiveLevelAlarmType (or its subtype),
            // determine what is its LowState/Id node.
            UANodeDescriptor lowStateIdNodeDescriptor = new UABrowsePath(alarmNodeDescriptor,
                new []
                {
                    UABrowsePathElement.CreateSimple("ns=0;s=LowState"),
                    UABrowsePathElement.CreateSimple("ns=0;s=Id")
                });

            // Instantiate the client object.
            var client = new EasyUAClient();

            Console.WriteLine("Reading alarm state...");
            var lowStateId = (bool)client.ReadValue(endpointDescriptor, lowStateIdNodeDescriptor);

            Console.WriteLine($"Id of LowState: {lowStateId}");
        }
    }
}
# This example shows how to read a Low state of a limit alarm. Note that you should not normally read a state of an alarm
# from inside its event notification, because the state might have already changed. Instead, include the information you
# need in the Select clauses when subscribing for the event.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc
import time

# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *
from OpcLabs.EasyOpc.UA.AddressSpace.Standard import *
from OpcLabs.EasyOpc.UA.AlarmsAndConditions import *
from OpcLabs.EasyOpc.UA.OperationModel import *


def eventNotification(sender, eventArgs):
    print()
    # Display the event.
    if eventArgs.EventData is None:
        print(eventArgs)
        return
    baseEventObject = eventArgs.EventData.BaseEvent
    print('Source name: ', baseEventObject.SourceName, sep='')
    print('Message: ', baseEventObject.Message, sep='')
    print('Severity: ', baseEventObject.Severity, sep='')


# Define which server we will work with.
endpointDescriptor = UAEndpointDescriptor('opc.tcp://opcua.demo-this.com:62544/Quickstarts/AlarmConditionServer')

# Instantiate the client object and hook events.
client = EasyUAClient()
client.EventNotification += eventNotification

print('Subscribing...')
IEasyUAClientExtension.SubscribeEvent(
    client,
    endpointDescriptor,
    UANodeDescriptor(UAObjectIds.Server),
    1000)

print('Processing event notifications for 30 seconds...')
time.sleep(30)

print('Unsubscribing...')
client.UnsubscribeAllMonitoredItems()

print('Waiting for 5 seconds...')
time.sleep(5)

print('Finished.')
' This example shows how to read a Low state of a limit alarm. Note that you should not normally read a state of an alarm
' from inside its event notification, because the state might have already changed. Instead, include the information you
' need in the Select clauses when subscribing for the event.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.AddressSpace
Imports OpcLabs.EasyOpc.UA.Navigation

Namespace AlarmsAndConditions
    Friend Class ReadAlarmState
        Public Shared Sub Main1()
            Dim endpointDescriptor As UAEndpointDescriptor =
                "opc.tcp://opcua.demo-this.com:62544/Quickstarts/AlarmConditionServer"

            Dim alarmNodeDescriptor As UANodeDescriptor = New UANodeId(
                namespaceUriString:="http://opcfoundation.org/Quickstarts/AlarmCondition",
                identifier:="1:Colours/EastTank?Yellow")

            ' Knowing the alarm node, and the fact that is an instance of NonExclusiveLevelAlarmType (or its subtype),
            ' determine what is its LowState/Id node.
            Dim lowStateIdNodeDescriptor As UANodeDescriptor = New UABrowsePath(alarmNodeDescriptor,
                New UABrowsePathElement() {
                    UABrowsePathElement.CreateSimple("ns=0;s=LowState"),
                    UABrowsePathElement.CreateSimple("ns=0;s=Id")
                })

            ' Instantiate the client object.
            Dim client = New EasyUAClient()

            Console.WriteLine("Reading alarm state...")
            Dim lowStateId = CBool(client.ReadValue(endpointDescriptor, lowStateIdNodeDescriptor))

            Console.WriteLine($"Id of LowState: {lowStateId}")
        End Sub
    End Class
End Namespace
Inheritance Hierarchy

System.Object
   OpcLabs.BaseLib.Object2
      OpcLabs.BaseLib.Info
         OpcLabs.EasyOpc.UA.Navigation.UABrowsePathElement

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also