| | |
| | | |
| | | |
| | | public static final ArrayList<Integer> BarcodeList1 = new ArrayList<Integer>() {{ |
| | | add(1002); add(1004);add(1006); add(1008); |
| | | add(5);add(6);add(7);add(8); |
| | | }}; |
| | | public static final ArrayList<Integer> BarcodeList2 = new ArrayList<Integer>() {{ |
| | | add(1); add(2); add(3); add(4); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> ErrList1 = new ArrayList<Integer>() {{ |
| | | add(1002); add(1004);add(1006); add(1008); |
| | | }}; |
| | | public static final ArrayList<Integer> ErrList2 = new ArrayList<Integer>() {{ |
| | | add(1041); add(1043);add(1045); add(1047); |
| | | }}; |
| | | |
| | |
| | | return BarcodeList2; |
| | | }else { |
| | | return BarcodeList1; |
| | | } |
| | | |
| | | } |
| | | |
| | | private ArrayList<Integer> getErrList() { |
| | | if (slave.getId() == 1){ |
| | | return ErrList2; |
| | | }else { |
| | | return ErrList1; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | ArrayList<Integer> errList = getErrList(); |
| | | // 外形检测 |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.800", (short) (barcodeList.size() *6)); // 不连续,多读中间一个 |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.800", (short) (errList.size() *6)); // 不连续,多读中间一个 |
| | | if (resultErr.IsSuccess){ |
| | | for (int i = 0;i<barcodeList.size();i++){ |
| | | StaProtocol staProtocol = station.get(barcodeList.get(i)); |
| | | for (int i = 0;i<errList.size();i++){ |
| | | StaProtocol staProtocol = station.get(errList.get(i)); |
| | | short goodsHeight = siemensS7Net.getByteTransform().TransInt16(resultErr.Content, i * 4); |
| | | staProtocol.setGoodsHeight(goodsHeight); |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4+2, 1); |