| | |
| | | } |
| | | |
| | | // 读取正面条码 |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB103.0", (short) (5 * 40)); |
| | | if (result2.IsSuccess) { |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB103.0", (short) (5 * 40)); |
| | | if (result3.IsSuccess) { |
| | | for (int i = 0; i < 5; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 40, 40, "UTF-8"); |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result3.Content, i * 40, 40, "UTF-8"); |
| | | if(!Cools.isEmpty()){ |
| | | barcode = barcode.trim(); |
| | | } |
| | | List<String> barcodeList = Arrays.stream(barcode.split(",")).collect(Collectors.toList()); |
| | | List<String> barcodeList = Arrays.stream(barcode.split(";")).collect(Collectors.toList()); |
| | | Iterator<String> iterator = barcodeList.iterator(); |
| | | while (iterator.hasNext()){ |
| | | String next = iterator.next(); |
| | |
| | | } |
| | | } |
| | | |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i+1); |
| | | if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | |
| | | String workNoAddress; |
| | | // 目标站地址 |
| | | String staNoAddress; |
| | | // 高度类型地址 |
| | | String heightAddress; |
| | | if (index < 16) { |
| | | workNoAddress = "DB100." + index * 4; |
| | | staNoAddress = "DB100." + (index * 4 + 2); |
| | | heightAddress = "DB104." + (index * 4 + 2); |
| | | } else { |
| | | workNoAddress = "DB100." + (400 + (index-16) * 4); |
| | | staNoAddress = "DB100." + (400 + (index-16) * 4 + 2); |