The CreateMonitoredItem Serviceallows specifying a filter for each MonitoredItem. The MonitoringFilteris an extensible parameter whose structure depends on the type of item being monitored. The parameterTypeIdsare defined in Table 145. Other types can be defined by additional parts of this multi-part specification or other specifications based on OPC UA. The ExtensibleParametertype is defined in 7.17.

Each MonitoringFiltermay have an associated MonitoringFilterResult structure which returns revised parameters and/or error information to Clientsin the response. The result structures, when they exist, are described in the section that defines the MonitoringFilter.

Table 145– MonitoringFilter parameterTypeIds

Symbolic Id

Description

DataChangeFilter

The change in a data value that shall cause a Notificationto be generated.

EventFilter

If a Notificationconforms to the EventFilter, the Notificationis sent to the Client.

AggregateFilter

The Aggregateand its intervals when it will be calculated and a Notification is generated.

The DataChangeFilterdefines the conditions under which a DataChange Notificationshould be reported and, optionally, a range or band for value changes where no DataChange Notificationis generated. This range is called Deadband. The DataChangeFilteris defined in Table 146.

Table 146– DataChangeFilter

Name

Type

Description

DataChangeFilter

structure

trigger

Enum

DataChangeTrigger

Specifies the conditions under which a data change notification should be reported. The DataChangeTriggerenumeration is defined in 7.10.

If the DataChangeFilter is not applied to the monitored item, STATUS_VALUEis the default reporting behaviour.

deadbandType

UInt32

A value that defines the Deadbandtype and behaviour.

ValueNameDescription

0 NoneNo Deadbandcalculation should be applied.

1 AbsoluteAbsoluteDeadband (see below)

2 PercentPercentDeadband (This type is specified in OPC 10000-8).

deadbandValue

Double

The Deadbandis applied only if* the triggerincludes value changes and* the deadbandTypeis set appropriately.

Deadband is ignored if the status of the data item changes.

DeadbandType = AbsoluteDeadband:

For this type the deadbandValuecontains the absolute change in a data value that shall cause a Notificationto be generated. This parameter applies only to Variables with any Numberdata type.

An exception that causes a DataChange Notificationbased on an AbsoluteDeadbandis determined as follows:

Generate a Notification if (absolute value of (last cached value - current value) > AbsoluteDeadband)

The last cached value is defined as the last value pushed to the queue.

If the item is an array of values, the entire array is returned if any array element exceeds the AbsoluteDeadband, or the size or dimension of the array changes.

DeadbandType = PercentDeadband:

This type is specified in OPC 10000-8

The DataChangeFilter does not have an associated result structure.

The EventFilterprovides for the filtering and content selection of Event Subscriptions.

If an Event Notificationconforms to the filter defined by the whereparameter of the EventFilter, then the Notificationis sent to the Client.

Each Event Notificationshall include the fields defined by the selectClausesparameter of the EventFilter. The defined EventTypes are specified in OPC 10000-5.

The selectClausesand whereClauseparameters are specified with the SimpleAttributeOperandstructure (see 7.7.4.5). This structure requires the NodeIdof an EventTypesupported by the Serverand a path to an InstanceDeclaration. An InstanceDeclarationis a Nodewhich can be found by following forward hierarchical references from the fully inherited EventTypewhere the Nodeis also the source of a HasModellingRulereference. EventTypes, InstanceDeclarationsand Modelling Rulesare described completely in OPC 10000-3.

In some cases the same SimpleAttributeOperand.browsePathwill apply to multiple EventTypes. If the Clientspecifies the BaseEventTypein the SimpleAttributeOperand.typeDefinitionIdthen the Servershall evaluate the SimpleAttributeOperand.browsePathwithout considering the SimpleAttributeOperand.typeDefinitionId.

Each InstanceDeclarationin the path shall be Objector Variable Node. The final Nodein the path may be an Object Node; however, Object Nodesare only available for Eventswhich are visible in the Server’s AddressSpace.

The SimpleAttributeOperand structure allows the Clientto specify any Attribute; however, the Serveris only required to support the Value Attributefor Variable Nodesand the NodeId Attributefor Object Nodes. That said, profiles defined in OPC 10000-7may make support for additional Attributesmandatory.

