| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean connect() { |
| | | boolean result = false; |
| | |
| | | } |
| | | StaProtocol staProtocol = station.get(barcodeSite2.get(i)); |
| | | if (staProtocol != null) { |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (next.length() < 7 || next.length() > 10 || !next.matches("[0-9]*")) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | staProtocol.setMatIdList(barcodeList); |
| | | } |
| | | } |
| | |
| | | //任务下发成功标识 |
| | | boolean writeFlag = false; |
| | | while (writeCount < 5) { |
| | | OperateResult writeResult1 = siemensS7Net.Write(workNoAddress, staProtocol.getWorkNo()); // 工作号 |
| | | OperateResult writeResult2 = siemensS7Net.Write(staNoAddress, staProtocol.getStaNo()); // 目标站 |
| | | if (!Cools.isEmpty(staProtocol.getHeight()) && heightAddress != null) { |
| | | OperateResult writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); // 目标站 |
| | | log.info("写入高度地址:{},{}", heightAddress, writeResult3); |
| | | OperateResult writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | | log.info("写入高度地址:{},{}", heightAddress, writeResult3); |
| | | if (!writeResult3.IsSuccess) { |
| | | //fangzhi xierukushibai,jiu duoxiejici,meixunhuan |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | |
| | | } |
| | | } |
| | | } |
| | | OperateResult writeResult1 = siemensS7Net.Write(workNoAddress, staProtocol.getWorkNo()); // 工作号 |
| | | OperateResult writeResult2 = siemensS7Net.Write(staNoAddress, staProtocol.getStaNo()); // 目标站 |
| | | if (writeResult1.IsSuccess && writeResult2.IsSuccess) { |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index * 4, (short) 2); |