Beispiel #1
0
        public bool CyclePick()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 5000))
            {
                sTemp = string.Format("Time Out Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + " " + Step.eSeq.ToString() + sTemp;
                IO_SetY(yi.LODR_MgzInAC, false);
                IO_SetY(yi.LODR_MgzOutAC, false);
                ER_SetErr(ei.ETC_CycleTO, sTemp);
                Trace(sTemp);
                return(true);
            }

            if (Step.iCycle != PreStep.iCycle)
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                Trace(sTemp);
            }

            PreStep.iCycle = Step.iCycle;

            if (Stat.bReqStop)
            {
                //return true ;
            }

            bool r, c;

            switch (Step.iCycle)
            {
            default:
                sTemp = string.Format("Cycle Default Clear Step.iCycle={0:00}", Step.iCycle);
                return(true);

            case 10:
                if (IO_GetX(xi.LODR_MgzDetect1) || IO_GetX(xi.LODR_MgzDetect2))
                {
                    ER_SetErr(ei.LODR_SupplyFail, "Loader magazine sensor is detected");
                    return(true);
                }
                MoveCyl(ci.LODR_ClampUpDn, fb.Bwd);
                MoveCyl(ci.LODR_PusherFwBw, fb.Bwd);
                IO_SetY(yi.LODR_MgzInAC, true);
                IO_SetY(yi.LODR_MgzOutAC, false);
                Step.iCycle++;
                return(false);

            case 11:
                if (!CL_Complete(ci.LODR_ClampUpDn, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.LODR_PusherFwBw, fb.Bwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_YClmp, pv.LODR_YClmpWork);
                Step.iCycle++;
                return(false);

            case 12:
                if (!MT_GetStopPos(mi.LODR_YClmp, pv.LODR_YClmpWork))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_ZClmp, pv.LODR_ZClmpPickFwd);
                Step.iCycle++;
                return(false);

            case 13:
                if (!MT_GetStopPos(mi.LODR_ZClmp, pv.LODR_ZClmpPickFwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_YClmp, pv.LODR_YClmpPick);
                Step.iCycle++;
                return(false);

            case 14:
                if (!MT_GetStopPos(mi.LODR_YClmp, pv.LODR_YClmpPick))
                {
                    return(false);
                }
                m_tmDelay.Clear();
                Step.iCycle++;
                return(false);

            case 15:
                r = IO_GetX(xi.LODR_MgzDetect1) || IO_GetX(xi.LODR_MgzDetect2);      //둘다 보는게 좋긴한데 하나로 일단 감
                if (m_tmDelay.OnDelay(4000))
                {
                    IO_SetY(yi.LODR_MgzInAC, false);
                    IO_SetY(yi.LODR_MgzOutAC, false);
                    MT_GoAbsMan(mi.LODR_YClmp, pv.LODR_YClmpWork);
                    ER_SetErr(ei.LODR_SupplyFail, "The magazine sensor of the loader is not detected.");
                    return(true);
                }
                if (!r)
                {
                    return(false);
                }
                MoveMotr(mi.LODR_ZClmp, pv.LODR_ZClmpClampOn);
                Step.iCycle++;
                return(false);

            case 16:
                if (!MT_GetStopPos(mi.LODR_ZClmp, pv.LODR_ZClmpClampOn))
                {
                    return(false);
                }
                MoveCyl(ci.LODR_ClampUpDn, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 17:
                if (!CL_Complete(ci.LODR_ClampUpDn, fb.Fwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_ZClmp, pv.LODR_ZClmpPickBwd);
                Step.iCycle++;
                return(false);

            case 18:
                if (!MT_GetStopPos(mi.LODR_ZClmp, pv.LODR_ZClmpPickBwd))
                {
                    return(false);
                }
                IO_SetY(yi.LODR_MgzInAC, false);
                MoveMotr(mi.LODR_YClmp, pv.LODR_YClmpWork);
                Step.iCycle++;
                return(false);

            case 19:
                if (!MT_GetStopPos(mi.LODR_YClmp, pv.LODR_YClmpWork))
                {
                    return(false);
                }

                Stat.bSupply = false;



                //if(LOT.CrntLotData.sLotNo != LOT.LotList[0].sLotNo)
                //{
                //    LOT.CrntLotData = LOT.LotList[0];
                //    LOT.LotOpen(LOT.CrntLotData);
                //}
                //LOT.CrntLotData.iCnt++;

                //여기서는 그냥 메거진정보꺼내서 lotno에 입히기만 하고 WorkCycle에서 랏오픈.
                string sLot = LOT.PopMgz();


                //실제 시간은 어쩔수 없이 여기서 나우로 가져오지면 실제 SPC에서 데이터 남기는 랏스타트 시간과 약간의 딜레이가 있지만 크게 문제 없다.
                //다만 이시점에 폴더 확인 하고 랏오픈시점에 다음날로 넘어가면
                //IA10010000 을 19일날 두번째 돌리기 시작 했으면 20일날 데이터가 IA10010000_0이 아닌 IA10010000_1로 남게됨.

                //메거진 2개씩 돌리면 픽2번해서 랏이 따로따로 쪼개짐.. ㅜㅠ
                //랏넘버 입력 할때로 옮김.
                //string sLotNo = SPC.MAP.GetLotNo(sLot) ;

                DM.ARAY[ri.LODR].LotNo = sLot;    //sLotNo ;
                DM.ARAY[ri.LODR].SetStat(cs.Unknown);
                DM.ARAY[ri.LODR].ID = LOT.GetWorkMgzCnt().ToString();

                MoveMotr(mi.LODR_ZClmp, pv.LODR_ZClmpWorkStart);
                Step.iCycle++;
                return(false);

            case 20:
                if (!MT_GetStopPos(mi.LODR_ZClmp, pv.LODR_ZClmpWorkStart))
                {
                    return(false);
                }

                Step.iCycle = 0;
                return(true);
            }
        }
Beispiel #2
0
 private void btGetLotNo_Click(object sender, EventArgs e)
 {
     tbLotNo.Text = LOT.PopMgz();
 }