| | |
| | | if (result.IsSuccess) { |
| | | System.out.println(MessageFormat.format("【{0}】[id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | readStatus(); |
| | | // readStatus(); |
| | | } else { |
| | | System.out.println(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | |
| | | /******************************************************************************************/ |
| | | /**************************************** 测试专用 *****************************************/ |
| | | /*****************************************************************************************/ |
| | | public static void main(String[] args) { |
| | | public static void main(String[] args) throws InterruptedException { |
| | | CrnSlave slave = new CrnSlave(); |
| | | slave.setId(1); |
| | | slave.setIp("192.168.6.9"); |
| | |
| | | System.out.println(JSON.toJSONString(crnThread.crnProtocol)); |
| | | |
| | | |
| | | Thread.sleep(5000L); |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(1); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 1); // 目标库位排 |
| | | command.setDestinationPosY((short) 5); // 目标库位列 |
| | | command.setDestinationPosZ((short) 3); // 目标库位层 |
| | | command.setDestinationPosY((short) 7); // 目标库位列 |
| | | command.setDestinationPosZ((short) 2); // 目标库位层 |
| | | crnThread.write(command); |
| | | |
| | | |