| | |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功", DateUtils.convert(new Date()), slave.getId())); |
| | | |
| | | // 复位信号 |
| | | if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) { |
| | | if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusType().equals(CrnStatusType.WAITING) && crnProtocol.getTaskNo()!=null&&crnProtocol.getTaskNo() != 0) { |
| | | // if (crnProtocol.getTaskNo() == 0){ |
| | | // News.error("堆垛机工位1工作号为0,不予确认,工位1{}",crnProtocol.getLoaded() == 1 ? "有物" : "无物"); |
| | | // return; |
| | |
| | | } |
| | | |
| | | // 复位信号 |
| | | if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusTypeTwo().equals(CrnStatusType.WAITING)) { |
| | | else if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusTypeTwo().equals(CrnStatusType.WAITING)&& crnProtocol.getTaskNoTwo()!=null&&crnProtocol.getTaskNoTwo() != 0) { |
| | | // if (crnProtocol.getTaskNoTwo() == 0){ |
| | | // News.error("堆垛机工位2工作号为0,不予确认,工位2{}",crnProtocol.getLoadedTwo() == 1 ? "有物" : "无物"); |
| | | // return; |
| | |
| | | |
| | | short[] array2 = new short[1]; |
| | | array2[0] = command.getAckFinish(); |
| | | OperateResult result = siemensNet.Write("DB100.20", array); |
| | | OperateResult result2 = siemensNet.Write("DB100.0", array2); |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | OperateResult result = siemensNet.Write("DB100.20", array); |
| | | News.info("堆垛机工位2命令下发[id:{}] >>>>> {}", slave.getId(), array); |
| | | News.info("堆垛机工位2任务完成确认位下发[id:{}] >>>>> {}", slave.getId(), array2); |
| | | |
| | |
| | | // if (!resetFlag){ |
| | | News.error("写入堆垛机工位2plc数据失败,重新下发任务 回读不一致 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSON(command), writeCount1); |
| | | result = siemensNet.Write("DB100.20", array); |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | result2 = siemensNet.Write("DB100.0", array2); |
| | | // } |
| | | writeCount1++; |
| | | continue; |