| | |
| | | private short heartBeatVal = 1; |
| | | private StaError1 staError1; |
| | | public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | add(201);add(202);add(203);add(204);add(205); |
| | | add(101);add(102);add(103);add(104);add(105);add(106); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{ |
| | | add(1); add(2);add(3); |
| | | add(1); |
| | | }}; |
| | | public static final ArrayList<Integer> staNosErrList = new ArrayList<Integer>() {{ |
| | | add(201); add(203); add(205); |
| | | // add(201); add(203); add(205); |
| | | }}; |
| | | |
| | | /** |
| | | * 条码数量 |
| | | */ |
| | | private int barcodeSize = 3; |
| | | private int barcodeSize = 1; |
| | | |
| | | /** |
| | | * 入出库模式 |
| | |
| | | } |
| | | |
| | | // 外形检测 |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.700", (short) (staNosErrList.size() *4)); // 不连续,多读中间一个 |
| | | if (resultErr.IsSuccess){ |
| | | for (int i = 0;i<staNosErrList.size();i++){ |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4 + 2, 1); |
| | | StaProtocol staProtocol = station.get(staNosErrList.get(i)); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |
| | | staProtocol.setHighErr(status[2]); |
| | | staProtocol.setLeftErr(status[3]); |
| | | staProtocol.setRightErr(status[4]); |
| | | // staProtocol.setGroupSupportErr(status[5]); |
| | | staProtocol.setWeightErr(status[5]); |
| | | staProtocol.setBarcodeErr(status[6]); |
| | | // short goodsHeight = siemensS7Net.getByteTransform().TransInt16(resultErr.Content, i * 4 + 2); |
| | | // staProtocol.setGoodsHeight(goodsHeight); |
| | | } |
| | | } |
| | | // OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.700", (short) (staNosErrList.size() *4)); // 不连续,多读中间一个 |
| | | // if (resultErr.IsSuccess){ |
| | | // for (int i = 0;i<staNosErrList.size();i++){ |
| | | // boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4 + 2, 1); |
| | | // StaProtocol staProtocol = station.get(staNosErrList.get(i)); |
| | | // staProtocol.setFrontErr(status[0]); |
| | | // staProtocol.setBackErr(status[1]); |
| | | // staProtocol.setHighErr(status[2]); |
| | | // staProtocol.setLeftErr(status[3]); |
| | | // staProtocol.setRightErr(status[4]); |
| | | //// staProtocol.setGroupSupportErr(status[5]); |
| | | // staProtocol.setWeightErr(status[5]); |
| | | // staProtocol.setBarcodeErr(status[6]); |
| | | //// short goodsHeight = siemensS7Net.getByteTransform().TransInt16(resultErr.Content, i * 4 + 2); |
| | | //// staProtocol.setGoodsHeight(goodsHeight); |
| | | // } |
| | | // } |
| | | |
| | | // 故障信息反馈 |
| | | OperateResultExOne<byte[]> resultErr2 = siemensS7Net.Read("DB101.400", (short) (staNos.size() * 4)); |