|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //出入库站点检测报警信息 | 
|---|
|  |  |  | 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]);//超重 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | for (Integer staNo : staNos2) { | 
|---|
|  |  |  | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".0", (short) 48); | 
|---|
|  |  |  | if (result5.IsSuccess) { | 
|---|
|  |  |  | StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | StaProtocol staProtocol300 = station.get(300); | 
|---|
|  |  |  | if (null == staProtocol) { | 
|---|
|  |  |  | staProtocol = new StaProtocol(); | 
|---|
|  |  |  | staProtocol.setSiteId(staNo); | 
|---|
|  |  |  | station.put(staNo, staProtocol); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | boolean[] status1 = siemensS7Net.getByteTransform().TransBool(result5.Content, 1, 1); | 
|---|
|  |  |  | staProtocol.setAutoing(staProtocol300.isAutoing());  // 自动 | 
|---|
|  |  |  | staProtocol.setLoading(!status1[2]);  // 有物 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (staNos3.contains(staNo) || staNos4.contains(staNo)) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staNo == 344) { | 
|---|
|  |  |  | staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result5.Content, 34));     // 工作号 | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result5.Content, 22));     // 工作号 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | for (Integer staNo : staNos3) { | 
|---|
|  |  |  | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".22.0", (short) 2); | 
|---|
|  |  |  | OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB" + staNo + ".218.0", (short) 2); | 
|---|
|  |  |  | if (result5.IsSuccess && result6.IsSuccess) { | 
|---|
|  |  |  | StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | short wrkNo1 = siemensS7Net.getByteTransform().TransInt16(result5.Content, 0); | 
|---|
|  |  |  | short wrkNo2 = siemensS7Net.getByteTransform().TransInt16(result6.Content, 0); | 
|---|
|  |  |  | short wrkNo = 0; | 
|---|
|  |  |  | if (wrkNo1 != 0) { | 
|---|
|  |  |  | wrkNo = wrkNo1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (wrkNo2 != 0) { | 
|---|
|  |  |  | wrkNo = wrkNo2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkNo);     // 工作号 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | for (Integer staNo : staNos4) { | 
|---|
|  |  |  | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".22.0", (short) 2); | 
|---|
|  |  |  | OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB" + staNo + ".250.0", (short) 2); | 
|---|
|  |  |  | if (result5.IsSuccess && result6.IsSuccess) { | 
|---|
|  |  |  | StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | short wrkNo1 = siemensS7Net.getByteTransform().TransInt16(result5.Content, 0); | 
|---|
|  |  |  | short wrkNo2 = siemensS7Net.getByteTransform().TransInt16(result6.Content, 0); | 
|---|
|  |  |  | short wrkNo = 0; | 
|---|
|  |  |  | if (wrkNo1 != 0) { | 
|---|
|  |  |  | wrkNo = wrkNo1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (wrkNo2 != 0) { | 
|---|
|  |  |  | wrkNo = wrkNo2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkNo);     // 工作号 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        //出入库站点检测报警信息 | 
|---|
|  |  |  | //        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]);//超重 | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        Thread.sleep(100); | 
|---|
|  |  |  | //        for (Integer staNo : staNos2) { | 
|---|
|  |  |  | //            OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".0", (short) 48); | 
|---|
|  |  |  | //            if (result5.IsSuccess) { | 
|---|
|  |  |  | //                StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | //                StaProtocol staProtocol300 = station.get(300); | 
|---|
|  |  |  | //                if (null == staProtocol) { | 
|---|
|  |  |  | //                    staProtocol = new StaProtocol(); | 
|---|
|  |  |  | //                    staProtocol.setSiteId(staNo); | 
|---|
|  |  |  | //                    station.put(staNo, staProtocol); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                boolean[] status1 = siemensS7Net.getByteTransform().TransBool(result5.Content, 1, 1); | 
|---|
|  |  |  | //                staProtocol.setAutoing(staProtocol300.isAutoing());  // 自动 | 
|---|
|  |  |  | //                staProtocol.setLoading(!status1[2]);  // 有物 | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                if (staNos3.contains(staNo) || staNos4.contains(staNo)) { | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                if (staNo == 344) { | 
|---|
|  |  |  | //                    staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result5.Content, 34));     // 工作号 | 
|---|
|  |  |  | //                }else { | 
|---|
|  |  |  | //                    staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result5.Content, 22));     // 工作号 | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        Thread.sleep(100); | 
|---|
|  |  |  | //        for (Integer staNo : staNos3) { | 
|---|
|  |  |  | //            OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".22.0", (short) 2); | 
|---|
|  |  |  | //            OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB" + staNo + ".218.0", (short) 2); | 
|---|
|  |  |  | //            if (result5.IsSuccess && result6.IsSuccess) { | 
|---|
|  |  |  | //                StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | //                short wrkNo1 = siemensS7Net.getByteTransform().TransInt16(result5.Content, 0); | 
|---|
|  |  |  | //                short wrkNo2 = siemensS7Net.getByteTransform().TransInt16(result6.Content, 0); | 
|---|
|  |  |  | //                short wrkNo = 0; | 
|---|
|  |  |  | //                if (wrkNo1 != 0) { | 
|---|
|  |  |  | //                    wrkNo = wrkNo1; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                if (wrkNo2 != 0) { | 
|---|
|  |  |  | //                    wrkNo = wrkNo2; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                staProtocol.setWorkNo(wrkNo);     // 工作号 | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        Thread.sleep(100); | 
|---|
|  |  |  | //        for (Integer staNo : staNos4) { | 
|---|
|  |  |  | //            OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB" + staNo + ".22.0", (short) 2); | 
|---|
|  |  |  | //            OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB" + staNo + ".250.0", (short) 2); | 
|---|
|  |  |  | //            if (result5.IsSuccess && result6.IsSuccess) { | 
|---|
|  |  |  | //                StaProtocol staProtocol = station.get(staNo); | 
|---|
|  |  |  | //                short wrkNo1 = siemensS7Net.getByteTransform().TransInt16(result5.Content, 0); | 
|---|
|  |  |  | //                short wrkNo2 = siemensS7Net.getByteTransform().TransInt16(result6.Content, 0); | 
|---|
|  |  |  | //                short wrkNo = 0; | 
|---|
|  |  |  | //                if (wrkNo1 != 0) { | 
|---|
|  |  |  | //                    wrkNo = wrkNo1; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                if (wrkNo2 != 0) { | 
|---|
|  |  |  | //                    wrkNo = wrkNo2; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                staProtocol.setWorkNo(wrkNo);     // 工作号 | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (result.IsSuccess && result1.IsSuccess) { | 
|---|
|  |  |  | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); | 
|---|