class documentation
class UaObject(BaseUaObject[
Constructor: UaObject(name, minimum_access_level, bypass_lock, server, ...)
Abstract base class for all server-side PyUaAdapter-managed OPC UA objects.
| Method | __init__ |
Cooperative constructor. |
| Method | access |
Undocumented |
| Async Method | ua |
Create main OPC UA node and all modeled mandatory sub nodes at the given OPC UA ua_location. |
| Instance Variable | bypass |
Whether Lock ownership can be bypassed. |
| Instance Variable | minimum |
Minimum User access level required for write & method execution. |
| Instance Variable | ua |
Undocumented |
| Property | lock |
Lock instance protecting this UaObject. |
| Async Method | _get |
Return the instantiation definition for the main OPC UA node. Is called from ua_create_node. |
| Method | _repr |
Undocumented |
| Async Method | _ua |
Get the OPC UA object type and create a new object at the given OPC UA ua_location. |
def __init__(self, *, name:
str | None = None, minimum_access_level: int | None = None, bypass_lock: bool = False, server: Server | None = None, **kwargs: dict[ str, Any]):
¶
Cooperative constructor.
| Parameters | |
name:str | None | Name of the UaObject. Must be a non-empty string or None to use the Python class name. |
minimumint | None | Minimum access level of the UaObject (write/call). Read access is always allowed. |
bypassbool | Whether the variable can be written to without ownership of corresponding lock. |
server:Server | None | Undocumented |
**kwargs:dict[ | Undocumented |
@override
def access_allowed(self, user: UserAuthorization, *, lock_required: bool | None = None) -> bool:
¶
Undocumented
@final
async def ua_create_node(self, ua_location: Node, *, instantiate_optional: bool = False, exist_ok: bool = False, remove_existing: bool = False):
¶
Create main OPC UA node and all modeled mandatory sub nodes at the given OPC UA ua_location.
If subclasses want to customize the node creation behavior, override _ua_create_node().
| Parameters | |
uaNode | Parent OPC-UA node, ideally a folder type. |
instantiatebool | Whether to instantiate all modeled optional sub nodes as well. |
existbool | Whether to reuse an existing node if found. |
removebool | Whether to remove existing node if found. |
| Raises | |
RuntimeError | If main OPC UA node already set, or already exists and reusing is not allowed. |