| | |
| | | @Value("${mes.maxHeight}") |
| | | private Integer maxHeight; |
| | | |
| | | @Value("${mes.minWidth}") |
| | | private Integer minWidth; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Value("${mes.minHeight}") |
| | | private Integer minHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("requestID").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | | |
| | |
| | | return; |
| | | } |
| | | log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 0); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 0); |
| | | return; |
| | | } |
| | | if (!"0".equals(confirmationWrodValue)) { |
| | |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } else if ("2".equals(requestWord)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | } else if ("3".equals(requestWord)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) { |
| | | log.info("该玻璃尺寸走人工下片,直接进片"); |
| | | } else { |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | } |
| | | else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | | DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | |
| | | log.info("无空架子,获取已绑定架子的流程卡信息,查看玻璃信息是否可被对调"); |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.FALSE); |
| | | log.info("获取架子上已绑定流程卡落架的数量及未落架的玻璃数据:{}", downGlassInfoDTOList); |
| | | if (CollectionUtils.isNotEmpty(downGlassInfoDTOList)) { |
| | | if (CollectionUtils.isEmpty(downGlassInfoDTOList)) { |
| | | log.info("已绑定流程卡均无未落架玻璃,请及时处理架子上的玻璃,清除流程卡,执行进片任务"); |
| | | } else { |
| | | //替换玻璃信息 |
| | |
| | | log.info("更新详情表内的状态失败"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //更新落架玻璃数量 |
| | | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setGlassId(glassInfo.getGlassId()); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType + ""); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setWidth((int) glassInfo.getWidth()); |
| | | downGlassTask.setHeight((int) glassInfo.getHeight()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, int taskType) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), (short) width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), (short) height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), (short) thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), (short) startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), (short) endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), (short) taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), (short) 1); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), 1); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |