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
- class EventFilter¶
Defines an
EventFilter
for a monitored item. More_…Synopsis¶
Methods¶
def
__init__()
def
__lshift__()
def
__eq__()
def
selectClauses()
def
setWhereClause()
def
whereClause()
def
whereClauseRef()
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¶
An event filter is required for monitoring events on the server. It consists of
select
clauses and awhere
clause.The
select
clauses are used to specify the data the user wants to receive when an event occurs. It consists ofQOpcUaSimpleAttributeOperand
simple attribute operands which select attributes of child nodes of an event type, for example the value attribute of the “Message” property of BaseEventType.The
where
clause is used to restrict the reported events by matching against certain criteria. Several operators and four different operand types allow filtering based on the values of the attributes of the child nodes of an event type.Filters can be constructed using the setter or the streaming operator. Streaming a
QOpcUaSimpleAttributeOperand
into an event filter adds a newselect
clause to the filter, aQOpcUaContentFilterElement
is appended to thewhere
clause. A content filter element can be constructed by streaming operands of the typesQOpcUaLiteralOperand
,QOpcUaElementOperand
,QOpcUaAttributeOperand
andQOpcUaSimpleAttributeOperand
and an operator into a content filter element. Only the last operator is used, previous operators will be discarded.The following
EventFilter
tells the server to report the value of the “Message” field for events that have a “Severity” field with value >= 500:QOpcUaMonitoringParameters::EventFilter filter; filter << QOpcUaSimpleAttributeOperand("Message"); // Select clause of the filter QOpcUaContentFilterElement condition; condition << QOpcUaContentFilterElement::FilterOperator::GreaterThanOrEqual; condition << QOpcUaSimpleAttributeOperand("Severity"); condition << QOpcUaLiteralOperand(500, QOpcUa::Types::UInt16); filter << condition; // Where clause of the filter
For a more complex example with two conditions, see
QOpcUaElementOperand
.- __init__()¶
- __init__(rhs)
- Parameters:
rhs –
EventFilter
Constructs an event filter from
rhs
.- __lshift__(whereClauseElement)¶
- Parameters:
whereClauseElement –
QOpcUaContentFilterElement
- Return type:
Adds the content filter element
whereClauseElement
to the where clause of this event filter.- __lshift__(selectClauseElement)
- Parameters:
selectClauseElement –
QOpcUaSimpleAttributeOperand
- Return type:
Adds the simple attribute operand
selectClauseElement
to the select clause of this content filter element.- __eq__(rhs)¶
- Parameters:
rhs –
EventFilter
- Return type:
bool
Returns
true
if this event filter has the same value asrhs
.- selectClauses()¶
- Return type:
.list of QOpcUaSimpleAttributeOperand
Returns the selected event fields that shall be included when a new event is reported.
See also
- selectClausesRef()¶
- Return type:
.list of QOpcUaSimpleAttributeOperand
Returns a reference to the select clauses.
- setSelectClauses(selectClauses)¶
- Parameters:
selectClauses – .list of QOpcUaSimpleAttributeOperand
Sets the select clauses to
selectClauses
.See also
- setWhereClause(whereClause)¶
- Parameters:
whereClause – .list of QOpcUaContentFilterElement
Sets the where clause to
whereClause
.See also
- whereClause()¶
- Return type:
.list of QOpcUaContentFilterElement
Returns the content filter used to restrict the reported events to events matching certain criteria.
See also
- whereClauseRef()¶
- Return type:
.list of QOpcUaContentFilterElement
Returns a reference to the where clause.
See also
- class DataChangeFilter¶
Defines a
DataChangeFilter
for a monitored item. More_…Synopsis¶
Methods¶
def
__init__()
def
deadbandType()
def
deadbandValue()
def
__eq__()
def
setTrigger()
def
trigger()
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 to set up filtering for a DataChange monitored item. It is defined in OPC UA 1.05 part 4, 7.22.2.
- class DataChangeTrigger¶
Enumerates the possible triggers for a
DataChangeFilter
.Constant
Description
QOpcUaMonitoringParameters.DataChangeFilter.DataChangeTrigger.Status
Triggers if the value’s status code changes.
QOpcUaMonitoringParameters.DataChangeFilter.DataChangeTrigger.StatusOrValue
Triggers if the value’s status code or the value itself changes.
QOpcUaMonitoringParameters.DataChangeFilter.DataChangeTrigger.StatusOrValueOrTimestamp
Triggers if the value’s status code, the value itself or the source timestamp changes.
- class DeadbandType¶
Enumerates the possible deadband types for a
DataChangeFilter
.Constant
Description
QOpcUaMonitoringParameters.DataChangeFilter.DeadbandType.None
No deadband filtering.
QOpcUaMonitoringParameters.DataChangeFilter.DeadbandType.Absolute
A notification is generated if the absolute value of the difference between the last cached value and the current value is greater than the deadband value.
QOpcUaMonitoringParameters.DataChangeFilter.DeadbandType.Percent
Only valid for AnalogItems with an EURange property. A notification is generated if the absolute value of the difference between the last cached value and the current value is greater than value percent of the EURange.
- __init__()¶
Constructs a data change filter with trigger on
status
, deadband typenone
anddeadbandValue
0
.- __init__(rhs)
- Parameters:
rhs –
DataChangeFilter
Constructs a data change filter from
rhs
.- __init__(trigger, deadbandType, deadbandValue)
- Parameters:
trigger –
DataChangeTrigger
deadbandType –
DeadbandType
deadbandValue – float
Constructs a data change filter with trigger
trigger
, deadband typedeadbandType
and deadband valuedeadbandValue
.- deadbandType()¶
- Return type:
Returns the deadband type.
See also
- deadbandValue()¶
- Return type:
float
Returns the deadband value.
See also
- __eq__(rhs)¶
- Parameters:
rhs –
DataChangeFilter
- Return type:
bool
Returns
true
if this data change filter has the same value asrhs
.- setDeadbandType(deadbandType)¶
- Parameters:
deadbandType –
DeadbandType
Sets the deadband type to
deadbandType
.See also
- setDeadbandValue(deadbandValue)¶
- Parameters:
deadbandValue – float
Sets the deadband value to
deadbandValue
.See also
- setTrigger(trigger)¶
- Parameters:
trigger –
DataChangeTrigger
Sets the trigger to
trigger
.See also
- trigger()¶
- Return type:
Returns the trigger.
See also