OPC-UA Browse Service
Browse node paths
The Browse Service functionality of the Edge Xpert device service searches for OPC-UA nodes along a specified path.
An example of a node path could be:
Objects/Device/Node
Objects
has a browse depth of 1, Device
has a browse depth of 2, and Node
has a browse depth of 3.
Browsing nodes to add subscriptions
To enable the Browse service, you must specify the following protocol properties when provisioning a device:
Property | Description | Example Value |
---|---|---|
BrowseDepth |
The BrowseDepth must be greater than zero (0). This protocol property limits the depth to which the node tree is browsed. If set to 1 , browsing stops after the initial browse. If set to a value greater than 1, the children of RootNode are also browsed, and this continues until the namespace has been browsed to the maximum BrowseDepth level. |
2 |
RootNode |
When initiated, the browse starts from the RootNode . The format for this value must be < nsIndex>,< IDType>=< nodeID> |
3,i=1001 This would indicate a node with a Namespace Index (or nsIndex) of 3, a numeric ID type (indicated by the "i") and a node ID of 1001 |
Optionally, the BrowseSubFilter
protocol property can be used to automatically subscribe to nodes of interest. This can take the following values:
All
Variable
Event
Note
If automatically subscribing to browsed nodes, the performance of the OPC-UA Device Service can be impacted when there are a lot of subscription events (e.g., if automatically subscribing to nodes on servers with large namespaces). If the OPC-UA Device Service has multiple connections to the same OPC-UA server, IOTech recommends that the Browse service is enabled on only one connection to prevent duplication and unnecessary overhead.
Adding a node without knowing the nodeID
Browse can be used to declare objects in a device profile without specifying the nodeID for a node. This can be implemented when using multiple devices and allows device profiles to be more general. It is not necessary to know the nodeID of individual nodes, so long as the starting node is known.
By specifying the browse path and starting node, the device service knows where to look for nodes and will add all nodes on the path that are defined in the device profile.
To use this feature, two new attributes must be added to the device resource.
Attribute | Description | Example |
---|---|---|
browsePath |
Path from the root node to the node | browsePath: "Simulation/Counter" |
startNode |
Information on the root node. Must contain the namespace index (nsIndex), ID type, and node ID The format for this must be < nsIndex>,< IDType>=< nodeID> |
startNode: "0,i=85" This indicates a nsIndex of 0, numeric ID type ("i"), and node ID of 85 |
An example device profile for using the browse path to find nodes in the Prosys OPC-UA Simulation Server can be seen below:
deviceResources:
- description: A Simulated Counter
name: Counter1
isHidden: false
properties:
valueType: Uint32
readWrite: R
units: String
defaultValue: "0"
attributes:
browsePath: "Simulation/Counter"
monitored: "True"
nsIndex: "3"
publishInterval: "500"
startNode: "0,i=85"
- description: A static UInt32 variable
name: StaticUInt32
isHidden: false
properties:
valueType: Uint32
readWrite: RW
units: String
defaultValue: "0"
attributes:
browsePath: "StaticData/StaticVariables/UInt32"
nsIndex: "5"
startNode: "0,i=85"
deviceCommands:
- name: Counter1
isHidden: false
readWrite: R
resourceOperations:
- deviceResource: Counter1
- name: StaticUInt32
isHidden: false
readWrite: RW
resourceOperations:
- deviceResource: StaticUInt32