|  |  | 
 |  |  |     private void readStatusRgv() { | 
 |  |  |         while (true) { | 
 |  |  |             try { | 
 |  |  |                 if(!connectRgv){ | 
 |  |  |                     try { | 
 |  |  |                         Thread.sleep(1000L); | 
 |  |  |                     } catch (Exception e){ | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                     initRgv(); | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 Thread.sleep(50); | 
 |  |  |                 readStatus(); | 
 |  |  |  | 
 |  |  | 
 |  |  |     private void taskIssued() { | 
 |  |  |         while (true) { | 
 |  |  |             try { | 
 |  |  |                 if(!connectRgv){ | 
 |  |  |                     try { | 
 |  |  |                         Thread.sleep(1000L); | 
 |  |  |                     } catch (Exception e){ | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 int step = 1; | 
 |  |  |                 Task task = MessageQueue.poll(SlaveType.Rgv, slave.getId()); | 
 |  |  |                 if (task != null) { | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (command.getAckFinish1() == 0 && command.getAckFinish2() == 0) { | 
 |  |  |             short commandFinish = 3;  //工位1、2任务同时写入 | 
 |  |  |             Thread.sleep(100L); | 
 |  |  |             Thread.sleep(50L); | 
 |  |  |             result = siemensNet.Write("DB100.20", commandFinish); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         } catch (Exception ignore) {} | 
 |  |  |  | 
 |  |  |         if (result != null && result.IsSuccess) { | 
 |  |  |             Thread.sleep(200); | 
 |  |  |             this.readStatus(); | 
 |  |  | //            Thread.sleep(200); | 
 |  |  | //            this.readStatus(); | 
 |  |  |             log.info("RGV 命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); | 
 |  |  |             OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); | 
 |  |  |             return true; | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (command.getAckFinish1() == 0) { | 
 |  |  |             short commandFinish = 1;  //工位1任务写入 | 
 |  |  |             Thread.sleep(100L); | 
 |  |  |             Thread.sleep(20L); | 
 |  |  |             result = siemensNet.Write("DB100.20", commandFinish); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         } catch (Exception ignore) {} | 
 |  |  |  | 
 |  |  |         if (result != null && result.IsSuccess) { | 
 |  |  |             Thread.sleep(200); | 
 |  |  |             this.readStatus(); | 
 |  |  | //            Thread.sleep(200); | 
 |  |  | //            this.readStatus(); | 
 |  |  |             log.info("RGV 工位1命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command)); | 
 |  |  |             OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 工位1命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command))); | 
 |  |  |             return true; | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (command.getAckFinish2() == 0) { | 
 |  |  |             short commandFinish = 2;  //工位2任务写入 | 
 |  |  |             Thread.sleep(100L); | 
 |  |  |             Thread.sleep(20L); | 
 |  |  |             result = siemensNet.Write("DB100.20", commandFinish); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         } catch (Exception ignore) {} | 
 |  |  |  | 
 |  |  |         if (result != null && result.IsSuccess) { | 
 |  |  |             Thread.sleep(200); | 
 |  |  |             this.readStatus(); | 
 |  |  | //            Thread.sleep(200); | 
 |  |  | //            this.readStatus(); | 
 |  |  |             log.info("RGV 工位2命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command)); | 
 |  |  |             OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 工位2命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command))); | 
 |  |  |             return true; |