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)