- class QOpcUaProvider¶
QOpcUaProvider
creates an instance ofQOpcUaClient
. More…Synopsis¶
Methods¶
def
__init__()
def
createClient()
Static functions¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
QOpcUaProvider
allows the user to create an instance ofQOpcUaClient
by loading a QOpcUaPlugin using the Qt plugin system.Example¶
This code creates a client using the first available backend:
QOpcUaProvider provider; QStringList available = provider.availableBackends(); if (!available.isEmpty()) { QOpcUaClient *client = provider.createClient(available[0]); if (client) qDebug() << "Client successfully created"; }
Creates a new OPC UA provider with a given
parent
.- static availableBackends()¶
- Return type:
list of strings
Returns a QStringList of available plugins.
- createClient(backend[, backendProperties=QVariantMap()])¶
- Parameters:
backend – str
backendProperties – Dictionary with keys of type .QString and values of type QVariant.
- Return type:
Returns a pointer to a
QOpcUaClient
object by loading the selectedbackend
as a plugin and creating a client object. If the plugin loading fails,nullptr
is returned instead.The user is responsible for deleting the returned
QOpcUaClient
object when it is no longer needed.The optional argument
backendProperties
can be used to pass custom backend specific settings as key value pairs. Those settings are specific to the backend being instantiated.Available settings are
Setting string
Backend
Description
minimumClientIterateIntervalMs
open62541
This parameter is no longer evaluated by the backend and has been replaced by
clientIterateIntervalMs
.clientIterateIntervalMs
open62541
Defines the client iterate interval for the backend. If the client is causing too much CPU load, setting this value higher than the default will reduce the CPU load at the price of an increased response time to service requests and value updates from subscriptions. The default value is 50ms.
asyncRequestTimeoutMs
open62541
Defines the timeout for asynchronous requests to an OPC UA server. If the server doesn’t reply to a service request before the timeout occurs, the service call fails and the finished signal will contain a
bad
status code. The default value is 15000ms.