Browse Source

修改

炒锅机器人_一拖多
liup 1 week ago
parent
commit
0a6a3d0e79
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java

+ 2
- 1
app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java View File

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


Loading…
Cancel
Save