Exemplo n.º 1
0
        public bool CycleWork()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 5000))
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + sTemp;
                ER_SetErr(ei.PRT_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 ;
            }

            int r, c = -1;

            switch (Step.iCycle)
            {
            default:
                sTemp = string.Format("Cycle Default Clear Step.iCycle={0:00}", Step.iCycle);
                //if(Step.iCycle != PreStep.iCycle)Trace(m_sPartName.c_str(), sTemp.c_str());
                return(true);

            case 10:
                MoveCyl(ci.LODR_PckrRtrCwCCw, fb.Fwd);
                MoveMotr(mi.LODR_XPckr, pv.LODR_XPckrPickRtt);

                Step.iCycle++;
                return(false);

            case 11:
                if (!CL_Complete(ci.LODR_PckrRtrCwCCw, fb.Fwd))
                {
                    return(false);
                }
                if (!MT_GetStopPos(mi.LODR_XPckr, pv.LODR_XPckrPickRtt))
                {
                    return(false);
                }
                MoveCyl(ci.LODR_GrpRtrCwCCw, fb.Bwd);
                MoveCyl(ci.LODR_RngGrpFwBw, fb.Bwd);
                Step.iCycle++;
                return(false);

            case 12:
                if (!CL_Complete(ci.LODR_RngGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.LODR_GrpRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_XPckr, pv.LODR_XPckrPick);
                Step.iCycle++;
                return(false);

            case 13:
                if (!MT_GetStopPos(mi.LODR_XPckr, pv.LODR_XPckrPick))
                {
                    return(false);
                }
                MT_GoAbsVel(mi.LODR_XPckr, PM.GetValue(mi.LODR_XPckr, pv.LODR_XPckrPick) + 1, 10);
                Step.iCycle++;
                return(false);

            case 14:
                if (!MT_GetStopInpos(mi.LODR_XPckr))
                {
                    return(false);
                }
                //MoveMotr(mi.LODR_XPckr, pv.LODR_XPckrPick);
                Step.iCycle++;
                return(false);

            case 15:
                //if (!MT_GetStopPos(mi.LODR_XPckr, pv.LODR_XPckrPick)) return false;
                MoveCyl(ci.LODR_RngGrpFwBw, fb.Fwd);
                IO_SetY(yi.LODR_PickrVac, false);
                Step.iCycle++;
                return(false);

            case 16:
                if (!CL_Complete(ci.LODR_RngGrpFwBw, fb.Fwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_XPckr, pv.LODR_XPckrPlceRtt);
                Step.iCycle++;
                return(false);

            case 17:
                if (!MT_GetStopInpos(mi.LODR_XPckr))
                {
                    return(false);
                }
                MoveCyl(ci.LODR_GrpRtrCwCCw, fb.Fwd);
                MoveCyl(ci.LODR_PckrRtrCwCCw, fb.Bwd);
                Step.iCycle++;
                return(false);

            case 18:
                if (!CL_Complete(ci.LODR_GrpRtrCwCCw, fb.Fwd))
                {
                    return(false);
                }
                MoveMotr(mi.LODR_XPckr, pv.LODR_XPckrPlce);
                Step.iCycle++;
                return(false);

            case 19:
                if (!MT_GetStopInpos(mi.LODR_XPckr))
                {
                    return(false);
                }
                //MoveCyl(ci.LODR_RngGrpFwBw , fb.Bwd);
                Step.iCycle++;
                return(false);

            case 20:
                if (!CL_Complete(ci.LODR_PckrRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                DM.ShiftData(ri.PLDR, ri.TLDR);
                Step.iCycle = 0;
                return(true);
            }
        }
Exemplo n.º 2
0
        public bool CycleWork()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 5000))
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + sTemp;
                ER_SetErr(ei.PRT_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 ;
            }

            int c, r;

            switch (Step.iCycle)
            {
            default:
                sTemp = string.Format("Cycle Default Clear Step.iCycle={0:00}", Step.iCycle);
                //if(Step.iCycle != PreStep.iCycle)Trace(m_sPartName.c_str(), sTemp.c_str());
                return(true);

            case 10:
                if (!IO_GetX(xi.TBLE_ULDRPkgDtct))
                {
                    ER_SetErr(ei.PKG_Dispr, "PreUnLoader Disappear PKG Error.");
                    Step.iCycle = 0;
                    return(true);
                }
                MoveCyl(ci.ULDR_GrpRtrCwCCw, fb.Bwd);
                MoveCyl(ci.ULDR_RngGrpFwBw, fb.Bwd);
                Step.iCycle++;
                return(false);

            case 11:
                if (!CL_Complete(ci.ULDR_GrpRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.ULDR_RngGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                MoveCyl(ci.ULDR_GrpFwBw, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 12:
                if (!CL_Complete(ci.ULDR_GrpFwBw, fb.Fwd))
                {
                    return(false);
                }
                MoveCyl(ci.ULDR_RngGrpFwBw, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 13:
                if (!CL_Complete(ci.ULDR_RngGrpFwBw, fb.Fwd))
                {
                    return(false);
                }
                MoveCyl(ci.ULDR_GrpRtrCwCCw, fb.Fwd);
                MoveCyl(ci.ULDR_GrpFwBw, fb.Bwd);
                Step.iCycle++;
                return(false);

            case 14:
                if (!CL_Complete(ci.ULDR_GrpRtrCwCCw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.ULDR_GrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                DM.ShiftData((int)ri.TULD, (int)ri.PULD);
                Step.iCycle = 0;
                return(true);
            }
        }
Exemplo n.º 3
0
        public bool CycleMove()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 20000))
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + sTemp;
                ER_SetErr(ei.PRT_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 ;
            }

            switch (Step.iCycle)
            {
            default:
                sTemp = string.Format("Cycle Default Clear Step.iCycle={0:00}", Step.iCycle);
                //if(Step.iCycle != PreStep.iCycle)Trace(m_sPartName.c_str(), sTemp.c_str());
                return(true);

            case 10:
                OM.EqpStat.dWorkTime = SEQ.bWorkTimer ? SEQ.m_cyWorktime.CheckTime_s() : 0;
                OM.EqpStat.dWorkUPH  = SEQ.bWorkTimer ? 3600 / OM.EqpStat.dWorkTime : 0;
                SEQ.m_cyWorktime.Clear();
                SEQ.bWorkTimer = true;
                MoveCyl(ci.TBLE_Grpr1FwBw, fb.Bwd);
                MoveCyl(ci.TBLE_Grpr2FwBw, fb.Bwd);
                MoveCyl(ci.TBLE_Grpr3FwBw, fb.Bwd);
                MoveCyl(ci.TBLE_Grpr4FwBw, fb.Bwd);
                MoveCyl(ci.TBLE_Grpr5FwBw, fb.Bwd);
                MoveCyl(ci.TBLE_Grpr6FwBw, fb.Bwd);
                Step.iCycle++;
                return(false);

            case 11:
                if (!CL_Complete(ci.TBLE_Grpr1FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr2FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr3FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr4FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr5FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr6FwBw, fb.Bwd))
                {
                    return(false);
                }
                if (IO_GetX(xi.TBLE_LODRClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "LODR Clamp Cylinder Is Not Bwd"); return(true);
                }
                if (IO_GetX(xi.TBLE_VISNClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "Visn Clamp Cylinder Is Not Bwd"); return(true);
                }
                if (IO_GetX(xi.TBLE_MARKClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "MARK Clamp Cylinder Is Not Bwd"); return(true);
                }
                if (IO_GetX(xi.TBLE_ULDRClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "ULDR Clamp Cylinder Is Not Bwd"); return(true);
                }
                if (IO_GetX(xi.TBLE_RJEVClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "RJEV Clamp Cylinder Is Not Bwd"); return(true);
                }
                if (IO_GetX(xi.TBLE_RJEMClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "RJEM Clamp Cylinder Is Not Bwd"); return(true);
                }
                MoveCyl(ci.LODR_RngGrpFwBw, fb.Bwd);
                MoveCyl(ci.VISN_TurnGrpFwBw, fb.Bwd);
                if (OM.MstOptn.bMarkAlgin)
                {
                    MoveCyl(ci.MARK_AlgnFwBw, fb.Bwd);
                    MoveCyl(ci.MARK_AlgnPinFwBw, fb.Bwd);
                }
                Step.iCycle++;
                return(false);

            case 12:
                if (!CL_Complete(ci.LODR_RngGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.VISN_TurnGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                if (OM.MstOptn.bMarkAlgin && !CL_Complete(ci.MARK_AlgnFwBw, fb.Bwd))
                {
                    return(false);
                }
                if (OM.MstOptn.bMarkAlgin && !CL_Complete(ci.MARK_AlgnPinFwBw, fb.Bwd))
                {
                    return(false);
                }

                MT_GoIncRun(mi.TBLE_TTble, PM.GetValue(mi.TBLE_TTble, pv.TBLE_TTbleWorkPitch));
                Step.iCycle++;
                return(false);

            case 13:
                if (!MT_GetStopInpos(mi.TBLE_TTble))
                {
                    return(false);
                }
                m_tmDelay.Clear();
                Step.iCycle++;
                return(false);


            case 14:
                if (!m_tmDelay.OnDelay(50))
                {
                    return(false);
                }
                Step.iCycle++;
                return(false);

            case 15:
                DM.ShiftData(ri.TRJM, ri.TRJV);
                DM.ShiftData(ri.TULD, ri.TRJM);
                DM.ShiftData(ri.TMRK, ri.TULD);
                DM.ShiftData(ri.TVSN, ri.TMRK);
                //Marking 위치가 굿으로 바뀌어있으면 Unkwon으로 바꾸자.
                if (DM.ARAY[ri.TMRK].CheckAllStat(cs.Good))
                {
                    DM.ARAY[ri.TMRK].SetStat(cs.Unknown);
                }
                DM.ShiftData(ri.TLDR, ri.TVSN);
                if (!DM.ARAY[ri.TVSN].CheckAllStat(cs.None))
                {
                    MoveCyl(ci.VISN_TurnGrpFwBw, fb.Fwd);
                }
                else
                {
                    MoveCyl(ci.VISN_TurnGrpFwBw, fb.Bwd);
                }
                //if( DM.ARAY[ri.TULD].CheckAllStat(cs.Good)) MoveCyl(ci.ULDR_RngGrpFwBw  , fb.Fwd);
                //else                                        MoveCyl(ci.ULDR_RngGrpFwBw  , fb.Bwd);
                Step.iCycle++;
                return(false);

            case 16:
                if (!DM.ARAY[ri.TVSN].CheckAllStat(cs.None) && !CL_Complete(ci.VISN_TurnGrpFwBw, fb.Fwd))
                {
                    return(false);
                }
                if (DM.ARAY[ri.TVSN].CheckAllStat(cs.None) && !CL_Complete(ci.VISN_TurnGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                //if ( DM.ARAY[ri.TULD].CheckAllStat(cs.Good) && CL_Complete(ci.ULDR_RngGrpFwBw , fb.Fwd))return false;
                //if (!DM.ARAY[ri.TULD].CheckAllStat(cs.Good) && CL_Complete(ci.ULDR_RngGrpFwBw , fb.Bwd))return false;
                MoveCyl(ci.TBLE_Grpr1FwBw, fb.Fwd);
                MoveCyl(ci.TBLE_Grpr2FwBw, fb.Fwd);
                MoveCyl(ci.TBLE_Grpr3FwBw, fb.Fwd);
                MoveCyl(ci.TBLE_Grpr4FwBw, fb.Fwd);
                MoveCyl(ci.TBLE_Grpr5FwBw, fb.Fwd);
                MoveCyl(ci.TBLE_Grpr6FwBw, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 17:
                if (!CL_Complete(ci.TBLE_Grpr1FwBw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr2FwBw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr3FwBw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr4FwBw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr5FwBw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.TBLE_Grpr6FwBw, fb.Fwd))
                {
                    return(false);
                }
                m_tmDelay.Clear();
                Step.iCycle++;
                return(false);

            case 18:
                if (!m_tmDelay.OnDelay(100))
                {
                    return(false);
                }
                if (!IO_GetX(xi.TBLE_LODRClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "LODR Clamp Cylinder Is Not Fwd"); return(true);
                }
                if (!IO_GetX(xi.TBLE_VISNClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "Visn Clamp Cylinder Is Not Fwd"); return(true);
                }
                if (!IO_GetX(xi.TBLE_MARKClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "MARK Clamp Cylinder Is Not Fwd"); return(true);
                }
                if (!IO_GetX(xi.TBLE_ULDRClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "ULDR Clamp Cylinder Is Not Fwd"); return(true);
                }
                if (!IO_GetX(xi.TBLE_RJEVClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "RJEV Clamp Cylinder Is Not Fwd"); return(true);
                }
                if (!IO_GetX(xi.TBLE_RJEMClmpDtct))
                {
                    ER_SetErr(ei.ATR_TimeOut, "RJEM Clamp Cylinder Is Not Fwd"); return(true);
                }

                Step.iCycle = 0;
                return(true);
            }
        }