QOpcUaMonitoringParameters#

QOpcUaMonitoringParameters provides a way to set and retrieve parameters for subscriptions and monitored items. More

Inheritance diagram of PySide6.QtOpcUa.QOpcUaMonitoringParameters

Synopsis#

Functions#

Detailed Description#

This class is used in enableMonitoring() requests and as return value for monitoringStatus() in which case it contains the revised values from the server.

Usage#

For most use cases, only the publishing interval is required.

QOpcUaMonitoringParameters p(100); // Set a publishing interval of 100ms and share the subscription.
node->enableMonitoring(QOpcUa::NodeAttribute::Value, p);

If an exclusive subscription is required, use the second parameter.

QOpcUaMonitoringParameters p(100, QOpcUaMonitoringParameters::SubscriptionType::Exclusive); // Create a new subscription

To add additional items to an existing subscription, use the third parameter for the next calls to enableMonitoring() .

quint32 subscriptionId = node->monitoringStatus(QOpcUa::NodeAttribute::Value).subscriptionId();
QOpcUaMonitoringParameters p(100, QOpcUaMonitoringParameters::SubscriptionType::Shared, subscriptionId); // Add the monitored item to this subscription

If other parameters are required, they must be set using the setter methods.

Backend support#

Not all parameters in this class are supported by all backends.

Parameter

Open62541 plugin

UACpp plugin

PublishingInterval

X

X

SamplingInterval

X

X

LifetimeCount

X

X

MaxKeepAliveCount

X

X

Priority

X

X

IndexRange

X

X

Shared

X

X

SubscriptionId

X

X

PublishingEnabled

X

X

Filter

X

X

QueueSize

X

X

DiscardOldest

X

X

MonitoringMode

X

X

IndexRange

X

X

MaxNotificationsPerPublish

X

X

class PySide6.QtOpcUa.QOpcUaMonitoringParameters#

PySide6.QtOpcUa.QOpcUaMonitoringParameters(other)

PySide6.QtOpcUa.QOpcUaMonitoringParameters(publishingInterval[, subscriptionType=QOpcUaMonitoringParameters.SubscriptionType.Shared[, subscriptionId=0]])

Parameters

The default constructor for QOpcUaMonitoringParameters .

Constructs a QOpcuaMonitoringParameters object from the value of other.

This is the constructor which covers most use cases for the Qt OPC UA user. publishingInterval must be supplied, shared and subscriptionId are optional.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.MonitoringMode#

This enum is used to set the monitoring mode for a monitored item.

Constant

Description

QOpcUaMonitoringParameters.MonitoringMode.Disabled

Sampling is disabled and no notifications are being generated.

QOpcUaMonitoringParameters.MonitoringMode.Sampling

Sampling is enabled and notifications are generated and queued, but reporting is disabled.

QOpcUaMonitoringParameters.MonitoringMode.Reporting

Sampling is enabled, notifications are generated and queued, reporting is enabled.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.SubscriptionType#

This enum is used to determine if the monitored item can be added to a shared subscription or if a new subscription must be created.

Constant

Description

QOpcUaMonitoringParameters.SubscriptionType.Shared

Share subscription with other monitored items with the same interval

QOpcUaMonitoringParameters.SubscriptionType.Exclusive

Request a new subscription for this attribute

PySide6.QtOpcUa.QOpcUaMonitoringParameters.Parameter#

Enumerates parameters that can be modified at runtime using modifyMonitoring() . Not all values are guaranteed to be supported by all plugins. Lack of support will be reported in the monitoringStatusChanged signal.

Constant

Description

QOpcUaMonitoringParameters.Parameter.PublishingEnabled

QOpcUaMonitoringParameters.Parameter.PublishingInterval

QOpcUaMonitoringParameters.Parameter.LifetimeCount

QOpcUaMonitoringParameters.Parameter.MaxKeepAliveCount

QOpcUaMonitoringParameters.Parameter.MaxNotificationsPerPublish

QOpcUaMonitoringParameters.Parameter.Priority

QOpcUaMonitoringParameters.Parameter.SamplingInterval

QOpcUaMonitoringParameters.Parameter.Filter

QOpcUaMonitoringParameters.Parameter.QueueSize

QOpcUaMonitoringParameters.Parameter.DiscardOldest

QOpcUaMonitoringParameters.Parameter.MonitoringMode

PySide6.QtOpcUa.QOpcUaMonitoringParameters.clearFilter()#

Removes the current filter from the monitoring parameters.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.clearFilterResult()#

Removes the current filter result from the monitoring parameters.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.discardOldest()#
Return type

bool

Returns the setting of the monitored item.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.filter()#
Return type

object

Returns the current filter.

See also

setFilter()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.filterResult()#
Return type

object

Returns the filter result.

This value is empty for an attribute monitoring. In case of an event monitoring, the filter result can be empty if the server did not detect any errors in the filter.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.indexRange()#
Return type

