From 0f3524b114d435a84f720f4c233523b3ae7913bf Mon Sep 17 00:00:00 2001 From: Diego <2248356998@qq.com> Date: Wed, 12 Feb 2025 16:23:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20opc=E6=8F=92=E4=BB=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Directory.Build.props | 4 ++-- .../ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs | 1 + .../ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs | 1 + .../ThingsGateway.Plugin.OpcUa105/OpcUaMaster/OpcUaMaster.cs | 1 + src/ThingsGateway.Server/targets/GatewayOther.targets | 4 ++-- src/Version.props | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3a512c683..f6c80f44c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,8 +1,8 @@ - 10.0.1.1 - 10.0.1.1 + 10.0.1.2 + 10.0.1.2 diff --git a/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs b/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs index ae9ab2e65..e62983876 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs @@ -124,6 +124,7 @@ public class OpcDaMaster : CollectBase /// protected override List ProtectedLoadSourceRead(List deviceVariables) { + _plc?.Disconnect(); if (deviceVariables.Count > 0) { var result = _plc.AddItemsWithSave(deviceVariables.Where(a => !string.IsNullOrEmpty(a.RegisterAddress)).Select(a => a.RegisterAddress!).ToList()); diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs index 16baf33ce..c2b24bbfc 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs @@ -167,6 +167,7 @@ public class OpcUaMaster : CollectBase /// protected override List ProtectedLoadSourceRead(List deviceVariables) { + _plc?.Disconnect(); if (deviceVariables.Count > 0) { var dataLists = deviceVariables.ChunkBetter(_driverProperties.GroupSize); diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa105/OpcUaMaster/OpcUaMaster.cs b/src/Plugin/ThingsGateway.Plugin.OpcUa105/OpcUaMaster/OpcUaMaster.cs index e59a76826..412ee6a5e 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa105/OpcUaMaster/OpcUaMaster.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa105/OpcUaMaster/OpcUaMaster.cs @@ -167,6 +167,7 @@ public class OpcUa105Master : CollectBase /// protected override List ProtectedLoadSourceRead(List deviceVariables) { + _plc?.Disconnect(); if (deviceVariables.Count > 0) { var dataLists = deviceVariables.ChunkBetter(_driverProperties.GroupSize); diff --git a/src/ThingsGateway.Server/targets/GatewayOther.targets b/src/ThingsGateway.Server/targets/GatewayOther.targets index 03412108d..ed079c120 100644 --- a/src/ThingsGateway.Server/targets/GatewayOther.targets +++ b/src/ThingsGateway.Server/targets/GatewayOther.targets @@ -2,8 +2,8 @@ - - + + diff --git a/src/Version.props b/src/Version.props index 2526f3053..83d63002a 100644 --- a/src/Version.props +++ b/src/Version.props @@ -1,6 +1,6 @@ - 10.0.1.1 + 10.0.1.2