0

我正在用 C# 编写一个 OPC 代理程序。我想获取机器上localhost或远程所有 OPC-Server 的列表。我正在使用来自 OPC Foundation V1.26 的 OPC UA .NET

我的灵感来自 Softing 的“sampleDiscovery-Programm”,现在我的服务器列表为ApplicationDescription.

现在我想查看指定服务器的连接客户端。使用 Softing 的示例“servers_control-Programm”,我可以看到服务器的所有客户端。但是这个类的构造函数需要服务器作为StandardServerApplicationConfiguration

    public ServerForm(StandardServer server, ApplicationConfiguration configuration)
    {
        InitializeComponent();

        m_server = server;

        m_configuration = configuration;
        this.ServerDiagnosticsCTRL.Initialize(m_server, m_configuration);

        TrayIcon.Text = this.Text = m_configuration.ApplicationName;
        this.Icon = TrayIcon.Icon = ConfigUtils.GetAppIcon();
    }

如何将主服务器ApplicationDescription用作标准服务器?

4

1 回答 1

1

您可以OPC Labs Quick OPC Calssic使用OPC UA servers.VB.NET

下载并安装QuickOPC 5.23(.NET Framework 3.5 or 4.0)QuickOPC 5.31(.NET Framework 4.5)http://opclabs.com/products/quickopc/downloads

VB.NET 代码:

' Instantiate the client object
 Dim easyUAClient = New EasyUAClient()
    
' Obtain collection of server elements
Dim applicationElementCollection As UAApplicationElementCollection = easyUAClient.DiscoverServers()
    
' Display results
For Each applicationElement As UAApplicationElement In applicationElementCollection
    Console.WriteLine("applicationElementCollection[""{0}""].ApplicationUriString: {1}", _
                                  applicationElement.DiscoveryUriString, applicationElement.ApplicationUriString)
Next applicationElement

在此处输入图像描述

于 2014-12-08T06:16:50.440 回答