From a1a35c00a599bb737dd78a2e57e3085f87275fa0 Mon Sep 17 00:00:00 2001 From: "2248356998 qq.com" <2248356998@qq.com> Date: Fri, 19 May 2023 10:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=8C=85=E6=95=B0=E9=87=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Wokers/Collect/CollectDeviceCore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ThingsGateway.Web.Foundation/Wokers/Collect/CollectDeviceCore.cs b/src/ThingsGateway.Web.Foundation/Wokers/Collect/CollectDeviceCore.cs index ec73f9e66..54ac089e3 100644 --- a/src/ThingsGateway.Web.Foundation/Wokers/Collect/CollectDeviceCore.cs +++ b/src/ThingsGateway.Web.Foundation/Wokers/Collect/CollectDeviceCore.cs @@ -212,6 +212,8 @@ public class CollectDeviceCore : DisposableObject if (_driver != null) { InitDriver(client); + Device.SourceVariableNum = DeviceVariableSourceReads.Count; + Device.MethodVariableNum = DeviceVariableMedReads.Count; } else { @@ -227,8 +229,7 @@ public class CollectDeviceCore : DisposableObject Device.ActiveTime = DateTime.UtcNow; await _driver?.BeforStartAsync(); } - Device.SourceVariableNum = DeviceVariableSourceReads.Count; - Device.MethodVariableNum = DeviceVariableMedReads.Count; + } catch (Exception ex) {