class documentation
class Server(AsyncTaskMixin, LifecycleMixin, ReprStrMixin, BaseServer[
Constructor: Server(config)
Undocumented
| Async Method | __aenter__ |
Enter the asynchronous context manager; no setup required. |
| Async Method | __aexit__ |
Exit the asynchronous context manager and shut down the server. |
| Method | __del__ |
Undocumented |
| Method | __init__ |
Undocumented |
| Async Method | add |
Add given machine to the server. Will initialize the machine if not yet initialized. |
| Method | config |
Set the server-wide configuration. Only allowed before server initialization. |
| Async Method | ensure |
Return OPC UA Node representation of given enum type. Creates OPC UA representation automatically. |
| Method | register |
Use an existing enumeration OPC UA data type for enum_type instead of creating one. |
| Async Method | start |
Start the internal OPC UA server. |
| Async Method | ua |
Get or add a new OPC UA dictionary entry and return the corresponding OPC UA Node. |
| Async Method | ua |
Import the OPC UA XML nodeset specified by the given uri and return the namespace index. |
| Async Method | ua |
Import XML nodeset from given path. Returns the namespace index on success. |
| Method | ua |
Register the given nodeset XML file living in package. Overrides existing nodesets based on URI. |
| Property | access |
Undocumented |
| Property | config |
Return the server-wide configuration. |
| Property | logger |
Return the logger instance of the server. Read-only property. |
| Property | machines |
Read-only. Return all machines added to the server. |
| Property | running |
Whether the server is running. |
| Property | state |
Read-only. Return the state of the server. |
| Property | stopped |
Whether the server is stopped. |
| Property | ua |
Read-only. Return the internal OPC UA address space instance. |
| Property | ua |
Read-only. Return the internal OPC UA server instance. |
| Async Method | _init |
Undocumented |
| Async Method | _life |
Undocumented |
| Async Method | _register |
Undocumented |
| Method | _repr |
Undocumented |
| Async Method | _setup |
Undocumented |
| Async Method | _shutdown |
Undocumented |
| Async Method | _ua |
Add a new empty OPC UA namespace with the given uri to the server. |
| Async Method | _update |
Undocumented |
| Async Method | _watchdog |
Monitor how busy the event loop is and warn if it is probably too busy. |
| Instance Variable | _access |
Undocumented |
| Instance Variable | _config |
Undocumented |
| Instance Variable | _dictionary |
Maps Semantic ID (=Browse name) to live OPC UA node IDs of the corresponding Dictionary entries. |
| Instance Variable | _enum |
Lock used when creating new OPC UA enums. |
| Instance Variable | _logger |
Undocumented |
| Instance Variable | _machines |
Undocumented |
| Instance Variable | _state |
Undocumented |
| Instance Variable | _ua |
Undocumented |
| Instance Variable | _ua |
Maps created custom enums to OPC UA type nodes. |
| Instance Variable | _ua |
Undocumented |
| Instance Variable | _ua |
Maps nodeset XML URIs to information how to load the corresponding XML file. |
| Instance Variable | _ua |
Undocumented |
def register_enum(self, enum_type:
type[ IntEnum], *, ua_data_type: ua.NodeId, overwrite: bool = False):
¶
Use an existing enumeration OPC UA data type for enum_type instead of creating one.
Start the internal OPC UA server.
Server must be initialized beforehand, and must be in state STOPPED.
:param blocking If True, block until server shutdown or KeyboardInterrupt is caught
Import the OPC UA XML nodeset specified by the given uri and return the namespace index.
Automatically loads all required nodesets beforehand.
| Raises | |
KeyError | If given URI is unknown. |
Add a new empty OPC UA namespace with the given uri to the server.
| Returns | |
ua.Int16 | The namespace index for the newly created namespace. |