str

Returns the index range for the monitored item.

See also

setIndexRange()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.isPublishingEnabled()#
Return type

bool

Returns the publishing mode for the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.lifetimeCount()#
Return type

int

Returns the lifetime count of the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.maxKeepAliveCount()#
Return type

int

Returns the maximum keepalive count of the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.maxNotificationsPerPublish()#
Return type

int

Returns the maximum notifications per publish value of the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.monitoredItemId()#
Return type

int

Returns the monitored item id assigned by the server. If the monitored item id is 0, the monitored item could not be successfully created.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.monitoringMode()#
Return type

MonitoringMode

Returns the monitoring mode for the monitored item.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.priority()#
Return type

quint8

Returns the priority of the subscription used for the monitored item.

See also

setPriority()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.publishingInterval()#
Return type

double

Returns the publishing interval of the subscription. The interval is expressed in milliseconds.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.queueSize()#
Return type

int

Returns the queue size of the monitored item.

See also

setQueueSize()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.samplingInterval()#
Return type

double

Returns the revised sampling interval of the monitored item. The interval is expressed in milliseconds.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setDiscardOldest(discardOldest)#
Parameters

discardOldest – bool

Set discardOldest as discardOldest setting for the monitored item.

See also

discardOldest()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setFilter(eventFilter)#
Parameters

eventFilterPySide6.QtOpcUa.QOpcUaMonitoringParameters.EventFilter

Request eventFilter as filter for the monitored item. If another event filter or a data change filter is present, it will be replaced. If the server does not accept the filter, this will be indicated by the status code and the event filter result after the enableMonitoring() request has finished.

See also

filter()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setFilter(filter)
Parameters

filterPySide6.QtOpcUa.QOpcUaMonitoringParameters.DataChangeFilter

Sets DataChangeFilter filter as filter for the monitored item. If another data change filter or an event filter is present, it will be replaced.

If the server does not accept the filter, this will be indicated by the status code after the enableMonitoring() request has finished.

See also

filter()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setFilterResult(eventFilterResult)#
Parameters

eventFilterResultPySide6.QtOpcUa.QOpcUaEventFilterResult

Sets the event filter result to eventFilterResult.

This method must only be used by the backend, setting an event filter result as a user does not have any effect.

See also

filterResult()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setIndexRange(indexRange)#
Parameters

indexRange – str

Requests indexRange as index range for the monitored item. For details on the index range string, see readAttributeRange() .

See also

indexRange()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setLifetimeCount(lifetimeCount)#
Parameters

lifetimeCount – int

Request lifetimeCount as lifetime count for the subscription.

See also

lifetimeCount()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setMaxKeepAliveCount(maxKeepAliveCount)#
Parameters

maxKeepAliveCount – int

Request maxKeepAliveCount as maximum keepalive count for the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setMaxNotificationsPerPublish(maxNotificationsPerPublish)#
Parameters

maxNotificationsPerPublish – int

Set maxNotificationsPerPublish as maximum notifications per publish value for the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setMonitoredItemId(monitoredItemId)#
Parameters

monitoredItemId – int

Sets the monitored item id to monitoredItemId.

Setting this value as a client has no effect.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setMonitoringMode(monitoringMode)#
Parameters

monitoringModeMonitoringMode

Set monitoringMode as monitoring mode for the monitored item.

See also

monitoringMode()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setPriority(priority)#
Parameters

priorityquint8

Set priority as priority for the subscription.

See also

priority()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setPublishingEnabled(publishingEnabled)#
Parameters

publishingEnabled – bool

Set publishingEnabled as publishing mode for the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setPublishingInterval(publishingInterval)#
Parameters

publishingIntervaldouble

Request publishingInterval as publishing interval for the subscription. The interval is expressed in milliseconds.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setQueueSize(queueSize)#
Parameters

queueSize – int

Request queueSize as queue size for the monitored item.

See also

queueSize()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setSamplingInterval(samplingInterval)#
Parameters

samplingIntervaldouble

Request samplingInterval as sampling interval for the monitored item. The interval is expressed in milliseconds.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setStatusCode(statusCode)#
Parameters

statusCodeUaStatusCode

Set the status code to statusCode.

See also

statusCode()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setSubscriptionId(subscriptionId)#
Parameters

subscriptionId – int

Request the monitored items to be created on a known subscription with subscriptionId.

See also

subscriptionId()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.setSubscriptionType(subscriptionType)#
Parameters

subscriptionTypeSubscriptionType

Request shared as subscription type for the subscription.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.statusCode()#
Return type

UaStatusCode

Returns the status code of the monitored item creation.

See also

setStatusCode()

PySide6.QtOpcUa.QOpcUaMonitoringParameters.subscriptionId()#
Return type

int

Returns the assigned subscription id.

PySide6.QtOpcUa.QOpcUaMonitoringParameters.subscriptionType()#
Return type

SubscriptionType

Returns the subscription type.