// This example shows how to let the user browse for an OPC Data Access item. using System.Windows.Forms; using OpcLabs.EasyOpc.DataAccess.Forms.Browsing; namespace FormsDocExamples._DAItemDialog { static class ShowDialog { public static void Main1(IWin32Window owner) { var itemDialog = new DAItemDialog { ServerDescriptor = {ServerClass = "OPCLabs.KitServer.2"} }; DialogResult dialogResult = itemDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) return; // Display results MessageBox.Show(owner, $"NodeElement: {itemDialog.NodeElement}"); } } }
# This example shows how to let the user browse for an OPC Data Access item. # The path below assumes that the current directory is [ProductDir]/Examples-NET/PowerShell/Windows . Add-Type -Path "../../../Components/Opclabs.QuickOpc/net472/OpcLabs.EasyOpcForms.dll" $itemDialog = New-Object OpcLabs.EasyOpc.DataAccess.Forms.Browsing.DAItemDialog $itemDialog.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2" $dialogResult = $itemDialog.ShowDialog() if ($dialogResult -ne [System.Windows.Forms.DialogResult]::OK) { return } # Display results Write-Host "NodeElement: $($itemDialog.NodeElement)"
# This example shows how to let the user browse for an OPC Data Access item. # 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.DataAccess.Forms.Browsing import * itemDialog = DAItemDialog() itemDialog.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2" dialogResult = itemDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: exit() # Display results. print('NodeElement: ', itemDialog.NodeElement, sep='')
// This example shows how to let the user browse for an OPC Data Access item. class procedure ShowDialog.Main; var ItemDialog: OpcLabs_EasyOpcForms_TLB._DAItemDialog; begin // Instantiate the dialog object ItemDialog := CoDAItemDialog.Create; ItemDialog.ServerDescriptor.ServerClass := 'OPCLabs.KitServer.2'; ItemDialog.ShowDialog(nil); // Display results WriteLn(ItemDialog.NodeElement.ToString); end;
Rem This example shows how to let the user browse for an OPC Data Access item. Private Sub ShowDialog_Main_Command_Click() OutputText = "" ' Instantiate the dialog object Dim itemDialog As New DAItemDialog Dim dialogResult dialogResult = itemDialog.ShowDialog itemDialog.serverDescriptor.ServerClass = "OPCLabs.KitServer.2" OutputText = OutputText & dialogResult & vbCrLf If dialogResult <> 1 Then ' OK Exit Sub End If ' Display results OutputText = OutputText & itemDialog.NodeElement & vbCrLf End Sub
Rem This example shows how to let the user browse for an OPC Data Access item. Option Explicit Const DialogResult_OK = 1 Dim ItemDialog: Set ItemDialog = CreateObject("OpcLabs.EasyOpc.DataAccess.Forms.Browsing.DAItemDialog") ItemDialog.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2" Dim dialogResult: dialogResult = ItemDialog.ShowDialog WScript.Echo dialogResult If dialogResult <> DialogResult_OK Then WScript.Quit End If ' Display results WScript.Echo "NodeElement: " & ItemDialog.NodeElement
Copyright © 2004-2023 CODE Consulting and Development, s.r.o., Plzen. All rights reserved. Web page: www.opclabs.com
Send Documentation Feedback. Resources: Knowledge Base. Technical support: Online Forums, FAQ.