| | |
| | | response.setMessage("堆垛机命令下发[id:{}] >>>>> {}" + command.getCrnNo() + "堆垛机写入任务数据失败"); |
| | | return response; |
| | | } |
| | | } |
| | | |
| | | 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)); |