| | |
| | | add(341);add(346); |
| | | }}; |
| | | |
| | | //出入库站点检测报警信息 |
| | | public static final ArrayList<Integer> outInAlarmStaNos = new ArrayList<Integer>(){{ |
| | | add(101);add(102);add(104); |
| | | add(201);add(202);add(204); |
| | | add(340);add(345); |
| | | }}; |
| | | |
| | | public boolean charge0; |
| | | public boolean charge1; |
| | | |
| | |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB1000.200", (short) 98); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { |
| | | if (i >= 10) { |
| | | continue; |
| | | } |
| | | |
| | | String barcode = null; |
| | | if (i == 8) { |
| | | barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,13, "UTF-8"); |
| | |
| | | } |
| | | } |
| | | |
| | | //出入库站点检测报警信息 |
| | | Thread.sleep(100); |
| | | for (Integer staNo : outInAlarmStaNos) { |
| | | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".20.0", (short) 2); |
| | | if (result5.IsSuccess) { |
| | | if (staNo == 101 || staNo == 201) { |
| | | staNo--; |
| | | }else { |
| | | staNo++; |
| | | } |
| | | StaProtocol staProtocol = station.get(staNo); |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result5.Content, 0, 2); |
| | | staProtocol.setBarcodeErr(status[4]);//扫码失败 |
| | | staProtocol.setFrontErr(status[8]);//前超限 |
| | | staProtocol.setBackErr(status[9]);//后超限 |
| | | staProtocol.setLeftErr(status[10]);//左超限 |
| | | staProtocol.setRightErr(status[11]);//右超限 |
| | | staProtocol.setHighErr(status[12]);//超高 |
| | | staProtocol.setWeightErr(status[13]);//超重 |
| | | } |
| | | } |
| | | |
| | | if (result.IsSuccess && result1.IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); |
| | | |