| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol.getWaiting() && steProtocol.getTaskNo() == 0){ |
| | | log.info("ste[id={}] 收到等待WCS确认信号,但是任务号(地址V824)为0", steProtocol.getSteNo()); |
| | | } |
| | | |
| | | if (steProtocol.getWaiting() && steProtocol.getTaskNo() != 0) { |
| | | log.info("ste[id={}] 执行工作档完成,任务号={}", steProtocol.getSteNo(), steProtocol.getTaskNo()); |
| | | if (steProtocol.getTaskNo() == 9999) { |
| | |
| | | |
| | | // 任务完成 |
| | | } else { |
| | | log.info("收到穿梭板确认信号后准备给复位标记,穿梭板ID={}, 任务号={}, 穿梭板状态={}",slave.getId(), steProtocol.getTaskNo(),steProtocol.getStatus()); |
| | | siemensS7Net.Write("V998", (short) 0); |
| | | siemensS7Net.Write("V1000", (short) 0); |
| | | result = siemensS7Net.Write("V2000.1", true); |
| | |
| | | |
| | | log.info("穿梭车命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | OutputQueue.STE.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | |
| | | try { |
| | | Thread.sleep(200); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | OperateResultExOne<byte[]> result1 = siemensS7Net.Read("V998", (short) 4); |
| | | if (result1.IsSuccess) { |
| | | short taskNo = siemensS7Net.getByteTransform().TransInt16(result1.Content, 0); |
| | | short taskType = siemensS7Net.getByteTransform().TransInt16(result1.Content, 2); |
| | | log.info("穿梭板任务下发成功后休眠200ms立即回读写入数据,穿梭板ID={}, 任务号={}, 作业类型={}",slave.getId(), taskNo, taskType); |
| | | } |
| | | |
| | | return true; |
| | | } else { |
| | | OutputQueue.STE.offer(MessageFormat.format("【{0}】写入穿梭车plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort())); |