// This example shows how to let the user browse for an OPC Data Access item.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
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.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# 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.
#
# 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.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.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
Imports OpcLabs.EasyOpc
Imports OpcLabs.EasyOpc.DataAccess.Forms.Browsing
Namespace FormsDocExamples._DAItemDialog
Friend Class ShowDialog
Shared Sub Main1(owner As IWin32Window)
Dim itemDialog = New DAItemDialog() With {
.ServerDescriptor = New ServerDescriptor() With {
.ServerClass = "OPCLabs.KitServer.2"
}
}
Dim dialogResult As DialogResult = itemDialog.ShowDialog(owner)
If dialogResult <> DialogResult.OK Then
Return
End If
' Display results
MessageBox.Show(owner, $"NodeElement: {itemDialog.NodeElement}")
End Sub
End Class
End Namespace