Browse Paths
A browse path is a string that represents a path to navigate from one node to another in the OPC UA address space. Browse paths provide a human-readable way to identify nodes using hierarchical names instead of NodeIds, making them essential for dynamic navigation and configuration.
Browse Paths are good alternative to NodeIds when you want to work with node names and their relationships in a more intuitive way.
They allow you to traverse the OPC UA address space without needing to know the exact NodeId of each node, which can be particularly useful in dynamic environments where nodes id may change frequently.
Based on the OPC Foundation Part 4 specification, browse paths follow a specific syntax that supports various reference types, namespace handling, and special characters.
Overview
Browse paths consist of:
- Reference types that define how to navigate between nodes
- Browse names that identify target nodes
- Namespace qualifiers that specify which namespace to use
- Special characters for advanced navigation patterns
Basic Syntax
Simple Hierarchical Navigation
The most common browse path uses forward slashes (/
) to follow hierarchical references:
/Objects/DeviceSet/MyDevice/Temperature
This path:
- Starts at the root
/Objects
node - Follows hierarchical references to
DeviceSet
- Continues to
MyDevice
- Finally reaches
Temperature
Namespace Qualification
Namespace index is always required except for the standard namespace (0). When nodes belong to namespaces other than 0, you must prefix the browse name with the namespace index:
/Objects/2:DeviceSet/3:MyDevice/3:Temperature
Objects
has no prefix because it's in the standard namespace 0DeviceSet
is in namespace 2 and must include the2:
prefixMyDevice
andTemperature
are in namespace 3 and must include the3:
prefix
Important: Only nodes in namespace 0 (the standard OPC UA namespace) can omit the namespace prefix. All other namespaces require explicit qualification.
Reference Types
Browse paths support different reference types to control navigation behavior:
1. Hierarchical References (/
)
The forward slash follows any subtype of HierarchicalReferences
:
/Objects/Server/ServerStatus/CurrentTime
2. Aggregates References (.
)
The period follows any subtype of Aggregates
references:
/Objects/Server.NamespaceArray
3. Specific Reference Types (<ReferenceType>
)
Use angle brackets to specify exact reference types:
<HasComponent>ServerStatus
<1:ConnectedTo>1:Boiler/1:HeatSensor
Reference Type Modifiers
- Exclude subtypes (
#
):<#HasComponent>
follows onlyHasComponent
, not its subtypes - Inverse direction (
!
):<!HasChild>Truck
follows inverseHasChild
references - Namespace qualified:
<0:HasProperty>
specifies the reference type's namespace (required for non-standard namespaces)
Advanced Path Construction
1. Wildcards
Omit the final browse name to match all targets:
/Objects/Server/ # Matches all children of Server
<HasComponent> # Matches all HasComponent targets
2. Escaping Special Characters
Use &
to escape reserved characters in browse names:
Reserved Character | Escaped Form | Example | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
/ | &/ | Component&/Name → Component/Name | |||||||||
. | &. | Property&.Value → Property.Value | |||||||||
: | &: | Node&:ID → Node:ID | |||||||||
& | && | Data&&More → Data&More | |||||||||
< | &< | Value& |
3. Complex Navigation Examples
Following Multiple Reference Types
<HasComponent>Boiler/<HasProperty>Temperature
- Follow
HasComponent
to findBoiler
- From
Boiler
, followHasProperty
to findTemperature
Cross-Namespace Navigation
/Objects/2:DeviceSet/<3:ConnectedTo>3:Sensor/3:Value
- Navigate to
DeviceSet
in namespace 2 - Follow
ConnectedTo
reference (namespace 3) toSensor
- Continue to
Value
property
Inverse Reference Navigation
<!HasChild>2:ParentDevice/2:Configuration
- Follow inverse
HasChild
reference to find parent - Navigate to
Configuration
from the parent
Practical Examples
Industrial Automation Scenarios
1. Reading Device Temperature
# Simple hierarchical path
/Objects/DeviceSet/TemperatureSensor01/Temperature
# With namespaces
/Objects/2:DeviceSet/3:TemperatureSensor01/3:Temperature
2. Accessing Method Parameters
# Navigate to method input arguments
/Objects/2:ProductionLine/2:Reactor/2:StartProcess/<HasProperty>InputArguments
3. Finding Connected Equipment
# Follow connection references
/Objects/2:Plant/<2:ConnectedTo>2:Boiler/<HasComponent>HeatingElement
4. Browsing All Alarms
# Wildcard to find all alarm conditions
/Objects/Server/ServerStatus/<HasComponent>
Configuration and Setup
1. Server Information
# Server capabilities
/Objects/Server/ServerCapabilities/MaxBrowseReferences
# Namespace array
/Objects/Server.NamespaceArray
2. Type Definitions
# Browse to custom types
/Types/ObjectTypes/2:CustomDeviceType
# Variable type definitions
/Types/VariableTypes/2:AnalogItemType
Browse Path Validation
1. Syntax Validation
Valid browse path characteristics:
- Starts with a reference type (
/
,.
, or<ReferenceType>
) - Browse names follow the format:
[namespace:]name
where namespace index is required for all namespaces except 0 - Proper escaping of special characters with
&
- Correct reference type syntax with angle brackets
Namespace Rules:
- Standard namespace (0): prefix optional -
DeviceSet
or0:DeviceSet
- All other namespaces: prefix required -
2:DeviceSet
,3:MyDevice
2. Common Syntax Errors
Missing Reference Type:
// ❌ Invalid - missing reference type
"Objects/DeviceSet"
// ✅ Valid - starts with reference type
"/Objects/DeviceSet"
Missing Namespace Prefix:
// ❌ Invalid - missing required namespace prefix (assuming DeviceSet is in namespace 2)
"/Objects/DeviceSet/MyDevice"
// ✅ Valid - includes required namespace prefix
"/Objects/2:DeviceSet/2:MyDevice"
// ✅ Valid - standard namespace (0) prefix is optional
"/Objects/DeviceSet" (if DeviceSet is in namespace 0)
Unescaped Special Characters:
// ❌ Invalid - unescaped special characters
"/Objects/Device.Name/Value"
// ✅ Valid - escaped special characters
"/Objects/Device&.Name/Value"
Malformed Reference Types:
// ❌ Invalid - malformed reference type
"<HasComponent/MyDevice"
// ✅ Valid - proper reference type syntax
"<HasComponent>MyDevice"
3. Validation Guidelines
Always specify namespace prefixes for clarity and correctness:
✅ Recommended approach - Always include namespace prefix:
/Objects/0:Server/0:ServerStatus/0:CurrentTime
/Objects/2:DeviceSet/2:TemperatureSensor/2:Value
⚠️ Acceptable but not recommended - Omit prefix only for namespace 0:
/Objects/Server/ServerStatus/CurrentTime
❌ Never omit namespace prefix for non-zero namespaces:
# Wrong - DeviceSet is in namespace 2 but prefix is missing
/Objects/DeviceSet/TemperatureSensor
Best Practices
1. Use Meaningful Names
// ✅ Good - descriptive names
/Objects/ProductionLine/Reactor01/Temperature
// ❌ Avoid - cryptic names
/Objects/PL/R1/T
2. Consistent Namespace Usage
// ✅ Good - consistent namespacing with required prefixes
/Objects/2:DeviceSet/2:TemperatureSensor/2:Value
// ✅ Also good - explicit namespace 0 prefix for clarity
/Objects/0:Server/0:ServerStatus/0:CurrentTime
// ⚠️ Acceptable - mixed namespaces (when nodes are actually in different namespaces)
/Objects/2:DeviceSet/3:TemperatureSensor/3:Value
// ❌ Wrong - missing required namespace prefixes
/Objects/DeviceSet/TemperatureSensor/Value (if not all in namespace 0)
3. Prefer Hierarchical Navigation
// ✅ Good - simple hierarchical path
/Objects/DeviceSet/Device01/Temperature
// ⚠️ Complex - use only when necessary
<HasComponent>DeviceSet/<ConnectedTo>Device01/<HasProperty>Temperature
4. Handle Special Characters Properly
// ✅ Good - properly escaped
/Objects/Device&.Name/Value&:Current
// ❌ Wrong - unescaped special characters
/Objects/Device.Name/Value:Current
Integration with Node-RED
When using browse paths in @opcua/for-node-red nodes:
1. Read Node Configuration
{
"nodeId": "",
"browsePath": "/Objects/2:DeviceSet/3:TemperatureSensor/3:Temperature",
"outputFormat": "value"
}
2. Write Node Configuration
{
"nodeId": "",
"browsePath": "/Objects/2:DeviceSet/3:Valve/3:Position",
"datatype": "Double"
}
3. Dynamic Browse Path Construction
// Build browse path dynamically with proper namespace handling
const deviceId = msg.deviceId || "Device01";
const property = msg.property || "Temperature";
const deviceNamespace = msg.deviceNamespace || "2";
// Always include namespace prefix for non-zero namespaces
const browsePath = `/Objects/${deviceNamespace}:DeviceSet/${deviceNamespace}:${deviceId}/${deviceNamespace}:${property}`;
msg.browsePath = browsePath;
return msg;
Troubleshooting
Common Issues and Solutions
-
"BadBrowseNameInvalid"
- Check for unescaped special characters (use
&
for escaping) - Verify namespace indices exist on the server
- Ensure browse names match server exactly (case-sensitive)
- Most common: Missing required namespace prefix for non-zero namespaces
- Check for unescaped special characters (use
-
"BadNoMatch"
- Verify the complete path exists on the server
- Check namespace indices are correct and exist
- Ensure proper case sensitivity in browse names
- Confirm namespace prefixes are included where required
-
"BadReferenceTypeIdInvalid"
- Verify reference type names are correct and exist
- Check reference type namespace qualification for custom reference types
- Ensure reference types exist in the server's type system
-
Performance Issues
- Use NodeIds instead of browse paths for frequent operations
- Cache resolved NodeIds when possible
- Minimize path depth where feasible
- Consider using subscription instead of repeated browsing
See Also
- NodeIds - Alternative node identification method
- Namespaces - Understanding namespace organization
- OPC Foundation Part 4 Specification - Official browse path specification