DLL used : opcdaauto.dll from OPC Foundation
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, "");
Then also I am not able to communicate . Any help highly appreciated.
Thanks in advance
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;
Refer : http://revanayya.blogspot.in/2013/12/opcclient-development-using-observer.html