OPCAE.NET Reference Manual
SetFilter Method
See Also  Send Feedback
OPCAE.NET Namespace > EventSubscriptionMgt Class : SetFilter Method

EventType
A bit mask specifying which event types are of interest; OPC_SIMPLE_EVENT, OPC_CONDITION_EVENT, OPC_TRACKING_EVENT, OPC_ALL_EVENTS. These types can be OR’ed together to filter multiple types. A value of 0 is an error and E_INVALIDARG will be returned.
EventCategories
Array of event categories of interest. These are DWORD event category codes returned by QueryEventCategories. A pointer to a NULL DWORD must be passed if dwNumCategories is 0.
LowSeverity
Lowest severity of interest (inclusive). The severity range is 1 .. 1000.
HighSeverity
Highest severity of interest (inclusive). The severity range is 1 .. 1000.
AreaList
Array of process area strings of interest - only events or conditions in these areas will be reported. Area strings can be obtained using GetQualifiedAreaName. It is possible to specify areas using the wildcard syntax. Servers must support the wildcard syntax described in OPC AE specs Appendix A.
SourceList
Array of event sources of interest - only events from these sources will be reported. It is possible to specify sources using the wildcard syntax. Servers must support the wildcard syntax described in OPC AE specs Appendix A.

Glossary Item Box

Sets the filtering criteria to be used for the event subscription. Events may be selected using the following criteria:
• Type of event, i.e. simple, condition, or tracking.
• Event categories
• Lowest severity, i.e. all events with a severity greater than or equal to the specified severity.
• Highest severity, i.e. all events with a severity less than or equal to the specified severity.
• Process areas
• Event Sources
A list of values for a single criterion are logically ORed together (e.g. if two event categories arespecified, event notifications for both categories will be received). If multiple criteria are specified, they will be logically ANDed together, i.e. only those events satisfying all criteria will be selected. An example is specifying both lowest severity and highest severity will result in the selection of events with severities lying between the two values.
An OPCEventSubscription object has only one filter.

Syntax

Visual Basic (Declaration) 
Public Function SetFilter( _
   ByVal EventType As Integer, _
   ByVal EventCategories() As Integer, _
   ByVal LowSeverity As Integer, _
   ByVal HighSeverity As Integer, _
   ByVal AreaList() As String, _
   ByVal SourceList() As String _
) As Integer

Parameters

EventType
A bit mask specifying which event types are of interest; OPC_SIMPLE_EVENT, OPC_CONDITION_EVENT, OPC_TRACKING_EVENT, OPC_ALL_EVENTS. These types can be OR’ed together to filter multiple types. A value of 0 is an error and E_INVALIDARG will be returned.
EventCategories
Array of event categories of interest. These are DWORD event category codes returned by QueryEventCategories. A pointer to a NULL DWORD must be passed if dwNumCategories is 0.
LowSeverity
Lowest severity of interest (inclusive). The severity range is 1 .. 1000.
HighSeverity
Highest severity of interest (inclusive). The severity range is 1 .. 1000.
AreaList
Array of process area strings of interest - only events or conditions in these areas will be reported. Area strings can be obtained using GetQualifiedAreaName. It is possible to specify areas using the wildcard syntax. Servers must support the wildcard syntax described in OPC AE specs Appendix A.
SourceList
Array of event sources of interest - only events from these sources will be reported. It is possible to specify sources using the wildcard syntax. Servers must support the wildcard syntax described in OPC AE specs Appendix A.

Return Value

HRESULTS error/success code.

Requirements

Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2016, .NET 4.x

See Also

© 2002-2018 Advosol Inc. All Rights Reserved.