The get_opc_client
function is responsible for loading the configuration and returning an OPCClient instance of OPCClient
.
server_name
(str): The name of the OPC server configuration to load from 'config.json'.
OPCClient
: An instance of OPCClient configured for the specified OPC server.
This version of OPC_Connector allows the creation of multiple OPC connections, each determined by an OPC Server name. Configuration for each connection must be defined in 'config.json'.
from OPC_Connector import get_opc_client
# Get an OPCClient instance for a server named 'MyServer'
opc_client = get_opc_client('MyServer')