// This example shows how to let the user browse for an OPC-UA node. // // Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . using System.Windows.Forms; using OpcLabs.EasyOpc.UA.Forms.Browsing; namespace UAFormsDocExamples._UABrowseDialog { static partial class ShowDialog { public static void Main1(IWin32Window owner) { var browseDialog = new UABrowseDialog(); browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com"; browseDialog.Mode.AnchorElementType = UAElementType.Host; DialogResult dialogResult = browseDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) return; // Display results MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.NodeElement.ToString()); } } }
# This example shows how to let the user browse for an OPC-UA node. # # Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . using namespace OpcLabs.EasyOpc.UA.Forms.Browsing # The path below assumes that the current directory is [ProductDir]/Examples-NET/PowerShell/Windows . Add-Type -Path "../../../Components/Opclabs.QuickOpc/net472/OpcLabs.EasyOpcForms.dll" # Instantiate the dialog object. $browseDialog = New-Object UABrowseDialog $browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" $browseDialog.Mode.AnchorElementType = [UAElementType]::Host $dialogResult = $browseDialog.ShowDialog() if ($dialogResult -ne [System.Windows.Forms.DialogResult]::OK) { return } # Display results Write-Host $browseDialog.Outputs.CurrentNodeElement.NodeElement
# This example shows how to let the user browse for an OPC-UA node. # # 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 . # 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.UA.Forms.Browsing import * browseDialog = UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = 'opcua.demo-this.com' browseDialog.Mode.AnchorElementType = UAElementType.Host dialogResult = browseDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: exit() # Display results. print(browseDialog.Outputs.CurrentNodeElement.NodeElement) print('Finished.')
' This example shows how to let the user browse for an OPC-UA node. ' ' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Imports OpcLabs.EasyOpc.UA.Forms.Browsing Namespace UAFormsDocExamples._UABrowseDialog Friend Class ShowDialog Shared Sub Main1(owner As IWin32Window) Dim browseDialog = New UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" browseDialog.Mode.AnchorElementType = UAElementType.Host Dim dialogResult As DialogResult = browseDialog.ShowDialog(owner) If dialogResult <> DialogResult.OK Then Return End If ' Display results MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.NodeElement.ToString()) End Sub End Class End Namespace
// This example shows how to let the user browse for an OPC-UA node. // // Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . #include "stdafx.h" // Includes "QuickOpc.h", and other commonly used files #include "ShowDialog.h" namespace _UABrowseDialog { void ShowDialog::Main() { // Initialize the COM library CoInitializeEx(NULL, COINIT_MULTITHREADED); { // _UABrowseDialogPtr BrowseDialogPtr(__uuidof(UABrowseDialog)); // BrowseDialogPtr->InputsOutputs->CurrentNodeDescriptor->EndpointDescriptor->Host = L"opcua.demo-this.com"; BrowseDialogPtr->Mode->AnchorElementType = UAElementType_Host; // DialogResult dialogResult = BrowseDialogPtr->ShowDialog(NULL); _tprintf(_T("%d\n"), dialogResult); if (dialogResult == 1/*OK*/) { // Display results _tprintf(_T("%s\n"), (LPCTSTR)CW2CT(BrowseDialogPtr->Outputs->CurrentNodeElement->NodeElement->ToString)); } } // Release all interface pointers BEFORE calling CoUninitialize() CoUninitialize(); } }
// This example shows how to let the user browse for an OPC-UA node. // // Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . class procedure ShowDialog.Main; var BrowseDialog: UABrowseDialog; begin // Instantiate the dialog object BrowseDialog := CoUABrowseDialog.Create; BrowseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host := 'opcua.demo-this.com'; BrowseDialog.Mode.AnchorElementType := UAElementType_Host; BrowseDialog.ShowDialog(nil); // IMPROVE: check the dialog result // Display results WriteLn(BrowseDialog.Outputs.CurrentNodeElement.NodeElement.ToString); end;
// This example shows how to let the user browse for an OPC-UA node. // // Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . class procedure ShowDialog.Main; var BrowseDialog: OpcLabs_EasyOpcForms_TLB._UABrowseDialog; DialogResult: System_Windows_Forms_TLB.DialogResult; begin // Instantiate the dialog object BrowseDialog := CoUABrowseDialog.Create; BrowseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host := 'opcua.demo-this.com'; BrowseDialog.Mode.AnchorElementType := UAElementType_Host; DialogResult := BrowseDialog.ShowDialog(nil); WriteLn(DialogResult); if DialogResult <> DialogResult_OK then Exit; // Display results WriteLn(BrowseDialog.Outputs.CurrentNodeElement.NodeElement.ToString); end;
// This example shows how to let the user browse for an OPC-UA node. // // Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . $UAElementType_Host = 1; $BrowseDialog = new COM("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog"); $BrowseDialog->InputsOutputs->CurrentNodeDescriptor->EndpointDescriptor->Host = "opcua.demo-this.com"; $BrowseDialog->Mode->AnchorElementType = $UAElementType_Host; printf("%d\n", $BrowseDialog->ShowDialog); // Display results printf("%s\n", $BrowseDialog->Outputs->CurrentNodeElement->NodeElement);
# This example shows how to let the user browse for an OPC-UA node. # # The Python for Windows (pywin32) extensions package is needed. Install it using "pip install pypiwin32". # CAUTION: We now recommend using Python.NET package instead. Full set of examples with Python.NET is available! # # Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . import win32com.client UAElementType_Host = 1 browseDialog = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.Forms.Browsing.Specialized.UABrowseDialog') browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" browseDialog.Mode.AnchorElementType = UAElementType_Host print(browseDialog.ShowDialog()) # Display results print(browseDialog.Outputs.CurrentNodeElement.NodeElement)
REM This example shows how to let the user browse for an OPC-UA node. REM REM Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Private Sub ShowDialog_Main_Command_Click() OutputText = "" Dim BrowseDialog As New UABrowseDialog BrowseDialog.InputsOutputs.CurrentNodeDescriptor.endpointDescriptor.Host = "opcua.demo-this.com" Dim DialogResult DialogResult = BrowseDialog.ShowDialog OutputText = OutputText & DialogResult & vbCrLf If DialogResult <> 1 Then ' OK Exit Sub End If ' Display results OutputText = OutputText & BrowseDialog.outputs.CurrentNodeElement.NodeElement & vbCrLf End Sub
Rem This example shows how to let the user browse for an OPC-UA node. Rem Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Option Explicit Const DialogResult_OK = 1 Const UAElementType_Host = 1 Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog") BrowseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" BrowseDialog.Mode.AnchorElementType = UAElementType_Host Dim dialogResult: dialogResult = BrowseDialog.ShowDialog WScript.Echo dialogResult If dialogResult <> DialogResult_OK Then WScript.Quit End If ' Display results WScript.Echo BrowseDialog.Outputs.CurrentNodeElement.NodeElement
Copyright © 2004-2024 CODE Consulting and Development, s.r.o., Plzen. All rights reserved. Web page: www.opclabs.com
Send Documentation 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.