| | |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 3000000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassTask() throws InterruptedException { |
| | | try { |
| | | //获取是否有上片请求 |
| | |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage, workId); |
| | | |
| | | } |
| | | }else { |
| | | //请求字为零时,任务字清零 |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 0); |
| | | } |
| | | //执行后休眠300毫秒 |
| | | //Thread.sleep(300); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassReport(){ |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | | if (loadStatus != null) { |
| | |
| | | overTask(loadStatus,100); |
| | | } |
| | | } |
| | | //执行后休眠300毫秒 |
| | | //Thread.sleep(300); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | public void overTask(String loadStatus,int state) throws InterruptedException { |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectOverTask(); |
| | | if (upPattenUsage != null) { |
| | | log.info("收到汇报清{}状态",loadStatus); |