|  |  |  | 
|---|
|  |  |  | if (pakout != null) { | 
|---|
|  |  |  | if (devpThread.ioModeOf2_5 != IoModeType.PAKOUT_MODE) { | 
|---|
|  |  |  | // 出库切换中 | 
|---|
|  |  |  | devpThread.ioModeOf2_5 = IoModeType.PAKOUT_BOOTING; | 
|---|
|  |  |  | WrkMast pakin = wrkMastService.selectWorkingPakin(1032); | 
|---|
|  |  |  | if (pakin == null && !devpThread.getStation().get(1032).isLoading() | 
|---|
|  |  |  | && !devpThread.getStation().get(1032).isLoading() | 
|---|
|  |  |  | && devpThread.getStation().get(1032).getWorkNo() == 0) { | 
|---|
|  |  |  | if (pakin == null && !devpThread.getStation().get(1031).isLoading() | 
|---|
|  |  |  | && !devpThread.getStation().get(1032).isLoading()) { | 
|---|
|  |  |  | // 出库模式 | 
|---|
|  |  |  | devpThread.ioModeOf2_5 = IoModeType.PAKOUT_MODE; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | // 入库 | 
|---|
|  |  |  | mainService.generateInboundWrk(); | 
|---|
|  |  |  | mainService.noLiftIn(); | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | // 出库 | 
|---|
|  |  |  | mainService.outFirst(); | 
|---|
|  |  |  | mainService.stnToOutStn();//输送线 | 
|---|
|  |  |  | 
|---|
|  |  |  | //                    mainService.shuttleOutExecute(); | 
|---|
|  |  |  | //提升机入库任务 | 
|---|
|  |  |  | mainService.liftInExecute(); | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | //提升机出库任务 | 
|---|
|  |  |  | mainService.liftOutExecute(); | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | //四向穿梭车任务完成 | 
|---|
|  |  |  | mainService.shuttleFinished(); | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | //执行移库任务 | 
|---|
|  |  |  | mainService.shuttleLocMoveExecute(); | 
|---|
|  |  |  | //                    //货叉提升机任务 | 
|---|
|  |  |  | 
|---|
|  |  |  | //                    mainService.liftIoExecute(); | 
|---|
|  |  |  | //提升机任务完成 | 
|---|
|  |  |  | mainService.liftFinished(); | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | //执行小车移动任务 | 
|---|
|  |  |  | mainService.shuttleMoveExecute(); | 
|---|
|  |  |  | // 异常信息记录 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 间隔 | 
|---|
|  |  |  | Thread.sleep(200); | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public enum IoModeType { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | NONE((short) 0, "未知"), | 
|---|
|  |  |  | PAKIN_BOOTING((short) 1, "入库启动中"), | 
|---|
|  |  |  | PAKIN_MODE((short) 2, "入库模式"), | 
|---|
|  |  |  | PAKOUT_BOOTING((short) 3, "出库启动中"), | 
|---|
|  |  |  | PAKOUT_MODE((short) 4, "出库模式"), | 
|---|
|  |  |  | NONE((short) 2, "未知"), | 
|---|
|  |  |  | PAKIN_MODE((short) 0, "入库模式"), | 
|---|
|  |  |  | PAKOUT_MODE((short) 1, "出库模式"), | 
|---|
|  |  |  | ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Short id; | 
|---|
|  |  |  | 
|---|
|  |  |  | * 读取状态 ====> 整块plc | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private void read() throws InterruptedException { | 
|---|
|  |  |  | // 更新入出库模式 | 
|---|
|  |  |  | updateIoMode(); | 
|---|
|  |  |  | int staNoSize = staNos2.size(); | 
|---|
|  |  |  | OperateResultExOne<byte[]> result = siemensS7Net.Read("DB82.14", (short) (staNoSize * 26)); | 
|---|
|  |  |  | if (result.IsSuccess) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 更新入出库模式 | 
|---|
|  |  |  | private void updateIoMode() throws InterruptedException { | 
|---|
|  |  |  | if (slave.getId() == 1 && this.ioModeOf2_5 != null) { | 
|---|
|  |  |  | if (this.ioModeOf2_5 != null && (this.ioModeOf2_5.id == 0 || this.ioModeOf2_5.id == 1)) { | 
|---|
|  |  |  | if (!siemensS7Net.Write("DB83.80", this.ioModeOf2_5.id).IsSuccess) { | 
|---|
|  |  |  | station.get(1031).setOutInModel(this.ioModeOf2_5.id); | 
|---|
|  |  |  | station.get(1032).setOutInModel(this.ioModeOf2_5.id); | 
|---|
|  |  |  | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2.5F入出库模式失败", this.ioModeOf2_5)); | 
|---|
|  |  |  | log.error("【{0}】写入输送线2.5F入出库模式失败。输送线plc编号={}", this.ioModeOf2_5); | 
|---|
|  |  |  | } | 
|---|