【问题标题】:How to connect remote OPC Server using opcdaauto.dll using C#?如何使用 C# 使用 opcdaauto.dll 连接远程 OPC 服务器?
【发布时间】:2014-02-19 08:24:06
【问题描述】:

使用的 DLL:来自 OPC Foundation 的 opcdaauto.dll

        OPCServer ObjOPCServer;
        OPCGroups ObjOPCGroups;
        OPCGroup ObjOPCGroup;

        ObjOPCServer = new OPCServer();
        string _serverName = "Kepware.KEPServerEX.V5";

        //In place of "", I need to give IP address of machine where OPC Server is present
        ObjOPCServer.Connect(_serverName, ""); 

那我也不能交流了。任何帮助都非常感谢。

提前致谢

【问题讨论】:

    标签: c#-4.0 opc


    【解决方案1】:
                OPCServer ObjOPCServer = new OPCServer();
                OPCGroups ObjOPCGroups;
                OPCGroup ObjOPCGroup;
                //string _serverName = "Kepware.KEPServerEX.V5";
                string _serverName = "Matrikon.OPC.OMRON.1";
    
                ObjOPCServer.Connect(_serverName, "192.168.0.110");
                ObjOPCGroups = ObjOPCServer.OPCGroups;
    
                ObjOPCGroup = ObjOPCGroups.Add("Group1");
                ObjOPCGroup.DataChange += new DIOPCGroupEvent_DataChangeEventHandler(ObjOPCGroup_DataChange);
                ObjOPCGroup.OPCItems.AddItem("#MonitorACLFile", 1);
    
                //ObjOPCGroup.OPCItems.AddItem("Channel1.Device1.Tag2", 2);
                ObjOPCGroup.UpdateRate = 1000;
                ObjOPCGroup.IsActive = true;
                ObjOPCGroup.IsSubscribed = true;
    

    参考:http://revanayya.blogspot.in/2013/12/opcclient-development-using-observer.html

    【讨论】:

      猜你喜欢
      • 2017-12-22
      • 1970-01-01
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 2022-06-27
      • 2020-03-29
      • 1970-01-01
      相关资源
      最近更新 更多