QuickOPC User's Guide and Reference
AEConditionElementCollection Class
Members 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Namespace : AEConditionElementCollection Class
A collection of condition elements (AEConditionElement), keyed by their names.
Object Model
AEConditionElementCollection ClassAEConditionElement Class
Syntax
'Declaration
 
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection)>
<ComVisibleAttribute(True)>
<GuidAttribute("9562BDBC-D3AB-48A1-870E-E89F2DCBEBF0")>
<CLSCompliantAttribute(True)>
<TypeConverterAttribute(OpcLabs.BaseLib.Collections.ObjectModel.Implementation.KeyedCollection2TypeConverter)>
<DefaultMemberAttribute("Item")>
<DebuggerTypeProxyAttribute(System.Collections.Generic.Mscorlib_KeyedCollectionDebugView`2)>
<DebuggerDisplayAttribute("Count = {Count}")>
<SerializableAttribute()>
Public NotInheritable Class AEConditionElementCollection 
   Inherits OpcLabs.BaseLib.Collections.ObjectModel.KeyedCollection2(Of String,AEConditionElement)
   Implements OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection, System.Collections.Generic.ICollection(Of AEConditionElement), System.Collections.Generic.IEnumerable(Of AEConditionElement), System.Collections.Generic.IList(Of AEConditionElement), System.Collections.Generic.IReadOnlyCollection(Of AEConditionElement), System.Collections.Generic.IReadOnlyList(Of AEConditionElement), System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ICloneable 
'Usage
 
Dim instance As AEConditionElementCollection
[ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection)]
[ComVisible(true)]
[Guid("9562BDBC-D3AB-48A1-870E-E89F2DCBEBF0")]
[CLSCompliant(true)]
[TypeConverter(OpcLabs.BaseLib.Collections.ObjectModel.Implementation.KeyedCollection2TypeConverter)]
[DefaultMember("Item")]
[DebuggerTypeProxy(System.Collections.Generic.Mscorlib_KeyedCollectionDebugView`2)]
[DebuggerDisplay("Count = {Count}")]
[Serializable()]
public sealed class AEConditionElementCollection : OpcLabs.BaseLib.Collections.ObjectModel.KeyedCollection2<string,AEConditionElement>, OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection, System.Collections.Generic.ICollection<AEConditionElement>, System.Collections.Generic.IEnumerable<AEConditionElement>, System.Collections.Generic.IList<AEConditionElement>, System.Collections.Generic.IReadOnlyCollection<AEConditionElement>, System.Collections.Generic.IReadOnlyList<AEConditionElement>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ICloneable  
[ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection)]
[ComVisible(true)]
[Guid("9562BDBC-D3AB-48A1-870E-E89F2DCBEBF0")]
[CLSCompliant(true)]
[TypeConverter(OpcLabs.BaseLib.Collections.ObjectModel.Implementation.KeyedCollection2TypeConverter)]
[DefaultMember("Item")]
[DebuggerTypeProxy(System.Collections.Generic.Mscorlib_KeyedCollectionDebugView`2)]
[DebuggerDisplay("Count = {Count}")]
[Serializable()]
public ref class AEConditionElementCollection sealed : public OpcLabs.BaseLib.Collections.ObjectModel.KeyedCollection2<String,AEConditionElement>, OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes._AEConditionElementCollection, System.Collections.Generic.ICollection<AEConditionElement>, System.Collections.Generic.IEnumerable<AEConditionElement>, System.Collections.Generic.IList<AEConditionElement>, System.Collections.Generic.IReadOnlyCollection<AEConditionElement>, System.Collections.Generic.IReadOnlyList<AEConditionElement>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ICloneable  
Remarks
This collection is returned by the browsing methods.

 

The EasyAEClient.QueryCategoryConditions method finds out out event conditions supported by given event category.

 

The EasyAEClient.QuerySourceConditions method finds out event conditions associated with the given event source.

// This example shows how to enumerate all event conditions associated with the specified event source.

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

namespace DocExamples.AlarmsAndEvents._EasyAEClient
{
    class QuerySourceConditions 
    { 
        public static void Main1()
        {
            // Instantiate the client object.
            var client = new EasyAEClient();

            AEConditionElementCollection conditionElements;
            try
            {
                conditionElements = client.QuerySourceConditions("", "OPCLabs.KitEventServer.2", 
                    "Simulation.ConditionState1");
            }
            catch (OpcException opcException)
            {
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
                return;
            }

            foreach (AEConditionElement conditionElement in conditionElements)
            {
                Debug.Assert(conditionElement != null);
                Console.WriteLine("ConditionElements[\"{0}\"]: {1} subcondition(s)", 
                    conditionElement.Name, conditionElement.SubconditionNames.Length);
            }
        }
    } 
}
' This example shows how to enumerate all event conditions associated with the specified event source.

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

Namespace DocExamples.AlarmsAndEvents._EasyAEClient

    Friend Class QuerySourceConditions
        Public Shared Sub Main1()
            Dim client = New EasyAEClient()

            Dim conditionElements As AEConditionElementCollection
            Try
                conditionElements = client.QuerySourceConditions( _
                    "", "OPCLabs.KitEventServer.2", "Simulation.ConditionState1")
            Catch opcException As OpcException
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message)
                Exit Sub
            End Try

            For Each conditionElement As AEConditionElement In conditionElements
                Debug.Assert(conditionElement IsNot Nothing)
                Console.WriteLine("ConditionElements[""{0}""]: {1} subcondition(s)", _
                                  conditionElement.Name, conditionElement.SubconditionNames.Length)
            Next conditionElement
        End Sub
    End Class

End Namespace
Rem This example shows how to enumerate all event conditions associated with the specified event source.

Option Explicit

Dim ServerDescriptor: Set ServerDescriptor = CreateObject("OpcLabs.EasyOpc.ServerDescriptor")
ServerDescriptor.ServerClass = "OPCLabs.KitEventServer.2"

Dim SourceDescriptor: Set SourceDescriptor = CreateObject("OpcLabs.EasyOpc.AlarmsAndEvents.AENodeDescriptor")
SourceDescriptor.QualifiedName = "Simulation.ConditionState1"

Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.AlarmsAndEvents.EasyAEClient")
On Error Resume Next
Dim ConditionElements: Set ConditionElements = Client.QuerySourceConditions(ServerDescriptor, SourceDescriptor)
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0

Dim ConditionElement: For Each ConditionElement In ConditionElements
    WScript.Echo "ConditionElements(" & ConditionElement.Name & "): " & (UBound(ConditionElement.SubconditionNames) + 1) & " subcondition(s)"
Next

 

 

 

Inheritance Hierarchy

System.Object
   System.Collections.ObjectModel.Collection<T>
      System.Collections.ObjectModel.KeyedCollection<TKey,TItem>
            OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AEConditionElementCollection

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

AEConditionElementCollection Members
OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Namespace