| | |
| | | return response; |
| | | } |
| | | |
| | | if (!Cools.isEmpty(command.getLocNo())){ |
| | | OperateResult resultAck = siemensNet.Write("DB110." + command.getIndex() * 2, command.getValue()); |
| | | if (resultAck.IsSuccess) { |
| | | Integer index = command.getIndex()*2 + 200; |
| | | OperateResult resultAck1 = siemensNet.Write("DB110." + index, command.getValue()); |
| | | if (resultAck1.IsSuccess) { |
| | | News.info("库位橙色按钮命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | News.info("库位白色灯命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int writeConfirmIdx = 0; |
| | | boolean commandConfirmResult = false; |
| | | do { |
| | | OperateResult result = siemensNet.Write("DB100.18", (short) 1); |
| | | if (result.IsSuccess) { |
| | | OperateResultExOne<byte[]> commandReadResult = siemensNet.Read("DB100.18", (short) 2); |
| | | if (commandReadResult.IsSuccess) { |
| | | short commandRead = siemensNet.getByteTransform().TransInt16(commandReadResult.Content, 0); |
| | | if (commandRead == 0) { |
| | | Thread.sleep(500); |
| | | }else { |
| | | commandConfirmResult = true; |
| | | break; |
| | | int writeConfirmIdx = 0; |
| | | boolean commandConfirmResult = false; |
| | | do { |
| | | OperateResult result = siemensNet.Write("DB100.18", (short) 1); |
| | | if (result.IsSuccess) { |
| | | OperateResultExOne<byte[]> commandReadResult = siemensNet.Read("DB100.18", (short) 2); |
| | | if (commandReadResult.IsSuccess) { |
| | | short commandRead = siemensNet.getByteTransform().TransInt16(commandReadResult.Content, 0); |
| | | if (commandRead == 0) { |
| | | Thread.sleep(500); |
| | | }else { |
| | | commandConfirmResult = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | writeConfirmIdx++; |
| | | Thread.sleep(200); |
| | | } while (writeConfirmIdx < 1); |
| | | writeConfirmIdx++; |
| | | Thread.sleep(200); |
| | | } while (writeConfirmIdx < 1); |
| | | |
| | | if (!commandConfirmResult) { |
| | | News.error("堆垛机写入确认数据失败 ===>> [id:{}]", command.getCrnNo()); |
| | | response.setMessage("堆垛机写入确认数据失败"); |
| | | return response; |
| | | if (!commandConfirmResult) { |
| | | News.error("堆垛机写入确认数据失败 ===>> [id:{}]", command.getCrnNo()); |
| | | response.setMessage("堆垛机写入确认数据失败"); |
| | | return response; |
| | | } |
| | | } |
| | | |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", command.getCrnNo(), JSON.toJSON(command)); |