| | |
| | | } |
| | | // 复位信号 |
| | | if (crnProtocol.getStatusType().equals(CrnStatusType.WAITING) && resetFlag) { |
| | | News.error("-------------------------------------------第一步、[堆垛机号:{}, 工作号:{}, 载货台信号:{}]==>> 状态为10,等待确认!!", |
| | | slave.getId(),crnProtocol.getTaskNo(), crnProtocol.getLoaded()==1 ? "有物" : "无物"); |
| | | // News.error("-------------------------------------------第一步、[堆垛机号:{}, 工作号:{}, 载货台信号:{}]==>> 状态为10,等待确认!!", |
| | | // slave.getId(),crnProtocol.getTaskNo(), crnProtocol.getLoaded()==1 ? "有物" : "无物"); |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setAckFinish((short) 1); |
| | | if (write(crnCommand)) { |
| | |
| | | if (command.getAckFinish() == 1) { |
| | | result = siemensNet.Write("DB100.0", (short) 1); |
| | | } else { |
| | | // 先清除下发确认位 |
| | | siemensNet.Write("DB100.18",(short) 0); |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | | array[0] = command.getAckFinish(); |
| | |
| | | array[7] = command.getDestinationPosY(); |
| | | array[8] = command.getDestinationPosZ(); |
| | | array[9] = command.getCommand(); |
| | | Thread.sleep(200); // 延迟写入 |
| | | result = siemensNet.Write("DB100.0", array); |
| | | |
| | | //堆垛机任务写入后,回读一次,看是否成功 |
| | |
| | | if (command.getAckFinish() == 1) { |
| | | result = siemensNet.Write("DB100.0", (short) 1); |
| | | } else { |
| | | // 先清除下发确认位 |
| | | siemensNet.Write("DB100.18",(short) 0); |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | | array[0] = command.getAckFinish(); |
| | |
| | | array[7] = command.getDestinationPosY(); |
| | | array[8] = command.getDestinationPosZ(); |
| | | array[9] = command.getCommand(); |
| | | Thread.sleep(200); // 延迟写入 |
| | | result = siemensNet.Write("DB100.0", array); |
| | | log.info(JSON.toJSONString(array)); |
| | | |