// This example shows how to let the user browse for an OPC "Classic" server.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
using System.Windows.Forms;
using OpcLabs.EasyOpc.Forms.Browsing;
namespace FormsDocExamples._OpcServerDialog
{
static class ShowDialog
{
public static void Main1(IWin32Window owner)
{
var serverDialog = new OpcServerDialog();
//serverDialog.Location = "";
DialogResult dialogResult = serverDialog.ShowDialog(owner);
if (dialogResult != DialogResult.OK)
return;
// Display results
MessageBox.Show(owner, serverDialog.ServerElement);
}
}
}
# This example shows how to let the user browse for an OPC "Classic" server.
#
# 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"
$serverDialog = New-Object OpcLabs.EasyOpc.Forms.Browsing.OpcServerDialog
#$serverDialog.Location = ""
$dialogResult = $serverDialog.ShowDialog()
if ($dialogResult -ne [System.Windows.Forms.DialogResult]::OK) {
return
}
# Display results
Write-Host $serverDialog.ServerElement
# This example shows how to let the user browse for an OPC "Classic" server.
#
# 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.Forms.Browsing import *
serverDialog = OpcServerDialog()
#serverDialog.Location = ''
dialogResult = serverDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
exit()
# Display results.
print('ServerElement: ', serverDialog.ServerElement, sep='')
' This example shows how to let the user browse for an OPC "Classic" server.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
Imports OpcLabs.EasyOpc.Forms.Browsing
Namespace FormsDocExamples._OpcServerDialog
Friend Class ShowDialog
Shared Sub Main1(owner As IWin32Window)
Dim serverDialog = New OpcServerDialog()
'serverDialog.Location = ""
Dim dialogResult As DialogResult = serverDialog.ShowDialog(owner)
If dialogResult <> DialogResult.OK Then
Return
End If
' Display results
MessageBox.Show(owner, serverDialog.ServerElement)
End Sub
End Class
End Namespace