// This example shows how to let the user browse for OPC Alarms&Events areas or sources. // // 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.Linq; using System.Windows.Forms; using OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing; namespace FormsDocExamples._AEAreaOrSourceDialog { static class ShowDialog { public static void Main1(IWin32Window owner) { var areaOrSourceDialog = new AEAreaOrSourceDialog { ServerDescriptor = {ServerClass = "OPCLabs.KitEventServer.2"} }; DialogResult dialogResult = areaOrSourceDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) return; // Display results string nodeElementsString = string.Join("\n", areaOrSourceDialog.NodeElements.Select(element => element)); MessageBox.Show(owner, nodeElementsString); } } }
' This example shows how to let the user browse for OPC Alarms&Events areas or sources. ' ' 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.AddressSpace Imports OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing Namespace FormsDocExamples._AEAreaOrSourceDialog Friend Class ShowDialog Shared Sub Main1(owner As IWin32Window) Dim areaOrSourceDialog = New AEAreaOrSourceDialog() With { .ServerDescriptor = New ServerDescriptor() With { .ServerClass = "OPCLabs.KitEventServer.2" } } Dim dialogResult As DialogResult = areaOrSourceDialog.ShowDialog(owner) If dialogResult <> DialogResult.OK Then Return End If ' Display results Dim nodeElementsString As String = String.Join("\n", areaOrSourceDialog.NodeElements.Select(Function(element As AENodeElement) element)) MessageBox.Show(owner, nodeElementsString) End Sub End Class End Namespace
# This example shows how to let the user browse for OPC Alarms&Events areas or sources. # # 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 * areaOrSourceDialog = AEAreaOrSourceDialog() areaOrSourceDialog.ServerDescriptor.ServerClass = "OPCLabs.KitEventServer.2" dialogResult = areaOrSourceDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: exit() # Display results. print() for nodeElement in areaOrSourceDialog.NodeElements: print(nodeElement)
Copyright © 2004-2024 CODE Consulting and Development, s.r.o., Plzen. All rights reserved. Web page: www.opclabs.com
Documentation Home, Send Feedback. Resources: Knowledge Base, Product Downloads. Technical support: Online Forums, FAQ.Missing some example? Ask us for it on our Online Forums! You do not have to own a commercial license in order to use Online Forums, and we reply to every post.