// 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.
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc
# Import .NET namespaces.
from OpcLabs.EasyOpc import *
from OpcLabs.EasyOpc.AlarmsAndEvents import *
from OpcLabs.EasyOpc.OperationModel import *
# Instantiate the client object.
client = EasyAEClient()
# Perform the operation.
try:
conditionElements = IEasyAEClientExtension.QuerySourceConditions(client, '', 'OPCLabs.KitEventServer.2',
AENodeDescriptor('Simulation.ConditionState1'))
except OpcException as opcException:
print('*** Failure: ' + opcException.GetBaseException().Message)
exit()
# Display results.
for conditionElement in conditionElements:
assert conditionElement is not None
print('ConditionElements[', conditionElement.Name, ']: ',
conditionElement.SubconditionNames.Length, ' subcondition(s)',
sep='')
print()
print('Finished.')
' 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 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