| | |
| | | errMsg = "右超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.getWeight() > 1000) { |
| | | if (!back && staProtocol.getWeight() > 15000) { |
| | | errMsg = "超重或未读取"; |
| | | back = true; |
| | | } |
| | |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | staProtocol.setWorkNo(wrkNo); |
| | | staProtocol.setWorkNo(wrkNo);//退回 工作号:10000 |
| | | News.info("{}PLC入库回退:{},任务号:{}", inSta.getStaNo(), errMsg, wrkNo); |
| | | wrkNo++; |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | |
| | | |
| | | } |
| | | } |
| | | // News.infoNoLog(""+mark+" - 0"+" - 组托 ===》执行完成"); |
| | | News.infoNoLog(""+mark+" - 0"+" - 组托 ===》执行完成"); |
| | | |
| | | } |
| | | |
| | |
| | | // 退回 |
| | | // if (back) { |
| | | // log.info("errmsg: " + errMsg); |
| | | //// News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | // MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg)); |
| | | // if (!staProtocol.isLoading()) { |
| | | // continue; |
| | |
| | | // |
| | | // |
| | | // if (!Cools.isEmpty(barcode)) { |
| | | //// News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | // News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | // if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // continue; |
| | | // } |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // // 入出库模式判断 |
| | | // 入出库模式判断 |
| | | // if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; } |
| | | |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()) { |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | StaProtocol staProtocol1 = devpThread.getStation().get(crnStn.getStaNo() - 1); |
| | | StaProtocol staProtocol1 = staProtocol.getSiteId()==101?devpThread.getStation().get(crnStn.getStaNo() + 1):devpThread.getStation().get(crnStn.getStaNo() - 1); |
| | | // StaProtocol staProtocol1 = devpThread.getStation().get(crnStn.getStaNo() - 1); |
| | | // StaProtocol staProtocol1 = devpThread.getStation().get(crnStn.getStaNo() + 1); |
| | | if (staProtocol1 == null) { |
| | | News.infoNoLog("" + mark + " - 2" + " - 3" + " - 堆垛机出库站信息(staProtocol!=null继续执行,否则循环终止):staProtocol=" + staProtocol); |
| | | break; |
| | | } else { |
| | | staProtocol1 = staProtocol1.clone(); |
| | | } |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(crnStn.getStaNo() - 2); |
| | | StaProtocol staProtocol2 = staProtocol.getSiteId()==101?devpThread.getStation().get(crnStn.getStaNo() + 2):devpThread.getStation().get(crnStn.getStaNo()); |
| | | // StaProtocol staProtocol2 = devpThread.getStation().get(crnStn.getStaNo() - 2); |
| | | // StaProtocol staProtocol2 = devpThread.getStation().get(crnStn.getStaNo() + 2); |
| | | if (staProtocol2 == null) { |
| | | News.infoNoLog("" + mark + " - 2" + " - 3" + " - 堆垛机出库站信息(staProtocol!=null继续执行,否则循环终止):staProtocol=" + staProtocol); |
| | | break; |
| | |
| | | staProtocol2 = staProtocol2.clone(); |
| | | } |
| | | //出入口输送线只允许存在一个托盘 |
| | | if(staProtocol.isLoading() || staProtocol1.isLoading() || staProtocol2.isLoading() ) { |
| | | if(staProtocol.isLoading() || staProtocol1.isLoading() || staProtocol2.isLoading() || staProtocol.getWorkNo() != 0 || staProtocol1.getWorkNo() != 0 || staProtocol2.getWorkNo() != 0) { |
| | | break; |
| | | } |
| | | |
| | |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) { |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行对工作档的完成操作,任务号:" + crnProtocol.getTaskNo()); |
| | | |
| | | if (crnProtocol.getTaskNo() == 9999){ |
| | | crnThread.setResetFlag(true); |
| | | continue; |
| | | } |
| | | // 获取入库待确认工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep3(crnProtocol.getTaskNo().intValue()); |
| | | if (wrkMast == null) { |
| | |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(dto.getWorkNo()); |
| | | ledCommand.setIoType(1); |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setTitle("空板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | commands.add(ledCommand); |
| | |
| | | } |
| | | } |
| | | } |
| | | // News.infoNoLog(""+mark+" - 0"+" - 空栈板初始化入库,叉车入库站放货执行完成"); |
| | | News.infoNoLog(""+mark+" - 0"+" - 空栈板初始化入库,叉车入库站放货执行完成"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | |
| | | if ((crnProtocol.getCrnNo()==3 || crnProtocol.getCrnNo()==4) && crnProtocol.getBay()==0 && crnProtocol.getLevel() == 1) { |
| | | continue; |
| | | } |
| | | if ((crnProtocol.getCrnNo()==1 || crnProtocol.getCrnNo()==2) && crnProtocol.getBay()==1 && crnProtocol.getLevel() == 1) { |
| | | // if ((crnProtocol.getCrnNo()==3 || crnProtocol.getCrnNo()==4) && crnProtocol.getBay()==0 && crnProtocol.getLevel() == 1) { |
| | | // continue; |
| | | // } |
| | | // if ((crnProtocol.getCrnNo()==1 || crnProtocol.getCrnNo()==2) && crnProtocol.getBay()==1 && crnProtocol.getLevel() == 1) { |
| | | // continue; |
| | | // } |
| | | if (crnProtocol.getCrnNo()==1 && crnProtocol.getBay()==1 && crnProtocol.getLevel() == 1) { |
| | | continue; |
| | | } |
| | | Page<BasCrnOpt> basCrnOptPage = crnOptService.selectPage(new Page<>(1, 1), new EntityWrapper<BasCrnOpt>().eq("crn_no", crn.getId()).orderBy("send_time", false)); |
| | |
| | | News.info("堆垛机无任务自动回入库口待机==>>" + crnProtocol.getCrnNo() + "号堆垛机"); |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | if (crnProtocol.getCrnNo()==3 || crnProtocol.getCrnNo()==4){ |
| | | // if (crnProtocol.getCrnNo()==3 || crnProtocol.getCrnNo()==4){ |
| | | // crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | | // crnCommand.setTaskNo((short) 9999); // 工作号 |
| | | // crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | // crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 堆垛机移动 |
| | | // crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | // crnCommand.setSourcePosY((short) 0); // 源库位列 |
| | | // crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | | // crnCommand.setDestinationPosX((short) 0); // 目标库位排 |
| | | // crnCommand.setDestinationPosY((short) 0); // 目标库位列 |
| | | // crnCommand.setDestinationPosZ((short) 0); // 目标库位层 |
| | | // crnCommand.setCommand((short) 1); |
| | | // }else { |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | | crnCommand.setTaskNo((short) 9999); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 堆垛机移动 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 0); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | | crnCommand.setDestinationPosX((short) 0); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 0); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) 0); // 目标库位层 |
| | | crnCommand.setCommand((short) 1); |
| | | }else { |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | | crnCommand.setTaskNo((short) 9999); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 堆垛机移动 |
| | | // crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 堆垛机移动 |
| | | crnCommand.setTaskMode(CrnTaskModeType.X_MOVE);//余姚锐麒回原点任务模式: 站位转移 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 1); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | |
| | | crnCommand.setDestinationPosY((short) 0); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) 0); // 目标库位层 |
| | | crnCommand.setCommand((short) 1); |
| | | } |
| | | // } |
| | | if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, crnCommand))) { |
| | | News.error("堆垛机移动命令下发失败,堆垛机号={},任务数据={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } |