| | |
| | | crnCommand.setAckFinish((short)1); |
| | | if (write(crnCommand)) { |
| | | resetFlag = false; |
| | | News.info("{}号堆垛机,任务{}完成确认信号发送成功",crnProtocol.getCrnNo(),crnProtocol.getTaskNo()); |
| | | } else { |
| | | News.error("{}号堆垛机,任务{}完成确认信号发送失败",crnProtocol.getCrnNo(),crnProtocol.getTaskNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | command.setCrnNo(slave.getId()); |
| | | // short[] array = new short[10]; |
| | | |
| | | short[] array = new short[10]; |
| | | array[0] = command.getAckFinish(); // 任务完成确认位 |
| | | array[1] = command.getTaskNo(); // 任务号 |
| | |
| | | |
| | | |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), array); |
| | | |
| | | //堆垛机任务写入后,回读一次,看是否成功 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | try { |
| | | // 日志记录 |
| | | BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class); |
| | |
| | | if (result != null && result.IsSuccess) { |
| | | Thread.sleep(200); |
| | | this.readStatus(); |
| | | // News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |
| | | } else { |