basic_robotics.interfaces.opc_bridge module
Handle communication with OPC Unified Automation Protocol.
- class basic_robotics.interfaces.opc_bridge.OPCUA_Endpoint(name: str, opc_path, client_ref: opcua.Client)[source]
Bases:
CommsObjectCreate a new OPCUA Endpoint.
- class basic_robotics.interfaces.opc_bridge.OPCUA_Client(end_point: str)[source]
Bases:
CommsWrap a OPCUA Client object to be compatible with Basic-Robotics Communications.
- __init__(end_point: str) OPCUA_Client[source]
Create a new OPCUA_Client.
- Parameters:
end_point (str) – OPC Server URL
- Returns:
OPCUA_Client – New OPCUA_Client
- setSecurity(security_policy: str, cert_file: str, private_key_file: str, server_certificate_file: str = None, mode: str = 'SignAndEncrypt') None[source]
Set Security Settings for OPC Client.
if the client is already open, this function will close the client, apply settings, and then reopen the client connection. :param security_policy: security policy path :type security_policy: str :param cert_file: certificate path :type cert_file: str :param private_key_file: private key path :type private_key_file: str :param server_certificate_file: server certificate path. Defaults to None. :type server_certificate_file: str, optional :param mode: policy mode. Sign or SignAndEncrypt. Defaults to SignAndEncrypt. :type mode: str, optional
- newComPort(name: str, type: str, *args, **kwargs) None[source]
Create a new named comm port and adds it to the register.
- Parameters:
name – String - name to identify new port
type – String - type of port “UDP” or “Serial” or “OPCEndpoint”
args – Optional - List of arguments specific to comm port