| | |
| | | add(4010);add(4016); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> errorStaNos1 = new ArrayList<Integer>() {{ |
| | | add(1002);add(1012); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> errorStaNos2 = new ArrayList<Integer>() {{ |
| | | add(2107); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> errorStaNos4 = new ArrayList<Integer>() {{ |
| | | add(3007);add(3012); |
| | | }}; |
| | | |
| | | /** |
| | | * 条码数量 |
| | | */ |
| | |
| | | return writeStaNos5; |
| | | case 6: |
| | | return writeStaNos6; |
| | | default: |
| | | throw new CoolException("获取站点失败!"); |
| | | } |
| | | } |
| | | |
| | | private ArrayList<Integer> getErrorStaNo() { |
| | | switch (slave.getId()) { |
| | | case 1: |
| | | return errorStaNos1; |
| | | case 2: |
| | | return errorStaNos2; |
| | | case 4: |
| | | return errorStaNos4; |
| | | default: |
| | | throw new CoolException("获取站点失败!"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result3 = null; |
| | | result3 = siemensS7Net.Read("DB101.0", (short) (getErrorStaNo().size() * 8)); |
| | | if (result3.IsSuccess) { |
| | | for (int i = 0; i < getErrorStaNo().size(); i++) { |
| | | Integer siteId = getErrorStaNo().get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | staProtocol.setLocType1(siemensS7Net.getByteTransform().TransInt16(result.Content, i*8 + 4 )); // 库位高度 |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result3.Content, i*4, 2); |
| | | staProtocol.setF(status[0]); // 自动 |
| | | staProtocol.setLoading(status[1]); // 有物 |
| | | staProtocol.setInEnable(status[2]); // 可入 |
| | | staProtocol.setOutEnable(status[3]);// 可出 |
| | | staProtocol.setEmptyMk(status[4]); // 空板信号 |
| | | staProtocol.setFullPlt(status[5]); // 满托盘 |
| | | staProtocol.setHigh(status[6]); // 高库位 |
| | | staProtocol.setLow(status[7]); // 低库位 |
| | | staProtocol.setEmptyOutPalletRequire(status[8]); // 空托盘可出需求信号 |
| | | staProtocol.setEmptyInPalletRequire(status[9]); // 空托盘可入需求信号 |
| | | |
| | | if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { |
| | | staProtocol.setPakMk(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (result.IsSuccess && !Cools.isEmpty(result1) && result1.IsSuccess) { |
| | | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); |