Hi,
I am trying to filter on category IDs. I have successfully filtered based on Areas/Source, but for some reason, I cannot get the Category filter to work.
Example code looks something like this:
Dim EasyAEClient As New OpcLabs.EasyOpc.AlarmsAndEvents.EasyAEClient
Dim myState As OpcLabs.EasyOpc.AlarmsAndEvents.AEConditionState
Dim myFilter As OpcLabs.EasyOpc.AlarmsAndEvents.AESubscriptionFilter
Dim myAttributesForSelectedCategories As OpcLabs.EasyOpc.AlarmsAndEvents.AEAttributeSetDictionary
Dim myFilterCategories() As Long = Nothing
Dim MyHandle As Integer
myState = New OpcLabs.EasyOpc.AlarmsAndEvents.AEConditionState
myFilter = EasyAEClient.CreateSubscriptionFilter
myAttributesForSelectedCategories = New OpcLabs.EasyOpc.AlarmsAndEvents.AEAttributeSetDictionary
myAttributesForSelectedCategories = ... doing some stuff to fill that variable
myFilterCategories = {1, 2, 3}
myFilter.Categories = myFilterCategories
''myFilter.Sources = {"computer.clock.timer"} ... works fine if I use this instead of setting myFilter.Categories
AddHandler EasyAEClient.Notification, AddressOf EasyAEClient_Notification
MyHandle = EasyAEClient.SubscribeEvents(“physicalServerName”, “OPCAEServerName”, 1000, myState, myFilter, myAttributesForSelectedCategories)
Private Sub EasyAEClient_Notification(ByVal sender As Object, ByVal e As OpcLabs.EasyOpc.AlarmsAndEvents.EasyAENotificationEventArgs)
''This is where e.Exception has the value “{[12585986] *** System.ArgumentException: The parameter is incorrect. }“
End Sub
I have also tried using QueryEventCategories to get the available categories and add them all to a long array in order to pass them in to the filter. If I do this, the EasyAENotificationEventArgs.Exception property contains “{[12585986] *** System.ArgumentException: The parameter is incorrect. }“ whenever I get a notification of an event as well. I do not run into this issue with Areas or Sources. Is there something I am missing? How can the filter effect the events notification in such a way that it has invalid parameters?
Using version 5.2 with VB.NET and have tried with several different servers ( Softing, Matrikon, the OPCLabs.KitEventServer)
Any ideas on what I am missing?