Node¶
Canonical path: o6.node.Node
Root shortcut: o6.Node
Node
¶
Bases: _NativeNodeBase, HasNodeId
Base class providing dot, index, and call syntax for OPC UA nodes.
A node handle is a live view of one node in an address space, obtained from a client, a server, or by browsing from another handle. It is not a snapshot: every access goes to the server.
Three syntaxes cover the whole API. Attribute access browses one level
(server.objectsNode.deviceSet), the call operator reads or writes an
attribute (node(), node(23.5), node(attr="browseName")), and the index
operator resolves a browse path when a name is ambiguous or relative.
Public helpers on this class carry a leading underscore, because ordinary names would collide with OPC UA child lookup. Subclasses may still keep application state under ordinary Python names.
See the Node API.
Functions¶
__init__
¶
Wrap an existing node. Handles come from a client, server, or browsing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
Any
|
The client or server backend that carries out operations. |
required |
nodeId
|
NodeIdLike
|
NodeId of the node. |
required |
browseName
|
QualifiedName
|
BrowseName of the node. |
required |
__call__
¶
Read or write one attribute of this node.
Called without a value it reads, and with a value it writes. The
attribute defaults to Value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to write. Omit it to read instead. |
_UNSET
|
attr
|
Optional[AttributeId | str]
|
The attribute to address, as an
|
None
|
Returns:
| Type | Description |
|---|---|
MaybeAwaitable[Any]
|
The attribute value when reading, |
MaybeAwaitable[Any]
|
the owning client or server runs on an external event loop. |
Raises:
| Type | Description |
|---|---|
Exception
|
The write returned a bad StatusCode. |
StatusCodeError
|
The service call itself failed. |
__getitem__
¶
Resolve a browse path relative to this node.
Use this where attribute access cannot reach: a BrowseName that is not a Python identifier, an ambiguous name, or a multi-step relative path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str | 'ns0.datatypes.RelativePath'
|
A relative-path string such as |
required |
Returns:
| Type | Description |
|---|---|
MaybeAwaitable[list[Any]]
|
Every node the path resolves to, as a list; awaitable when the owning |
MaybeAwaitable[list[Any]]
|
client or server runs on an external event loop. |
Raises:
| Type | Description |
|---|---|
KeyError
|
The path matches no node. |