Skip to main content

Nodes

ua.nodes It is a Lazy Load node accessor that allows you to access remote nodes just as you would local objects; at the same time, the OpcUaSession previous set of methods browse directly uses strings NodeId.

Subpage Redirect

Three Ways to Access Nodes​

# Method 1: Direct String NodeId Access (Simplest and Most Efficient RPC)
with ua.read("ns=2;s=Temperature") as dv:
print(dv.value)

# Method 2: Lazy Load Indexer (like local objects, exploratory)
node = ua.nodes["ns=2;s=Temperature"]
print(node.display_name)
with node.value as dv:
print(dv.value)

t = ua.nodes.server["ServerStatus"]["CurrentTime"]
with t.value as dv:
print(dv.value)

# Method 3: Path Resolution
node = ua.resolve("/Objects/Server/ServerStatus/CurrentTime")
with node.value as dv:
print(dv.value)

All three methods work the same way under the hood RPC; just choose the one that feels most natural to you. (Note: is resolveSegment by segment browse Yes, post as many times as there are sections in the path RPC — See translate_browse_paths (Comparison table.)

Selection Guide​

ScenarioRecommendations
Known to be accurate NodeId (Production Code)Method 1: String
Standard ns=0 NodeMethod 2 + WellKnownNodes
Browse Tree / One-Time ScriptMethod 2: Indexer
Batch Initialization of 100+ Pathstranslate_browse_paths
Long-term operation with high-frequency accessregister_nodes Accelerate

Next Step​