Browse Source

修改

炒锅机器人_一拖多
liup 4 months ago
parent
commit
b92023b193
1 changed files with 6 additions and 10 deletions
  1. +6
    -10
      app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java

+ 6
- 10
app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java View File

@@ -92,12 +92,17 @@ public class ModbusCenter {
}
try{
if(WokModbusTcpServer.get().plcIsConnect){
int i = 0;
for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Wok) {
i++;
if(item!=null){
if (item.isread == 1) {
if(WokModbusTcpServer.get().plcIsConnect){
LogUtils.d("//////////time for "+i+" time="+(b-a));
Object val = wokReadPlc(1,item.name);
LogUtils.d("//////////time for "+i+" time="+(b-a));
WokModbusTcpServer.get().listeningValue.put(item.name, val);
LogUtils.d("//////////time for "+i+" time="+(b-a));
}
}
}
@@ -135,11 +140,7 @@ public class ModbusCenter {
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);
ReadPLCStatus(2);
}

b = System.currentTimeMillis();
LogUtils.d("//////////time 4"+(b-a));
} catch (Exception ex) {
@@ -156,11 +157,6 @@ public class ModbusCenter {
ReadPLCStatus(2);
}
try{
if (WokModbusTcpServer.get().plcIsConnect) {
WritePlc(1,"心跳位", 0, null);
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);


Loading…
Cancel
Save