OPCAutomation问题
上午写了一个OPCClient,用的是OPC自动化接口,
......
using OPCAutomation;
.......
OPCServer MyOpcServer;//OPCServer
OPCGroup MyOpcGroup;
.......
MyOpcServer = new OPCServer();
MyOpcServer.Connect("Advantech.ADAM","10.101.41.43");
MyOpcGroup = MyOpcServer.OPCGroups.Add("MyGroup1");
程序运行到这里的时候出错,提示
创建组出现错误:无法将类型为"OPCAutomation.OPCServerClass"的对象强制转换为类型"OPCAutomation.IOPCGroups"。
等待高手解决。。。