class documentation

class RemoteVariable(RemoteUaObject['RemoteVariableContainer'], UaDataChangeSubscriber):

Constructor: RemoteVariable(name, ua_node, server, parent)

View In Hierarchy

The remote interface for a server-side UaVariable.

Method __init__ Create a new instance. Must be asynchronously initialized with init() before use.
Method __str__ Return string representation of this variable.
Method dto Return the data transfer object.
Async Method read_history Provide requested (default=all) historic values of this variable including their timestamps of the server.
Async Method read_raw_value Read the actual raw value from the remote server.
Async Method read_resolved_value Read the resolved value of this variable. Fall back to normal value if there is nothing to resolve.
Async Method read_value Read the actual value from the remote server, not the cached local one.
Async Method ua_on_data_change Undocumented
Async Method update_from_data_value Update both value and timestamp from given data value or subscription callback data.
Async Method write_value Try to directly write the given value to the server.
Instance Variable children Undocumented
Instance Variable range Range of this variable.
Instance Variable unit Unit of this variable.
Instance Variable value_changed Undocumented
Property is_value_node_id Return True if the value of this RemoteVariable is a not null Node ID.
Property is_writable Whether this variable is writable or read-only.
Property raw_value Return the raw value as an OPC UA Variant.
Property timestamp Timestamp of last value change.
Property ua_data_type Internal OPC UA data type.
Property ua_value_rank Internal OPC UA value rank (-1 for Scalar, 0 for 1 or more, >=1 exact dimension).
Property valid_values Valid values of this remote variable in dictionary form.
Property value Cached Value of this variable.
Async Method _init Undocumented
Method _process_value Undocumented
Instance Variable _is_writable Undocumented
Instance Variable _range Undocumented
Instance Variable _timestamp Undocumented
Instance Variable _ua_data_type Undocumented
Instance Variable _ua_value Undocumented
Instance Variable _ua_value_rank Undocumented
Instance Variable _ua_value_rank_value Undocumented
Instance Variable _unit Undocumented
Instance Variable _valid_values Undocumented
def __init__(self, *, name: str, ua_node: Node, server: RemoteServer, parent: RemoteVariableContainer):

Create a new instance. Must be asynchronously initialized with init() before use.

def __str__(self) -> str:

Return string representation of this variable.

def dto(self) -> RemoteVariableDTO:

Return the data transfer object.

async def read_history(self, start_time: datetime | None = None, end_time: datetime | None = None, num_values: int = 0, return_bounds: bool = True) -> list[TimestampedValue]:

Provide requested (default=all) historic values of this variable including their timestamps of the server.

Parameters
start_time:datetime | NoneStart timestamp in UTC for the first data point of the period if specified.
end_time:datetime | NoneEnd timestamp in UTC for the last data point of the period if specified.
num_values:intMaximum number of values returned. 0 = No maximum.
return_bounds:boolInclude the bounding values?
Returns
list[TimestampedValue]Undocumented
async def read_raw_value(self) -> Variant:

Read the actual raw value from the remote server.

async def read_resolved_value(self) -> Any:

Read the resolved value of this variable. Fall back to normal value if there is nothing to resolve.

For example, if this variable value is a node id, resolve it to the display name of the target node. If the display name is not readable, fall back to the browse name. If that is also not readable, return the last part of the string identifier of the node.

async def read_value(self, *, update_cache: bool = False) -> Any:

Read the actual value from the remote server, not the cached local one.

@override
async def ua_on_data_change(self, node: Node, val: Any, data: DataChangeNotif):

Undocumented

async def update_from_data_value(self, value: DataValue | DataChangeNotif | None):

Update both value and timestamp from given data value or subscription callback data.

async def write_value(self, value: Any):

Try to directly write the given value to the server.

Might fail if variable is not writable or user has currently no rights to write the variable.

children: dict[str, RemoteVariable] =

Undocumented

range: ua.Range | None =

Range of this variable.

unit: ua.EUInformation | None =

Unit of this variable.

value_changed =

Undocumented

@property
is_value_node_id: bool =

Return True if the value of this RemoteVariable is a not null Node ID.

@property
is_writable: bool =

Whether this variable is writable or read-only.

Note however, that this is separate from the current access rights of the user.

@property
raw_value: Variant =

Return the raw value as an OPC UA Variant.

@property
timestamp: datetime | None =

Timestamp of last value change.

@property
ua_data_type: str =

Internal OPC UA data type.

@property
ua_value_rank: int =

Internal OPC UA value rank (-1 for Scalar, 0 for 1 or more, >=1 exact dimension).

@property
valid_values: dict[int, str] | dict[str, str] =

Valid values of this remote variable in dictionary form.

Used for e.g. selection dropdown in front-end.

@property
value: Any =

Cached Value of this variable.

@override
async def _init(self):

Undocumented

def _process_value(self, value: Variant | None) -> Any:

Undocumented

_is_writable: bool =

Undocumented

_range =

Undocumented

_timestamp: datetime | None =

Undocumented

_ua_data_type: str =

Undocumented

_ua_value: ua.Variant =

Undocumented

_ua_value_rank: int =

Undocumented

_ua_value_rank_value =

Undocumented

_unit =

Undocumented

_valid_values: dict[int, str] | dict[str, str] =

Undocumented