// This example shows how to obtain current state information for the condition instance corresponding to a Source and
// certain ConditionName.
using System;
using OpcLabs.EasyOpc.AlarmsAndEvents;
using OpcLabs.EasyOpc.OperationModel;
namespace DocExamples.AlarmsAndEvents._EasyAEClient
{
class GetConditionState
{
public static void Main1()
{
// Instantiate the client object.
var client = new EasyAEClient();
AEConditionState conditionState;
try
{
conditionState = client.GetConditionState("", "OPCLabs.KitEventServer.2",
"Simulation.ConditionState1", "Simulated");
}
catch (OpcException opcException)
{
Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
return;
}
Console.WriteLine("ConditionState:");
Console.WriteLine(" .ActiveSubcondition: {0}", conditionState.ActiveSubcondition);
Console.WriteLine(" .Enabled: {0}", conditionState.Enabled);
Console.WriteLine(" .Active: {0}", conditionState.Active);
Console.WriteLine(" .Acknowledged: {0}", conditionState.Acknowledged);
Console.WriteLine(" .Quality: {0}", conditionState.Quality);
// Remark: IAEConditionState has many more properties
}
}
}
# This example shows how to obtain current state information for the condition instance corresponding to a Source and
# certain ConditionName.
# 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()
print('Getting condition state...')
try:
conditionState = IEasyAEClientExtension.GetConditionState(client,
'', 'OPCLabs.KitEventServer.2', 'Simulation.ConditionState1', 'Simulated')
except OpcException as opcException:
print('*** Failure: ' + opcException.GetBaseException().Message)
exit()
print('ConditionState:')
print(' .ActiveSubcondition: ', conditionState.ActiveSubcondition)
print(' .Enabled: ', conditionState.Enabled)
print(' .Active: ', conditionState.Active)
print(' .Acknowledged: ', conditionState.Acknowledged)
print(' .Quality: ', conditionState.Quality)
# Note that IAEConditionState has many more properties
print()
print('Finished.')
' This example shows how to obtain current state information for the condition instance corresponding to a Source and
' certain ConditionName.
Imports OpcLabs.EasyOpc.AlarmsAndEvents
Imports OpcLabs.EasyOpc.OperationModel
Namespace AlarmsAndEvents._EasyAEClient
Friend Class GetConditionState
Public Shared Sub Main1()
Dim client = New EasyAEClient()
Dim conditionState As AEConditionState
Try
conditionState = client.GetConditionState("", "OPCLabs.KitEventServer.2", "Simulation.ConditionState1", "Simulated")
Catch opcException As OpcException
Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message)
Exit Sub
End Try
Console.WriteLine("ConditionState:")
Console.WriteLine(" .ActiveSubcondition: {0}", conditionState.ActiveSubcondition)
Console.WriteLine(" .Enabled: {0}", conditionState.Enabled)
Console.WriteLine(" .Active: {0}", conditionState.Active)
Console.WriteLine(" .Acknowledged: {0}", conditionState.Acknowledged)
Console.WriteLine(" .Quality: {0}", conditionState.Quality)
' Remark: IAEConditionState has many more properties
End Sub
End Class
End Namespace