| | |
| | | String IDStatus1=plcmes.getPlcParameter("IDStatus1").getValue();//1号任务完成 |
| | | String MESToPLCStatus1=plcmes.getPlcParameter("MESToPLCStatus1").getValue();//1号确认字 |
| | | String MESToPLC=plcmes.getPlcParameter("MESToPLC").getValue();//发送任务字 |
| | | // String scan=plcmes.getPlcParameter("scan").getValue();//发送扫码信息 |
| | | // if(scan.equals("1")==true){ |
| | | // spianService.scan(scan); |
| | | // } |
| | | |
| | | //一号线请求 |
| | | |
| | | if(ExportTOMES1!=null&&MESToPLC!=null){ |
| | | if (ExportTOMES1.equals("1") == true&&MESToPLC.equals("0")==true) { |
| | | |
| | | spianService.selectout(1); |
| | | } |
| | | } |
| | | // //二线号请求时 |
| | | if(ExportToMES2!=null &&MESToPLC!=null){ |
| | | if (ExportToMES2.equals("1") == true&&MESToPLC.equals("0")==true) { |
| | | spianService.selectout(2); |
| | | } |
| | | } |
| | | // if(ExportToMES2!=null &&MESToPLC!=null){ |
| | | // if (ExportToMES2.equals("1") == true&&MESToPLC.equals("0")==true) { |
| | | // spianService.selectout(2); |
| | | // } |
| | | // } |
| | | //进片请求时 |
| | | |
| | | GlassInfo glass=albaniaMapper.SelectGlass(); |
| | | if(PLCToMES!=null && glass!=null&&MESToPLC!=null){ |
| | | if(PLCToMES.equals("1")==true&&MESToPLC.equals("0")==true){ |
| | | |
| | | spianService.selectAll(glass); |
| | | } |
| | | } |
| | | |
| | | |
| | | // System.out.println("IDStatus1:"+IDStatus1+"MESToPLCStatus1:"+MESToPLCStatus1); |
| | | //任务完成时 |
| | | if(IDStatus1.equals("1")==true && MESToPLCStatus1.equals("0")==true){ |
| | | //完成确认字 |
| | | for(int i=1;i<7;i++){ |
| | | |
| | | String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//PLC理片任务状态汇报 |
| | | String Glassid=plcmes.getPlcParameter("MESID"+i).getValueString();//MES玻璃ID |
| | | GlassInfo id=albaniaMapper.SelectTaskId(Glassid); |
| | |
| | | storageCageService.FinishTask(id.getId()); |
| | | } |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//完成确认字 |
| | | System.out.println("完成确认字MESToPLCStatus"); |
| | | |
| | | } |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 0);//清除任务发送字 |
| | | System.out.println("清除任务发送字MESToPLC"); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//依次获取任务汇报 |
| | | if(Tastover.equals("0")){ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 0);//清除确认字 |
| | | System.out.println("清除确认字MESToPLCStatus"); |
| | | } |
| | | } |
| | | } |