Shun 2 лет назад
Родитель
Сommit
a407016bb8
1 измененных файлов с 25 добавлено и 22 удалено
  1. 25 22
      src/YSAI.DAQ/YSAI.Test.All/Program.cs

+ 25 - 22
src/YSAI.DAQ/YSAI.Test.All/Program.cs

@@ -20,33 +20,36 @@ address.AddressArray = new List<AddressDetails> {
     }
 };
 
+for (int i = 0; i < 150; i++)
+{
+    OpcUaClientOperate opcUaClientOperate = OpcUaClientOperate.Instance(new OpcUaClientData.Basics
+    {
+        CustomName = Guid.NewGuid().ToString(),
+        Password = "ysai",
+        ServerUrl = "opc.tcp://127.0.0.1:8866/Opc.Ua.Service",
+        UserName = "ysai",
+        SN = Guid.NewGuid().ToString()
+    });
+    opcUaClientOperate.OnEvent += delegate (object? sender, EventResult e) { OpcUaClientOperate_OnEvent(sender, e, "a"); };
+    Console.WriteLine(opcUaClientOperate.OnAsync().Result.ToJson().JsonFormatting());
+    Console.WriteLine(opcUaClientOperate.AddSubscribe(new System.Collections.Concurrent.ConcurrentDictionary<string, Address>() { ["ysai"] = address }).ToJson().JsonFormatting());
+}
 
 
-OpcUaClientOperate opcUaClientOperate = OpcUaClientOperate.Instance(new OpcUaClientData.Basics
-{
-    CustomName = Guid.NewGuid().ToString(),
-    Password = "ysai",
-    ServerUrl = "opc.tcp://127.0.0.1:8866/Opc.Ua.Service",
-    UserName = "ysai",
-    SN = Guid.NewGuid().ToString()
-});
-opcUaClientOperate.OnEvent += delegate (object? sender, EventResult e) { OpcUaClientOperate_OnEvent(sender, e, "a"); };
-Console.WriteLine(opcUaClientOperate.OnAsync().Result.ToJson().JsonFormatting());
-Console.WriteLine(opcUaClientOperate.AddSubscribe(new System.Collections.Concurrent.ConcurrentDictionary<string, Address>() { ["ysai"] = address }).ToJson().JsonFormatting());
 
 
 
-OpcUaClientOperate opcUaClientOperate_2 = OpcUaClientOperate.Instance(new OpcUaClientData.Basics
-{
-    CustomName = Guid.NewGuid().ToString(),
-    Password = "ysai",
-    ServerUrl = "opc.tcp://127.0.0.1:8866/Opc.Ua.Service",
-    UserName = "ysai",
-    SN = Guid.NewGuid().ToString()
-});
-opcUaClientOperate_2.OnEvent += delegate (object? sender, EventResult e) { OpcUaClientOperate_OnEvent(sender, e, "b"); };
-Console.WriteLine(opcUaClientOperate_2.OnAsync().Result.ToJson().JsonFormatting());
-Console.WriteLine(opcUaClientOperate_2.AddSubscribe(new System.Collections.Concurrent.ConcurrentDictionary<string, Address>() { ["ysai"] = address }).ToJson().JsonFormatting());
+//OpcUaClientOperate opcUaClientOperate_2 = OpcUaClientOperate.Instance(new OpcUaClientData.Basics
+//{
+//    CustomName = Guid.NewGuid().ToString(),
+//    Password = "ysai",
+//    ServerUrl = "opc.tcp://127.0.0.1:8866/Opc.Ua.Service",
+//    UserName = "ysai",
+//    SN = Guid.NewGuid().ToString()
+//});
+//opcUaClientOperate_2.OnEvent += delegate (object? sender, EventResult e) { OpcUaClientOperate_OnEvent(sender, e, "b"); };
+//Console.WriteLine(opcUaClientOperate_2.OnAsync().Result.ToJson().JsonFormatting());
+//Console.WriteLine(opcUaClientOperate_2.AddSubscribe(new System.Collections.Concurrent.ConcurrentDictionary<string, Address>() { ["ysai"] = address }).ToJson().JsonFormatting());
 
 void OpcUaClientOperate_OnEvent(object? sender, EventResult e, string name)
 {