| | |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.0",(short)31); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*16,15, "UTF-8"); |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*16,13, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | | barcodeThread.setBarcode(barcode); |
| | |
| | | |
| | | // 外形检测 - 102 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB102.129.", (short)1); |
| | | OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB102.129", (short)1); |
| | | if (result4.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result4.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(2); // 102 |
| | | StaProtocol staProtocol = station.get(102); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |
| | | staProtocol.setHighErr(status[2]); |
| | |
| | | } |
| | | // 外形检测 - 203 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB102.130.", (short)1); |
| | | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB102.130", (short)1); |
| | | if (result5.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result5.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(25); // 203 |
| | | StaProtocol staProtocol = station.get(203); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |
| | | staProtocol.setHighErr(status[2]); |