Skip to content

ObjectNode

Canonical path: o6.node.ObjectNode

ObjectNode

Bases: Node

Node representing an OPC UA Object.

The keyword form of the constructor shown below creates a node in a server's address space. It is available on the generated ObjectTypes in o6.ns and on @o6.objecttype classes, which is where instances are normally created; calling this base class with those keywords raises TypeError, because a bare Object has no type definition to instantiate.

Functions

__init__

__init__(
    backend: Any,
    nodeId: NodeIdLike,
    browseName: QualifiedName,
) -> None
__init__(
    *,
    server: Optional[Server] = None,
    nodeId: Optional[NodeIdLike] = None,
    parent: Optional[NodeIdLike | Node] = None,
    browseName: Optional[str | QualifiedName] = None,
    referenceType: Optional[NodeIdLike] = None,
    values: Optional[dict[str, Any]] = None,
    references: Optional[list[Any]] = None
) -> None
__init__(*args, **kwargs)

__lshift__

__lshift__(event)

Fire event sourced at this Object, without an explicit Server reference.

Accepts an Event draft, a mapping of event arguments, or an existing event Object instance on this server. An instance supplies its fields and type; mappings and drafts can pass it as eventInstance. A draft's own source is left unchanged, so it can be reused against a different node afterward.

See Events.

__call__

__call__(value=_UNSET, attr=None)

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. Reads return values for all Good-severity statuses and raise for Uncertain or Bad; use the owning client/server's read(..., valueOnly=False) to inspect status and timestamp metadata.

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 o6.AttributeId or a case-insensitive attribute name such as "browseName".

None

Returns:

Type Description
MaybeAwaitable[Any]

The attribute value when reading, None when writing. Async tasks

MaybeAwaitable[Any]

always receive an awaitable, including for immediate local results.

Raises:

Type Description
StatusCodeError

The read or write operation failed.

__getitem__

__getitem__(key)

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 "1:DeviceSet/1:Motor", or a ns0.datatypes.RelativePath.

required

Returns:

Type Description
MaybeAwaitable[list[Any]]

Every node the path resolves to, as a list; awaitable in async tasks.

Raises:

Type Description
KeyError

The path matches no node.