开发者

opc .net api list of servers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