// 测试OPC public static void Test_CityOPCDataService() { OpcDaClient client = new OpcDaClient("Kepware.KepServerEX.V6"); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); client.Start(); Console.WriteLine("已启动, 耗时: {0} ms", stopWatch.ElapsedMilliseconds); stopWatch.Restart(); client.Write("OPCUA.设备 1.翻身河泵站翻身河泵站.泵站.设备数据.开关型测试点", true, out string message1); client.Write("OPCUA.设备 1.翻身河泵站翻身河泵站.泵站.设备数据.实数型测试点", 88, out string message2); // OPCUA.设备 1.故障通道测试 client.Write("OPCUA.设备 1.故障通道测试.故障设备.400001", 1, out string message3); client.Write("OPCUA.设备 1.故障通道测试.故障设备.400002", 2, out string message4); client.Write("OPCUA.设备 1.故障通道测试.故障设备.400003", 3, out string message5); Console.WriteLine("写入耗时: {0} ms", stopWatch.ElapsedMilliseconds); stopWatch.Restart(); Console.ReadLine(); client.Stop(); }
public static void TestOPC() { OpcDaClient oPC = new OpcDaClient("Kepware.KepServerEX.V6"); oPC.Start(); //oPC.TestOPCALL(); }