QuickOPC User's Guide and Reference
AttributeElements Property (AECategoryElement)
Example 



View with Navigation Tools
OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Namespace > AECategoryElement Class : AttributeElements Property
Event attributes that the server can provide as part of an event notification within this event category.
Syntax
'Declaration
 
<DisplayAttribute(AutoGenerateField=False, 
   Order=3, 
   ShortName="Attribute Elements")>
Public Property AttributeElements As AEAttributeElementCollection
 
'Usage
 
Dim instance As AECategoryElement
Dim value As AEAttributeElementCollection
 
instance.AttributeElements = value
 
value = instance.AttributeElements
Remarks

Simple servers may not support any vendor-specific attributes for some or even all event categories.

This is a keyed collection where the key is attribute ID, and the value is an AEAttributeElement.

Example
// This example shows information available about OPC event category.

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);
            }
        }
    } 
}
Requirements

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

See Also

Reference

AECategoryElement Class
AECategoryElement Members