|
|
@@ -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) |
|
|
|