Difference between revisions of "Creating an OPC UA event filter in COM"

From OPC Labs Knowledge Base
Jump to navigation Jump to search
(Created page with "Category:COM Category:Free Pascal Category:Lazarus Category:OPC UA Category:OPC UA Alarms & Conditions QuickOPC provides many useful "shortcuts" for crea...")
 
Line 2: Line 2:
  
 
QuickOPC provides many useful "shortcuts" for creating OPC UA event filters on the .NET platform. It is also possible to create OPC UA event filters on the [[:Category:COM|COM]] platform, but due to the missing "goodies", the resulting code is longer. This article describes how to create OPC UA event filters on the COM platform, explains the traps and pitfalls, and provides an example. The example happens to be written in [[:Category:Free Pascal|Free Pascal]] ([[:Category:Lazarus|Lazarus]]), but the same operations will have to be performed in other COM-based tool or language.
 
QuickOPC provides many useful "shortcuts" for creating OPC UA event filters on the .NET platform. It is also possible to create OPC UA event filters on the [[:Category:COM|COM]] platform, but due to the missing "goodies", the resulting code is longer. This article describes how to create OPC UA event filters on the COM platform, explains the traps and pitfalls, and provides an example. The example happens to be written in [[:Category:Free Pascal|Free Pascal]] ([[:Category:Lazarus|Lazarus]]), but the same operations will have to be performed in other COM-based tool or language.
 +
 +
The parts that have to be expressed on the COM platform verbatim, as opposed to the .NET, are primarily:
 +
 +
* '''IEasyUAClient.SubscribeEvent''' overloads with various combinations of arguments are missing. Only an overload with no event filter exists under COM. Anything more complicated needs to go through '''IEasyUAClient.SubscribeMultipleMonitoredItems''', passing in an array of '''EasyUAMonitoredItemArguments'''.
 +
* Overloaded (or any parameterized) constructors of '''EasyUAMonitoredItemArguments''' are not available under COM, and the parameters inside this objects need to be set one by one.
 +
* There is no '''UAEventFilterBuilder''' in COM, and the tree for the Where clause needs to be constructed using '''UAContentFilterElement''' and various operators and operands.
  
 
Note: This article has been written for/with in-the-works QuickOPC version 2016.2 (5.41), but it should apply equally to the current version 5.40.
 
Note: This article has been written for/with in-the-works QuickOPC version 2016.2 (5.41), but it should apply equally to the current version 5.40.

Revision as of 11:58, 27 September 2016


QuickOPC provides many useful "shortcuts" for creating OPC UA event filters on the .NET platform. It is also possible to create OPC UA event filters on the COM platform, but due to the missing "goodies", the resulting code is longer. This article describes how to create OPC UA event filters on the COM platform, explains the traps and pitfalls, and provides an example. The example happens to be written in Free Pascal (Lazarus), but the same operations will have to be performed in other COM-based tool or language.

The parts that have to be expressed on the COM platform verbatim, as opposed to the .NET, are primarily:

  • IEasyUAClient.SubscribeEvent overloads with various combinations of arguments are missing. Only an overload with no event filter exists under COM. Anything more complicated needs to go through IEasyUAClient.SubscribeMultipleMonitoredItems, passing in an array of EasyUAMonitoredItemArguments.
  • Overloaded (or any parameterized) constructors of EasyUAMonitoredItemArguments are not available under COM, and the parameters inside this objects need to be set one by one.
  • There is no UAEventFilterBuilder in COM, and the tree for the Where clause needs to be constructed using UAContentFilterElement and various operators and operands.

Note: This article has been written for/with in-the-works QuickOPC version 2016.2 (5.41), but it should apply equally to the current version 5.40.