PySide6.QtOpcUa.QOpcUaMonitoringParameters

class QOpcUaMonitoringParameters

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

Synopsis

Methods

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

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.

class 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.

class 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

class Parameter

(inherits enum.Flag) 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

QOpcUaMonitoringParameters.Parameter.TriggeredItemIds

__init__()

The default constructor for QOpcUaMonitoringParameters .

__init__(other)
Parameters:

otherQOpcUaMonitoringParameters

Constructs a QOpcuaMonitoringParameters object from the value of other.

__init__(publishingInterval[, subscriptionType=QOpcUaMonitoringParameters.SubscriptionType.Shared[, subscriptionId=0]])
Parameters:
  • publishingInterval – float

  • subscriptionTypeSubscriptionType

  • subscriptionId – int

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

clearFilter()

Removes the current filter from the monitoring parameters.

clearFilterResult()

Removes the current filter result from the monitoring parameters.

discardOldest()
Return type:

bool

Returns the discardOldest setting of the monitored item.

failedTriggeredItemsStatus()
Return type:

Dictionary with keys of type .quint32 and values of type QOpcUa.UaStatusCode.

Returns the status codes for all triggered items from setTriggeredItemIds() that could not be successfully added.

filter()
Return type:

object

Returns the current filter.

See also

setFilter()

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.

indexRange()
Return type:

str

Returns the index range for the monitored item.

See also

setIndexRange()

isPublishingEnabled()
Return type:

bool

Returns the publishing mode for the subscription.

lifetimeCount()
Return type:

int

Returns the lifetime count of the subscription.

maxKeepAliveCount()
Return type:

int

Returns the maximum keepalive count of the subscription.

maxNotificationsPerPublish()
Return type:

int

Returns the maximum notifications per publish value of the subscription.

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.

monitoringMode()
Return type:

MonitoringMode

Returns the monitoring mode for the monitored item.

priority()
Return type:

int

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

See also

setPriority()

publishingInterval()
Return type:

float

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

queueSize()
Return type:

int

Returns the queue size of the monitored item.

See also

setQueueSize()

samplingInterval()
Return type:

float

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

setDiscardOldest(discardOldest)
Parameters:

discardOldest – bool

Set discardOldest as discardOldest setting for the monitored item.

See also

discardOldest()

setFailedTriggeredItemsStatus(status)
Parameters:

status – Dictionary with keys of type .quint32 and values of type QOpcUa.UaStatusCode.

Sets the status codes for all triggered items that could not be successfully added to status. Setting this value as a client has no effect.

setFilter(filter)
Parameters:

filterDataChangeFilter

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()

setFilter(eventFilter)
Parameters:

eventFilterEventFilter

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()

setFilterResult(eventFilterResult)
Parameters:

eventFilterResultQOpcUaEventFilterResult

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()

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()

setLifetimeCount(lifetimeCount)
Parameters:

lifetimeCount – int

Request lifetimeCount as lifetime count for the subscription.

See also

lifetimeCount()

setMaxKeepAliveCount(maxKeepAliveCount)
Parameters:

maxKeepAliveCount – int

Request maxKeepAliveCount as maximum keepalive count for the subscription.

setMaxNotificationsPerPublish(maxNotificationsPerPublish)
Parameters:

maxNotificationsPerPublish – int

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

setMonitoredItemId(monitoredItemId)
Parameters:

monitoredItemId – int

Sets the monitored item id to monitoredItemId.

Setting this value as a client has no effect.

setMonitoringMode(monitoringMode)
Parameters:

monitoringModeMonitoringMode

Set monitoringMode as monitoring mode for the monitored item.

See also

monitoringMode()

setPriority(priority)
Parameters:

priority – int

Set priority as priority for the subscription.

See also

priority()

setPublishingEnabled(publishingEnabled)
Parameters:

publishingEnabled – bool

Set publishingEnabled as publishing mode for the subscription.

setPublishingInterval(publishingInterval)
Parameters:

publishingInterval – float

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

setQueueSize(queueSize)
Parameters:

queueSize – int

Request queueSize as queue size for the monitored item.

See also

queueSize()

setSamplingInterval(samplingInterval)
Parameters:

samplingInterval – float

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

setStatusCode(statusCode)
Parameters:

statusCodeUaStatusCode

Set the status code to statusCode.

See also

statusCode()

setSubscriptionId(subscriptionId)
Parameters:

subscriptionId – int

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

See also

subscriptionId()

setSubscriptionType(subscriptionType)
Parameters:

subscriptionTypeSubscriptionType

Request shared as subscription type for the subscription.

setTriggeredItemIds(id)
Parameters:

id – .QSetquint32

Adds triggering links to all monitored items in ids as described in OPC UA 1.05, 5.12.1.6.

The values in ids must be the monitored item ids of other monitored item on the same subscription. If the monitoring mode of these items is set to Sampling, their data change notifications will be delivered to the client whenever this monitoring detects a data change.

Any ids that could not be added will not be included in the monitoring status but will instead show up in failedTriggeredItemsStatus() .

Modifying this setting to an empty set will remove all triggering links.

statusCode()
Return type:

UaStatusCode

Returns the status code of the monitored item creation.

See also

setStatusCode()

subscriptionId()
Return type:

int

Returns the assigned subscription id.

subscriptionType()
Return type:

SubscriptionType

Returns the subscription type.

triggeredItemIds()
Return type:

.QSetquint32

Returns the ids of the monitored items triggerd by this monitored item.