| | |
| | | return response; |
| | | } |
| | | |
| | | int writeAck = 0; |
| | | boolean commandResult = false; |
| | | do { |
| | | OperateResult result = siemensNet.Write("DB100.0", (short) 0); |
| | | if (result.IsSuccess) { |
| | | OperateResultExOne<byte[]> commandReadResult = siemensNet.Read("DB100.0", (short) 2); |
| | | if (commandReadResult.IsSuccess) { |
| | | short commandRead = siemensNet.getByteTransform().TransInt16(commandReadResult.Content, 0); |
| | | if (commandRead == 1) { |
| | | Thread.sleep(500); |
| | | }else { |
| | | commandResult = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | writeAck++; |
| | | Thread.sleep(200); |
| | | } while (writeAck < 5); |
| | | |
| | | if (!commandResult) { |
| | | response.setMessage("堆垛机命令下发[id:{}] >>>>> {}" + command.getCrnNo() + "任务状态位异常"); |
| | | return response; |
| | | } |
| | | |
| | | short[] array = new short[9]; |
| | | array[0] = command.getAckFinish().shortValue(); |
| | | array[1] = command.getTaskNo().shortValue(); |