开发者

opc .net api list of servers

开发者 https://www.devze.com 2023-01-26 09:37 出处:网络
I\'m writing opc client on c#. I want to get list of all opc servers on machine, how can i do it? I\'m开发者_开发知识库 using opc .net API from opc foundation.Per example to list all OPC DA 2.0 server

I'm writing opc client on c#. I want to get list of all opc servers on machine, how can i do it? I'm开发者_开发知识库 using opc .net API from opc foundation.


Per example to list all OPC DA 2.0 servers on a specific machine:

public void GetServers()
{
    IDiscovery discovery = new OpcCom.ServerEnumerator();

    //Get all local OPC DA servers of version 2.0
    Opc.Server[] localservers = discovery.GetAvailableServers(Specification.COM_DA_20);

    //Get all OPC DA servers of version 2.0 of machine "MyMachine"
    Opc.Server[] hostservers = discovery.GetAvailableServers(Specification.COM_DA_20, "MyMachine", null);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消