![](dotnetdiagramimages/OpcLabs_EasyOpcClassicCore_OpcLabs_EasyOpc_AlarmsAndEvents_AddressSpace_AECategoryElement.png)
'Declaration
<CLSCompliantAttribute(True)> <ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement)> <ComVisibleAttribute(True)> <GuidAttribute("98A139C6-0F0F-428B-A40D-8C3F503B4651")> <TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)> <ValueControlAttribute("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.81.455.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", DefaultReadWrite=False, Export=True, PageId=10001)> <SerializableAttribute()> Public NotInheritable Class AECategoryElement Inherits OpcLabs.BaseLib.Info Implements LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
'Usage
Dim instance As AECategoryElement
[CLSCompliant(true)] [ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement)] [ComVisible(true)] [Guid("98A139C6-0F0F-428B-A40D-8C3F503B4651")] [TypeConverter(System.ComponentModel.ExpandableObjectConverter)] [ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.81.455.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", DefaultReadWrite=false, Export=true, PageId=10001)] [Serializable()] public sealed class AECategoryElement : OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
[CLSCompliant(true)] [ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement)] [ComVisible(true)] [Guid("98A139C6-0F0F-428B-A40D-8C3F503B4651")] [TypeConverter(System.ComponentModel.ExpandableObjectConverter)] [ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.81.455.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", DefaultReadWrite=false, Export=true, PageId=10001)] [Serializable()] public ref class AECategoryElement sealed : public OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AECategoryElement, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
This object is filled in and returned e.g. when you query for OPC event categories.
Each OPC Alarms and Events server supports a set of specific event categories. The OPC specifications define a set of recommended categories; however, each OPC server is free to implement some more, vendor-specific event categories as well.
If you want to retrieve a list of all categories available in a given OPC server, call the QueryEventCategories method. You will receive back an AECategoryElementCollection object.
Each AECategoryElement contains information about one OPC event category, such as its (numeric) CategoryId, readable description, and associated event conditions and attributes. The CategoryId can be later used when creating an event filter, and is provided to you in event notifications.
// This example shows information available about OPC event category. // // Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . // OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp . // Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own // a commercial license in order to use Online Forums, and we reply to every post. using System; using System.Diagnostics; using OpcLabs.EasyOpc.AlarmsAndEvents; using OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace; using OpcLabs.EasyOpc.OperationModel; namespace DocExamples.AlarmsAndEvents._AECategoryElement { class Properties { public static void Main1() { // Instantiate the client object. var client = new EasyAEClient(); AECategoryElementCollection categoryElements; try { categoryElements = client.QueryEventCategories("", "OPCLabs.KitEventServer.2"); } catch (OpcException opcException) { Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message); return; } foreach (AECategoryElement categoryElement in categoryElements) { Debug.Assert(!(categoryElement is null)); Console.WriteLine("Information about category {0}:", categoryElement); Console.WriteLine(" .CategoryId: {0}", categoryElement.CategoryId); Console.WriteLine(" .Description: {0}", categoryElement.Description); Console.WriteLine(" .ConditionElements:"); if (!(categoryElement.ConditionElements.Keys is null)) foreach (string conditionKey in categoryElement.ConditionElements.Keys) Console.WriteLine(" {0}", conditionKey); Console.WriteLine(" .AttributeElements:"); if (!(categoryElement.AttributeElements.Keys is null)) foreach (long attributeKey in categoryElement.AttributeElements.Keys) Console.WriteLine(" {0}", attributeKey); } } } }
' This example shows information available about OPC event category. ' ' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . ' OPC client and subscriber examples in VB.NET on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBNET . ' Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own ' a commercial license in order to use Online Forums, and we reply to every post. Imports OpcLabs.EasyOpc.AlarmsAndEvents Imports OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Imports OpcLabs.EasyOpc.OperationModel Namespace AlarmsAndEvents._AECategoryElement Friend Class Properties Public Shared Sub Main1() Dim client = New EasyAEClient() Dim categoryElements As AECategoryElementCollection Try categoryElements = client.QueryEventCategories("", "OPCLabs.KitEventServer.2") Catch opcException As OpcException Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message) Exit Sub End Try For Each categoryElement As AECategoryElement In categoryElements Debug.Assert(categoryElement IsNot Nothing) Console.WriteLine("Information about category {0}:", categoryElement) Console.WriteLine(" .CategoryId: {0}", categoryElement.CategoryId) Console.WriteLine(" .Description: {0}", categoryElement.Description) Console.WriteLine(" .ConditionElements:") If categoryElement.ConditionElements.Keys IsNot Nothing Then For Each conditionKey As String In categoryElement.ConditionElements.Keys Console.WriteLine(" {0}", conditionKey) Next conditionKey End If Console.WriteLine(" .AttributeElements:") If categoryElement.AttributeElements.Keys IsNot Nothing Then For Each attributeKey As Long In categoryElement.AttributeElements.Keys Console.WriteLine(" {0}", attributeKey) Next attributeKey End If Next categoryElement End Sub End Class End Namespace
# This example shows information available about OPC event category. # # Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . # OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python . # Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own # a commercial license in order to use Online Forums, and we reply to every post. # The QuickOPC package is needed. Install it using "pip install opclabs_quickopc". import opclabs_quickopc # Import .NET namespaces. from OpcLabs.EasyOpc.AlarmsAndEvents import * from OpcLabs.EasyOpc.OperationModel import * # Instantiate the client object. client = EasyAEClient() try: categoryElements = IEasyAEClientExtension.QueryEventCategories(client, '', 'OPCLabs.KitEventServer.2') except OpcException as opcException: print('*** Failure: ' + opcException.GetBaseException().Message, sep='') exit() # Display results for categoryElement in categoryElements: assert categoryElement is not None print('Information about category ', categoryElement, sep='') print(' .CategoryId: ', categoryElement.CategoryId, sep='') print(' .Description: ', categoryElement.Description, sep='') print(' .ConditionElements:') if categoryElement.ConditionElements.Keys is not None: for conditionKey in categoryElement.ConditionElements.Keys: print(' ', conditionKey, sep='') print(' .AttributeElements:') if categoryElement.AttributeElements.Keys is not None: for attributeKey in categoryElement.AttributeElements.Keys: print(' ', attributeKey, sep='')
System.Object
OpcLabs.BaseLib.Object2
OpcLabs.BaseLib.Info
OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AECategoryElement