The SimpleAttributeOperand structure is used in the selectClausesto select the value to return if an Eventmeets the criteria specified by the whereClause. A null value is returned in the corresponding event field in the Publish response if the selected fieldis not part of the Event or an error was returned in the selectClauseResultsof the EventFilterResult. If the selected fieldis supported but not available at the time of the event notification, the event field shall contain a StatusCodethat indicates the reason for the unavailability. For example, the Servershall set the event field to Bad_UserAccessDeniedif the value is not accessible to the user associated with the Session. If a Value Attributehas an uncertain or bad StatusCodeassociated with it then the Servershall provide the StatusCodeinstead of the Value Attribute. The Servershall set the event field to Bad_EncodingLimitsExceededif a value exceeds the maxResponseMessageSize. The EventId, EventTypeand ReceiveTimecannot contain a StatusCodeor a null value.

The Servershall validate the selectClauseswhen a Clientcreates or updates the EventFilter. Any errors which are true for all possible Eventsare returned in the selectClauseResultsparameter described in Table 148. Some Servers, like aggregating Servers, may not know all possible EventTypesat the time the EventFilteris set. These Serversdo not return errors for unknown EventTypesor BrowsePaths. The Servershall not report errors that might occur depending on the state or the Serveror type of Event. For example, a selectClausesthat requests a single element in an array would always produce an error if the DataTypeof the Attributeis a scalar. However, even if the DataTypeis an array an error could occur if the requested index does not exist for a particular Event, the Serverwould not report an error in the selectClauseResultsparameter if the latter situation existed.

The SimpleAttributeOperand is used in the whereClauseto select a value which forms part of a logical expression. These logical expressions are then used to determine whether a particular Eventshould be reported to the Client. The Servershall use a null value if any error occurs when a whereClauseis evaluated for a particular Event. If a Value Attributehas an uncertain or bad StatusCodeassociated with it, then the Servershall use a null value instead of the Value.

Any basic FilterOperatorin Table 122may be used in the whereClause, however, only the OfType FilterOperatorfrom Table 123is permitted.

The Servershall validate the whereClausewhen a Clientcreates or updates the EventFilter. Any structural errors in the construction of the filter and any errors which are true for all possible Eventsare returned in the whereClauseResultparameter described in Table 148. Errors that could occur depending on the state of the Serveror the Eventare not reported. Some Servers, like aggregating Servers, may not know all possible EventTypesat the time the EventFilteris set. These Serversdo not return errors for unknown EventTypesor BrowsePaths.

EventQueueOverflowEventType Eventsare special Eventswhich are used to provide control information to the Client. These Eventsare only published to the MonitoredItemsin the Subscriptionthat produced the EventQueueOverflowEventType Event. These Eventsbypass the whereClause.

Table 147defines the EventFilter structure.

Table 147– EventFilter structure

Name

Type

Description

EventFilter

structure

selectClauses []

SimpleAttribute

Operand

List of the values to return with each Eventin a Notification. At least one valid clause shall be specified. See 7.7.4.5for the definition of SimpleAttributeOperand.

whereClause

ContentFilter

Limit the Notificationsto those Eventsthat match the criteria defined by this ContentFilter. The ContentFilter structure is described in 7.7.

The AttributeOperandstructure may not be used in an EventFilter.

Table 148defines the EventFilterResult structure. This is the MonitoringFilterResult associated with the EventFilter MonitoringFilter.

Table 148– EventFilterResult structure

Name

Type

Description

EventFilterResult

structure

selectClauseResults []

StatusCode

List of status codes for the elements in the select clause. The size and order of the list matches the size and order of the elements in the selectClausesrequest parameter. The Serverreturns null for unavailable or rejected Eventfields.

selectClauseDiagnosticInfos []

DiagnosticInfo

A list of diagnostic information for individual elements in the select clause. The size and order of the list matches the size and order of the elements in the selectClausesrequest parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the select clauses.

whereClauseResult

ContentFilter

Result

Any results associated with the whereClauserequest parameter.

The ContentFilterResulttype is defined in 7.7.2.

Table 149defines values for the selectClauseResults parameter. Common StatusCodesare defined in Table 183.

Table 149– EventFilterResult Result Codes

Symbolic Id

Description

Bad_TypeDefinitionInvalid

See Table 183for the description of this result code.

The typeId is not the NodeId for BaseEventType or a subtype of it.

Bad_NodeIdUnknown

See Table 183for the description of this result code.

The browsePath is specified but it will never exist in any Event.

Bad_BrowseNameInvalid

See Table 183for the description of this result code.

