PySide6.QtOpcUa.QOpcUaMonitoringParameters¶
- class QOpcUaMonitoringParameters¶
QOpcUaMonitoringParameters
provides a way to set and retrieve parameters for subscriptions and monitored items. More…Synopsis¶
Methods¶
def
__init__()
def
clearFilter()
def
discardOldest()
def
filter()
def
filterResult()
def
indexRange()
def
lifetimeCount()
def
monitoringMode()
def
priority()
def
queueSize()
def
setFilter()
def
setIndexRange()
def
setPriority()
def
setQueueSize()
def
setStatusCode()
def
statusCode()
def
subscriptionId()
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 formonitoringStatus()
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 usingmodifyMonitoring()
. Not all values are guaranteed to be supported by all plugins. Lack of support will be reported in themonitoringStatusChanged
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:
other –
QOpcUaMonitoringParameters
Constructs a QOpcuaMonitoringParameters object from the value of
other
.- __init__(publishingInterval[, subscriptionType=QOpcUaMonitoringParameters.SubscriptionType.Shared[, subscriptionId=0]])
- Parameters:
publishingInterval – float
subscriptionType –
SubscriptionType
subscriptionId – int
This is the constructor which covers most use cases for the Qt OPC UA user.
publishingInterval
must be supplied,shared
andsubscriptionId
are optional.- clearFilter()¶
Removes the current filter from the monitoring parameters.
See also
- clearFilterResult()¶
Removes the current filter result from the monitoring parameters.
See also
- discardOldest()¶
- Return type:
bool
Returns the discardOldest setting of the monitored item.
See also
- 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.See also
- filter()¶
- Return type:
object
Returns the current filter.
See also
- 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.
See also
- indexRange()¶
- Return type:
str
Returns the index range for the monitored item.
See also
- isPublishingEnabled()¶
- Return type:
bool
Returns the publishing mode for the subscription.
- lifetimeCount()¶
- Return type:
int
Returns the lifetime count of the subscription.
See also
- maxKeepAliveCount()¶
- Return type:
int
Returns the maximum keepalive count of the subscription.
See also
- maxNotificationsPerPublish()¶
- Return type:
int
Returns the maximum notifications per publish value of the subscription.
See also
- 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.
See also
- monitoringMode()¶
- Return type:
Returns the monitoring mode for the monitored item.
See also
- priority()¶
- Return type:
int
Returns the priority of the subscription used for the monitored item.
See also
- publishingInterval()¶
- Return type:
float
Returns the publishing interval of the subscription. The interval is expressed in milliseconds.
See also
- queueSize()¶
- Return type:
int
Returns the queue size of the monitored item.
See also
- samplingInterval()¶
- Return type:
float
Returns the revised sampling interval of the monitored item. The interval is expressed in milliseconds.
See also
- setDiscardOldest(discardOldest)¶
- Parameters:
discardOldest – bool
Set
discardOldest
asdiscardOldest
setting for the monitored item.See also
- 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.See also
- setFilter(filter)¶
- Parameters:
filter –
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
- setFilter(eventFilter)
- Parameters:
eventFilter –
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 theenableMonitoring()
request has finished.See also
- setFilterResult(eventFilterResult)¶
- Parameters:
eventFilterResult –
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
- setIndexRange(indexRange)¶
- Parameters:
indexRange – str
Requests
indexRange
as index range for the monitored item. For details on the index range string, seereadAttributeRange()
.See also
- setLifetimeCount(lifetimeCount)¶
- Parameters:
lifetimeCount – int
Request
lifetimeCount
as lifetime count for the subscription.See also
- setMaxKeepAliveCount(maxKeepAliveCount)¶
- Parameters:
maxKeepAliveCount – int
Request
maxKeepAliveCount
as maximum keepalive count for the subscription.See also
- setMaxNotificationsPerPublish(maxNotificationsPerPublish)¶
- Parameters:
maxNotificationsPerPublish – int
Set
maxNotificationsPerPublish
as maximum notifications per publish value for the subscription.See also
- setMonitoredItemId(monitoredItemId)¶
- Parameters:
monitoredItemId – int
Sets the monitored item id to
monitoredItemId
.Setting this value as a client has no effect.
See also
- setMonitoringMode(monitoringMode)¶
- Parameters:
monitoringMode –
MonitoringMode
Set
monitoringMode
as monitoring mode for the monitored item.See also
- setPriority(priority)¶
- Parameters:
priority – int
Set
priority
as priority for the subscription.See also
- setPublishingEnabled(publishingEnabled)¶
- Parameters:
publishingEnabled – bool
Set
publishingEnabled
as publishing mode for the subscription.See also
- setPublishingInterval(publishingInterval)¶
- Parameters:
publishingInterval – float
Request
publishingInterval
as publishing interval for the subscription. The interval is expressed in milliseconds.See also
- setQueueSize(queueSize)¶
- Parameters:
queueSize – int
Request
queueSize
as queue size for the monitored item.See also
- setSamplingInterval(samplingInterval)¶
- Parameters:
samplingInterval – float
Request
samplingInterval
as sampling interval for the monitored item. The interval is expressed in milliseconds.See also
- setStatusCode(statusCode)¶
- Parameters:
statusCode –
UaStatusCode
Set the status code to
statusCode
.See also
- setSubscriptionId(subscriptionId)¶
- Parameters:
subscriptionId – int
Request the monitored items to be created on a known subscription with
subscriptionId
.See also
- setSubscriptionType(subscriptionType)¶
- Parameters:
subscriptionType –
SubscriptionType
Request
shared
as subscription type for the subscription.See also
- 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.
See also
- statusCode()¶
- Return type:
Returns the status code of the monitored item creation.
See also
- subscriptionId()¶
- Return type:
int
Returns the assigned subscription id.
See also
- subscriptionType()¶
- Return type:
Returns the subscription type.
See also
- triggeredItemIds()¶
- Return type:
.QSetquint32
Returns the ids of the monitored items triggerd by this monitored item.
See also