| | |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol5)); |
| | | } |
| | | } else { |
| | | short workNo = staProtocol.getWorkNo(); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo((short) 112); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol)); |
| | | if(staProtocol.isLoading() && (staProtocol.getStaNo() == 105 || staProtocol.getStaNo() == 110 || staProtocol.getStaNo() == 111)){ |
| | | short workNo = staProtocol.getWorkNo(); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo((short) 112); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | StaProtocol staProtocol = devpThread.getStation().get(112); |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(116); |
| | | // StaProtocol staProtocol3 = devpThread.getStation().get(117); |
| | | // if(Objects.equals(staProtocol3.getWorkNo(), staProtocol.getWorkNo()) && staProtocol.getWorkNo() != 0){ |
| | | // staProtocol.setWorkNo((short) 0); |
| | | // staProtocol.setStaNo((short) 0); |
| | | // MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // Thread.sleep(100); // 让 PLC 识别变化 |
| | | // } |
| | | if (staProtocol == null || staProtocol.getWorkNo() == 0 || !staProtocol.isLoading() ) { |
| | | continue; |
| | | } |
| | | if(staProtocol.getStaNo() != 112){ |
| | | continue; |
| | | } |
| | | if(staProtocol.getWorkNo() == staProtocol2.getWorkNo()) { |
| | | if (staProtocol.getStaNo() != 112 || staProtocol.getWorkNo() == 0 || !staProtocol.isLoading() || staProtocol.getWorkNo() > 9000 || staProtocol.getWorkNo() < 6000) { |
| | | continue; |
| | | } |
| | | // 查询任务信息 |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 先清零 |
| | | short workNo = staProtocol.getWorkNo(); |
| | | short oldStaNo = staProtocol.getStaNo(); |
| | | // staProtocol.setWorkNo((short) 0); |
| | | // staProtocol.setStaNo((short) 0); |
| | | // MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // Thread.sleep(100); // 让 PLC 识别变化 |
| | | |
| | | // 再写入目标站点 |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | |
| | | staProtocol.setStaNo((short)107); |
| | | }else if (staProtocol.getWorkNo()>=9851&&staProtocol.getWorkNo()<=9875) { |
| | | staProtocol.setStaNo((short)109); |
| | | }else{ |
| | | }else if (staProtocol.getWorkNo()>=9876 && staProtocol.getWorkNo() <= 9900){ |
| | | staProtocol.setStaNo((short)110); |
| | | } |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | } |
| | | int storeCount = basDevpService.getStoreCount(); |
| | | if(storeCount >= maxCount){ |
| | | log.error("输送线暂存数达到上限"); |
| | | log.error("输送线暂存数达到上限{}",storeCount); |
| | | break; |
| | | } |
| | | |