QuickOPC User's Guide and Reference
UAEventFilter Class
Members 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace : UAEventFilter Class
Defines the conditions under which an event notification should be reported.
Object Model
UAEventFilter ClassUAEventFilter ClassUAAttributeFieldCollection ClassUAAttributeField ClassUAAttributeFieldCollection ClassUAAttributeField ClassUAContentFilterElement Class
Syntax
'Declaration
 
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter)>
<ComVisibleAttribute(True)>
<GuidAttribute("BEF1C056-D153-4049-B3D5-2FD57E3049EC")>
<TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
<CLSCompliantAttribute(True)>
<ValueControlAttribute("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=False, 
   Export=True, 
   PageId=10001)>
<SerializableAttribute()>
Public NotInheritable Class UAEventFilter 
   Inherits OpcLabs.BaseLib.Parameters
   Implements LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.BaseLib.ComTypes._Parameters, OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter, System.ComponentModel.INotifyPropertyChanged, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable 
'Usage
 
Dim instance As UAEventFilter
[ComDefaultInterface(OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter)]
[ComVisible(true)]
[Guid("BEF1C056-D153-4049-B3D5-2FD57E3049EC")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public sealed class UAEventFilter : OpcLabs.BaseLib.Parameters, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.BaseLib.ComTypes._Parameters, OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter, System.ComponentModel.INotifyPropertyChanged, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
[ComDefaultInterface(OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter)]
[ComVisible(true)]
[Guid("BEF1C056-D153-4049-B3D5-2FD57E3049EC")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public ref class UAEventFilter sealed : public OpcLabs.BaseLib.Parameters, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.BaseLib.ComTypes._Parameters, OpcLabs.EasyOpc.UA.ComTypes._UAEventFilter, System.ComponentModel.INotifyPropertyChanged, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
Remarks

EventFilter:
"The EventFilter provides for the filtering and content selection of Event Subscriptions. If an Event Notification conforms to the filter defined by the where parameter of the EventFilter, then the Notification is sent to the Client. Each Event Notification shall include the fields defined by the selectClauses parameter of the EventFilter."

In order to obtain or modify these parameters, access the UAMonitoringParameters.EventFilter property of OpcLabs.EasyOpc.UA.OperationModel.UAMonitoredItemArguments.MonitoringParameters.

 

The UAEventFilter object (used for specifying the event filters) is probably the most complicated part of the OPC UA Alarms & Condition features. It has two main parts: Select clauses (contained in the SelectClauses property, of UAAttributeFieldCollection type), and a Where clause (contained in the WhereClause property, of UAContentFilterElement type). The Select clauses contain a collection of the attribute fields to return with each event in a notification. The Where clause contains the criteria limiting the notifications.

In order to make the creation of some event filters appear shorter in the code, a UAEventFilterBuilder class is provided. Instances of this builder can be implicitly converted to the event filter itself (hence you can create just the UAEventFilterBuilder objects, and use them at all places where the UAEventFilter object is expected). The builder contains a Where clause, and is a collection of Select clauses. You can therefore use the C# collection initializer to specify the Select clauses.

In COM (tools like VB6, Delphi etc.), creation of OPC UA Event Filters requires longer code. For related information, see http://kb.opclabs.com/Creating_an_OPC_UA_event_filter_in_COM .

 

Example

 

Inheritance Hierarchy

System.Object
   OpcLabs.BaseLib.Object2
      OpcLabs.BaseLib.Info
         OpcLabs.BaseLib.Parameters
            OpcLabs.EasyOpc.UA.UAEventFilter

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also