OPC Studio User's Guide and Reference
ConditionElement Property (AECategoryConditionDialog)
Example 



OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing Namespace > AECategoryConditionDialog Class : ConditionElement Property
Contains information gathered about an OPC event condition.
Syntax
'Declaration
 
Public ReadOnly Property ConditionElement As AEConditionElement
'Usage
 
Dim instance As AECategoryConditionDialog
Dim value As AEConditionElement
 
instance.ConditionElement = value
 
value = instance.ConditionElement
public AEConditionElement ConditionElement {get;}
public:
property AEConditionElement^ ConditionElement {
   AEConditionElement^ get();
}

Property Value

This value of this property can be null (Nothing in Visual Basic).

The default value of this property is null.

Because the OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AEConditionElement has an implicit conversion to System.String, and it converts to the condition name (OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AEConditionElement.Name), in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AEConditionElement in any place where condition name (a string) is expected as input, and the corresponding condition name will be taken automatically from the condition element.

Remarks

The getter method of this property is pure, i.e. it does not have observable side effects.

Example
// This example shows how to let the user browse for an OPC Alarms&Events condition available on a specified event category.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

using System.Windows.Forms;
using OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing;

namespace FormsDocExamples._AECategoryConditionDialog
{
    static class ShowDialog
    {
        public static void Main1(IWin32Window owner)
        {
            var categoryConditionDialog = new AECategoryConditionDialog()
            {
                ServerDescriptor = {ServerClass = "OPCLabs.KitEventServer.2"},
                CategoryId = 0x00EC0002  // Deviation
            };

            DialogResult dialogResult = categoryConditionDialog.ShowDialog(owner);
            if (dialogResult != DialogResult.OK)
                return;

            // Display results
            MessageBox.Show(owner, $"ConditionElement: {categoryConditionDialog.ConditionElement}");
        }
    }
}
' This example shows how to let the user browse for an OPC Alarms&Events condition available on a specified event category.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
' OPC client and subscriber examples in VB.NET on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBNET .
' Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
' a commercial license in order to use Online Forums, and we reply to every post.

Imports OpcLabs.EasyOpc
Imports OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing

Namespace FormsDocExamples._AECategoryConditionDialog
    Friend Class ShowDialog
        Shared Sub Main1(owner As IWin32Window)
            Dim categoryConditionDialog = New AECategoryConditionDialog() With {
                .ServerDescriptor = New ServerDescriptor() With {
                    .ServerClass = "OPCLabs.KitEventServer.2"
                },
                .CategoryId = &HEC0002 ' Deviation
            }

            Dim dialogResult As DialogResult = categoryConditionDialog.ShowDialog(owner)
            If dialogResult <> DialogResult.OK Then
                Return
            End If

            ' Display results
            MessageBox.Show(owner, $"ConditionElement: {categoryConditionDialog.ConditionElement}")
        End Sub
    End Class
End Namespace
# This example shows how to let the user browse for an OPC Alarms&Events condition available on a specified event
# category.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
# a commercial license in order to use Online Forums, and we reply to every post.
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System.Windows.Forms import *
from OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing import *


categoryConditionDialog = AECategoryConditionDialog()
categoryConditionDialog.ServerDescriptor.ServerClass = "OPCLabs.KitEventServer.2"
categoryConditionDialog.CategoryId = 0x00EC0002  # Deviation

dialogResult = categoryConditionDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
    exit()

# Display results.
print('ConditionElement: ', categoryConditionDialog.ConditionElement, sep='')
Requirements

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

See Also