| | |
| | | do { |
| | | try{ |
| | | if(!result.IsSuccess ){ |
| | | if (!resetFlag){ |
| | | // if (!resetFlag){ |
| | | News.error("写入堆垛机plc数据失败,重新下发任务 写入直接失败 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSON(command),writeCount1); |
| | | result = siemensNet.Write("DB100.0", array); |
| | | } |
| | | // } |
| | | Thread.sleep(100); |
| | | writeCount1++; |
| | | continue; |
| | |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 18); |
| | | if (resultRead.IsSuccess) { |
| | | CrnCommand one = new CrnCommand(); |
| | | one.setAckFinish(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0)); |
| | | one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2)); |
| | | one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setSourcePosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6)); |
| | |
| | | || !command.getSourcePosX().equals(one.getSourcePosX()) || !command.getSourcePosY().equals(one.getSourcePosY()) |
| | | || !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX()) |
| | | || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ()) |
| | | || !command.getAckFinish().equals(one.getAckFinish()) |
| | | ){ |
| | | try{ |
| | | News.error("堆垛机命令地址写入后回读失败==>不一致[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if (!resetFlag){ |
| | | // if (!resetFlag){ |
| | | News.error("写入堆垛机plc数据失败,重新下发任务 回读不一致 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSON(command),writeCount1); |
| | | result = siemensNet.Write("DB100.0", array); |
| | | } |
| | | // } |
| | | writeCount1++; |
| | | continue; |
| | | } else { |
| | |
| | | // if (result != null && result.IsSuccess) { |
| | | // Thread.sleep(200); |
| | | // this.readStatus(); |
| | | //// News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | //// News.info("堆垛机命令下发[{}] >>>>> {}", 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 { |