The browsePath is specified and contains a null element.

Bad_AttributeIdInvalid

See Table 183for the description of this result code.

The node specified by the browse path will never allow the given AttributeIdto be returned.

Bad_IndexRangeInvalid

See Table 183for the description of this result code.

Bad_TypeMismatch

See Table 183for the description of this result code.

The indexRange is valid but the value of the Attribute is never an array.

The AggregateFilterdefines the Aggregatefunction that should be used to calculate the values to be returned. See OPC 10000-13for details on possible Aggregatefunctions. It specifies a startTime of the first Aggregateto be calculated. The samplingIntervalof the MonitoringParameters(see 7.21) defines how the Servershould internally sample the underlying data source. The processingInterval specifies the size of a time-period where the Aggregateis calculated. The queueSize from the MonitoringAttributes specifies the number of processed values that should be kept.

The intention of the AggregateFilteris not to read historical data, the HistoryRead service should be used for this purpose. However, it is allowed that the startTime is set to a time that is in the past when received from the Server. The number of Aggregatesto be calculated in the past should not exceed the queueSize defined in the MonitoringAttributes since the values exceeding the queueSize would directly be discharged and never returned to the Client.

The startTime and the processingInterval can be revised by the Server, but the startTime should remain in the same boundary (startTime + revisedProcessingInterval * n = revisedStartTime). That behaviour simplifies accessing historical values of the Aggregatesusing the same boundaries by calling the HistoryRead service. The extensible Parameter AggregateFilterResult is used to return the revised values for the AggregateFilter.

Some underlying systems may poll data and produce multiple samples with the same value. Other systems may only report changes to the values. The definition for each Aggregatetype explains how to handle the two different scenarios.

The MonitoredItemonly reports values for intervals that have completed when the publish timer expires. Unused data is carried over and used to calculate a value returned in the next publish.

The ServerTimestampfor each interval shall be the time of the end of the processing interval.

The AggregateFilteris defined in Table 150.

Table 150– AggregateFilter structure

Name

Type

Description

AggregateFilter

structure

startTime

UtcTime

Beginning of period to calculate the Aggregatethe first time. The size of each period used to calculate the Aggregateis defined by the samplingInterval of the MonitoringParameters(see 7.21).

aggregateType

NodeId

The NodeId of the AggregateFunctionType Objectthat indicates the Aggregateto be used when retrieving processed data. See OPC 10000-13for details.

processingInterval

Duration

The period be used to compute the Aggregate.

aggregateConfiguration

Aggregate

Configuration

This parameter allows Clientsto override the Aggregateconfiguration settings supplied by the AggregateConfiguration Objecton a per monitored item basis. See OPC 10000-13for more information on Aggregateconfigurations. If the Serverdoes not support the ability to override the Aggregateconfiguration settings it shall return a StatusCodeof Bad_AggregateListMismatch. This structure is defined in-line with the following indented items.

useServerCapabilities

Defaults

Boolean

If value = TRUE use Aggregate configuration settings as outlined by the AggregateConfiguration object.

If value=FALSE use configuration settings as outlined in the following aggregateConfiguration parameters.

Default is TRUE.

treatUncertainAsBad

Boolean

As described in OPC 10000-13.

percentDataBad

Byte

As described in OPC 10000-13.

percentDataGood

Byte

As described in OPC 10000-13.

useSloped

Extrapolation

Boolean

As described in OPC 10000-13.

The AggregateFilterResultdefines the revised AggregateFilterthe Servercan return when an AggregateFilteris defined for a MonitoredItemin the CreateMonitoredItemsor ModifyMonitoredItems Services. The AggregateFilterResultis defined in Table 151. This is the MonitoringFilterResult associated with the AggregateFilter MonitoringFilter.

Table 151– AggregateFilterResult structure

Name

Type

Description

AggregateFilterResult

structure

revisedStartTime

UtcTime

The actual StartTime interval that the Servershall use.

This value is based on a number of factors, including capabilities of the Serverto access historical data. The revisedStartTime should remain in the same boundary as the startTime (startTime + samplingInterval * n = revisedStartTime).

revisedProcessingInterval

Duration

The actual processingInterval that the Servershall use.

The revisedProcessingInterval shall be at least twice the revisedSamplingInterval for the MonitoredItem.

revisedAggregateConfiguration

Aggregate

Configuration

The actual aggregateConfiguration that the Servershall use.

The structure is defined in Table 150.