| | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | //D02id判断是否为空 确认是否空闲 允许进片 |
| | | String d02State = plcParameterObject.getPlcParameter("D02ID").getValue(); |
| | | String d03State = plcParameterObject.getPlcParameter("D03State").getValue(); |
| | | String d05State = plcParameterObject.getPlcParameter("D05State").getValue(); |
| | | String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress(); |
| | | |
| | | String mesD01Address = plcParameterObject.getPlcParameter("MESToD01").getAddress(); |
| | | String mesD04Address = plcParameterObject.getPlcParameter("MESToD04").getAddress(); |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | | if (!REQUEST_WORD.equals(d01ToMES)) { |
| | | log.info("请求字为{},结束本次扫描进卧转立任务", d01ToMES); |
| | | return; |
| | | } |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | |
| | | // Boolean flag01 = Boolean.FALSE; |
| | | // Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if (StringUtils.isNotBlank(d01Id) && !REQUEST_WORD.equals(d03State)) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD03Address); |
| | | if (StringUtils.isNotBlank(d01Id) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address); |
| | | } |
| | | if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD05Address); |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | log.info("进片大车非空闲"); |
| | | log.info("进片大车非空闲,结束送片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | if (!REQUEST_WORD.equals(d03ToMES) && !REQUEST_WORD.equals(d05ToMES)) { |
| | | log.info("卧转立没有送片请求,结束送片任务"); |
| | | return; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskType, Const.BIG_STORAGE_IN_RUN) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)); |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP); |
| | | //获取可以启动卧转立的任务线路 |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(wrapper); |
| | | if (CollectionUtils.isNotEmpty(feedTaskList)) { |
| | | if (feedTaskList.size() == 1) { |
| | | computeTargetByLine(feedTaskList.get(0).getLine()); |
| | |
| | | |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | |
| | | } |
| | | //向plc发送进片确认 |
| | | if (flag) { |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, (short) 1); |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, 1); |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return flag; |
| | |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getAddress(); |
| | | String outLine = line.equals(Const.A09_OUT_TARGET_POSITION) ? mesD03Address : mesD05Address; |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getTargetSlot()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | s7control.writeWord(outLine, (short) 1); |
| | | s7control.writeWord(outLine, 2); |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{}", line, outLine); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |