|
@@ -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)
|
|
void OpcUaClientOperate_OnEvent(object? sender, EventResult e, string name)
|
|
|
{
|
|
{
|