From 0a6a3d0e79d76af434d2394f6450a196db6c6c29 Mon Sep 17 00:00:00 2001 From: liup <1454939542@qq.com> Date: Tue, 17 Dec 2024 09:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonait/bnframework/modbus/ModbusTcpHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java b/app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java index 442df926..ba81d2cc 100644 --- a/app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java +++ b/app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java @@ -55,7 +55,6 @@ public abstract class ModbusTcpHelper { public void ReConnect(String error){ if(error.contains("Connection refused")||error.contains("SocketException")){ if(plcIsConnect){ - RecordManager.getInstance().addLogRecord("设备异常日志",getDeviceName()+" error:"+error+"-开始重连"); ConnectPLC(); } } @@ -78,6 +77,8 @@ public abstract class ModbusTcpHelper { } ThreadManager.get().StartLong(getDeviceName(),false, () -> { while (!plcIsConnect){ + RecordManager.getInstance().addLogRecord("设备异常日志",getDeviceName()+"-开始连接"); + param = TcpParam.create(getAddress(), getPort()) .setTimeout(1000) .setRetries(0)