| | |
| | | } |
| | | |
| | | private boolean clearCommandArea() throws InterruptedException { |
| | | boolean confirmClearResult = clearCommandConfirm(); |
| | | if (!confirmClearResult) { |
| | | return false; |
| | | } |
| | | |
| | | short[] array = new short[10]; |
| | | |
| | | int clearIdx = 0; |
| | |
| | | return false; |
| | | } |
| | | |
| | | private boolean clearCommandConfirm() throws InterruptedException { |
| | | int clearConfirmIdx = 0; |
| | | do { |
| | | OperateResult result = siemensNet.Write("DB100.18", (short) 0); |
| | | if (result.IsSuccess) { |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.18", (short) 2); |
| | | if (resultRead.IsSuccess) { |
| | | short confirm = siemensNet.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | if (confirm == 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | clearConfirmIdx++; |
| | | Thread.sleep(200); |
| | | } while (clearConfirmIdx < 5); |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private boolean isCommandAreaEmpty(byte[] content) { |
| | | short ackFinish = siemensNet.getByteTransform().TransInt16(content, 0); |
| | | short taskNo = siemensNet.getByteTransform().TransInt16(content, 2); |