QuickOPC User's Guide and Reference
AttributeId Property (AEAttributeElement)
Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Namespace > AEAttributeElement Class : AttributeId Property
Attribute ID.
Syntax
'Declaration
 
<DefaultValueAttribute(0)>
Public Property AttributeId As Long
'Usage
 
Dim instance As AEAttributeElement
Dim value As Long
 
instance.AttributeId = value
 
value = instance.AttributeId
[DefaultValue(0)]
public long AttributeId {get; set;}
[DefaultValue(0)]
public:
property int64 AttributeId {
   int64 get();
   void set (    int64 value);
}
Remarks

Event attributes are vendor-specific and are associated with the event category and available from the server. Their attribute IDs can be used in the event subscription to specify the information to be returned with an event notification.

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

using System;
using System.Diagnostics;
using OpcLabs.EasyOpc.AlarmsAndEvents;
using OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace;
using OpcLabs.EasyOpc.OperationModel;

namespace DocExamples.AlarmsAndEvents._AEAttributeElement
{
    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 != null);

                Console.WriteLine("Category {0}:", categoryElement);
                foreach (AEAttributeElement attributeElement in categoryElement.AttributeElements)
                {
                    Debug.Assert(attributeElement != null);

                    Console.WriteLine("    Information about attribute {0}:", attributeElement);
                    Console.WriteLine("        .AttributeId: {0}", attributeElement.AttributeId);
                    Console.WriteLine("        .Description: {0}", attributeElement.Description);
                    Console.WriteLine("        .DataType: {0}", attributeElement.DataType);
                }
            }
        }
    }
}
' This example shows information available about OPC event attribute.

Imports OpcLabs.EasyOpc.AlarmsAndEvents
Imports OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace
Imports OpcLabs.EasyOpc.OperationModel

Namespace DocExamples.AlarmsAndEvents._AEAttributeElement

    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("Category {0}:", categoryElement)
                For Each attributeElement As AEAttributeElement In categoryElement.AttributeElements
                    Debug.Assert(attributeElement IsNot Nothing)

                    Console.WriteLine("    Information about attribute {0}:", attributeElement)
                    Console.WriteLine("        .AttributeId: {0}", attributeElement.AttributeId)
                    Console.WriteLine("        .Description: {0}", attributeElement.Description)
                    Console.WriteLine("        .DataType: {0}", attributeElement.DataType)
                Next attributeElement
            Next categoryElement
        End Sub
    End Class

End Namespace
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

AEAttributeElement Class
AEAttributeElement Members