| | |
| | | private int barcodeSize = 2; |
| | | public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | add(100);add(101);add(102); |
| | | add(200);add(201);add(202); |
| | | add(300);add(301);add(302); |
| | | add(103);add(104);add(105); |
| | | add(106);add(107);add(108); |
| | | }}; |
| | | |
| | | public boolean charge0; |
| | |
| | | charge1 = status[0]; |
| | | } |
| | | |
| | | // // 外形检测 - 102 |
| | | // 外形检测 - 102 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result102 = siemensS7Net.Read("DB102.110", (short)1); |
| | | if (result102.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result102.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(102); |
| | | staProtocol.setFrontErr(status[0]);// 前超限 |
| | | staProtocol.setBackErr(status[1]);// 后超限 |
| | | staProtocol.setHighErr(status[2]);// 高超限 |
| | | staProtocol.setLeftErr(status[3]);// 左超限 |
| | | staProtocol.setRightErr(status[4]);// 右超限 |
| | | staProtocol.setWeightErr(status[5]); // 超重 |
| | | staProtocol.setBarcodeErr(status[6]);// 扫码失败 |
| | | } |
| | | // // 外形检测 - 201 |
| | | // Thread.sleep(50); |
| | | // 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(102); |
| | | // OperateResultExOne<byte[]> result201 = siemensS7Net.Read("DB102.112", (short)1); |
| | | // if (result201.IsSuccess) { |
| | | // boolean[] status = siemensS7Net.getByteTransform().TransBool(result201.Content, 0, 1); |
| | | // StaProtocol staProtocol = station.get(201); |
| | | // staProtocol.setFrontErr(status[0]); |
| | | // staProtocol.setBackErr(status[1]); |
| | | // staProtocol.setHighErr(status[2]); |
| | |
| | | // staProtocol.setWeightErr(status[5]); |
| | | // staProtocol.setBarcodeErr(status[6]); |
| | | // } |
| | | // // 外形检测 - 203 |
| | | // // 外形检测 - 301 |
| | | // Thread.sleep(50); |
| | | // 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(202); |
| | | // OperateResultExOne<byte[]> result301 = siemensS7Net.Read("DB102.114", (short)1); |
| | | // if (result301.IsSuccess) { |
| | | // boolean[] status = siemensS7Net.getByteTransform().TransBool(result301.Content, 0, 1); |
| | | // StaProtocol staProtocol = station.get(301); |
| | | // staProtocol.setFrontErr(status[0]); |
| | | // staProtocol.setBackErr(status[1]); |
| | | // staProtocol.setHighErr(status[2]); |
| | |
| | | // staProtocol.setWeightErr(status[5]); |
| | | // staProtocol.setBarcodeErr(status[6]); |
| | | // } |
| | | |
| | | |
| | | if (result.IsSuccess && result1.IsSuccess) { |
| | | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); |
| | | |
| | | // 根据实时信息更新数据库 |