Example #1
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            LbStat1.BackColor = SM.MT_GetNLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat2.BackColor = SM.MT_GetHomeSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat3.BackColor = SM.MT_GetPLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat4.BackColor = SM.MT_GetAlarmSgnl(m_eId) ? Color.Lime : Color.Silver;
            LbStat5.BackColor = SM.MT_GetServo(m_eId) ? Color.Lime : Color.Silver;
            LbStat6.BackColor = SM.MT_GetStop(m_eId) ? Color.Lime : Color.Silver;
            LbStat7.BackColor = SM.MT_GetHomeDone(m_eId) ? Color.Lime : Color.Silver;

            LbCmdPos.Text = string.Format("{0:0.0000}", SM.MT_GetCmdPos(m_eId));
            LbEncPos.Text = string.Format("{0:0.0000}", SM.MT_GetEncPos(m_eId));

            if (SEQ._bRun || MM.GetManNo() != mc.NoneCycle)
            {
                btNeg.Enabled = false;
                btPos.Enabled = false;
            }

            else
            {
                btNeg.Enabled = true;
                btPos.Enabled = true;
            }
            tmUpdate.Enabled = true;
        }
Example #2
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            string sTemp;;

            tmUpdate.Enabled = false;

            lbStat1.ForeColor = SM.MT_GetNLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat2.ForeColor = SM.MT_GetHomeSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat3.ForeColor = SM.MT_GetPLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat4.ForeColor = SM.MT_GetHomeDone(m_eId) ? Color.Red : Color.Silver;
            lbStat5.ForeColor = SM.MT_GetAlarmSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat6.ForeColor = SM.MT_GetStop(m_eId) ? Color.Red : Color.Silver;
            lbStat7.ForeColor = SM.MT_GetInPosSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat8.ForeColor = SM.MT_GetServo(m_eId) ? Color.Red : Color.Silver;

            sTemp         = string.Format("{0:0.0000}", SM.MT_GetCmdPos(m_eId));
            lbCmdPos.Text = sTemp;

            if (SM.MT_GetHoming(m_eId))
            {
                btHome.ForeColor = SEQ._bFlick ? Color.Lime : Color.Black;
            }
            else
            {
                btHome.ForeColor = Color.Black;
            }
            tmUpdate.Enabled = true;
        }
Example #3
0
        override public bool ToStop() //스탑을 하기 위한 함수.
        {
            //Check Time Out.
            if (m_tmToStop.OnDelay(Step.iToStop != 0 && PreStep.iToStop != 0 && PreStep.iToStop == Step.iToStop && CheckStop(), 10000))
            {
                ER_SetErr(ei.ETC_ToStopTO, m_sPartName);                                                                                                                         //EM_SetErr(eiLDR_ToStartTO);
            }
            String sTemp;

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

            PreStep.iToStop = Step.iToStop;

            Stat.bReqStop = false;

            //Move Home.
            switch (Step.iToStop)
            {
            default:
                Step.iToStop = 0;
                return(true);

            case 10:


                OM.EqpStat.dLastIDXFPos = SM.MT_GetCmdPos(mi.IDXF_XFrnt);
                Step.iToStop++;
                return(false);

            case 11:

                Step.iToStop++;
                return(false);

            case 12:
                Step.iToStop++;
                return(false);

            case 13:
                Step.iToStop = 0;
                return(true);
            }
        }
Example #4
0
        override public bool Autorun() //오토런닝시에 계속 타는 함수.
        {
            //Check Cycle Time Out.
            String sTemp;

            sTemp = String.Format("%s Step.iCycle={0:00}", "Autorun", Step.iCycle);
            if (Step.eSeq != PreStep.eSeq)
            {
                Log.Trace(m_sPartName, sTemp);
            }


            PreStep.eSeq = Step.eSeq;

            string sCycle = GetCrntCycleName();

            //Check Error & Decide Step.
            if (Step.eSeq == sc.Idle)
            {
                if (Stat.bReqStop)
                {
                    return(false);
                }

                //if( DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && IO_GetX(xi.RAIL_TrayDtct1)) {ER_SetErr(ei.PKG_Unknwn , "Supplyer Unknwn PKG Error."   ); return false;}
                if (!OM.CmnOptn.bIdleRun && !DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1))
                {
                    ER_SetErr(ei.PKG_Dispr, "Supplyer Disappear PKG Error."); return(false);
                }

                //공급 부족 에러.
                if (!OM.CmnOptn.bIdleRun && !OM.CmnOptn.bGoldenTray)
                {
                    if ((!IO_GetX(xi.LODR_TrayDtct) && OM.GetSupplyCnt() < OM.DevInfo.iTRAY_StackingCnt) && LOT.LotOpened && !OM.EqpStat.bWrapingEnd)
                    {
                        ER_SetErr(ei.PRT_NeedTraySupply, "Supply Tray");
                    }
                }
                //int iFWorkCol = DM.ARAY[ri.IDXF].FindFrstCol(cs.Good);
                //int iRWorkCol = DM.ARAY[ri.IDXR].FindFrstCol(cs.Good);

                //작업열을 세팅하여 미리서플라이 가능하게 함.
                //bool bIdxFCanSply = (iFWorkCol!=-1) && DM.ARAY[ri.IDXF].GetMaxCol() - iFWorkCol >= OM.DevOptn.iIdxCanSplyCol ;
                //bool bIdxRCanSply = (iRWorkCol!=-1) && DM.ARAY[ri.IDXR].GetMaxCol() - iRWorkCol >= OM.DevOptn.iIdxCanSplyCol ;
                bool bIdxFSplyPos = !DM.ARAY[ri.IDXF].CheckAllStat(cs.None) && SM.MT_GetCmdPos(mi.IDXF_XFrnt) > OM.CmnOptn.dIdxFSplyPos;
                bool bIdxRSplyPos = !DM.ARAY[ri.IDXR].CheckAllStat(cs.None) && SM.MT_GetCmdPos(mi.IDXR_XRear) > OM.CmnOptn.dIdxRSplyPos;

                //인덱스 비어있음.
                bool bIdxFNone     = DM.ARAY[ri.IDXF].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1);
                bool bIdxRNone     = DM.ARAY[ri.IDXR].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1);
                bool bIdxFSplyStat = DM.ARAY[ri.IDXF].GetCntStat(cs.Empty) == DM.ARAY[ri.IDXF].GetMaxCol() * DM.ARAY[ri.IDXF].GetMaxRow() - DM.ARAY[ri.MASK].GetCntStat(cs.None) || DM.ARAY[ri.IDXF].GetCntStat(cs.Good) != 0;
                bool bIdxRSplyStat = DM.ARAY[ri.IDXR].GetCntStat(cs.Empty) == DM.ARAY[ri.IDXR].GetMaxCol() * DM.ARAY[ri.IDXR].GetMaxRow() - DM.ARAY[ri.MASK].GetCntStat(cs.None) || DM.ARAY[ri.IDXR].GetCntStat(cs.Good) != 0;

                //int  iTopCoverCnt  = 1 ;
                //int  iBtmCoverCnt  =
                bool isCycleSupply = DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && !OM.CmnOptn.bLoadingStop && !OM.EqpStat.bWrapingEnd &&
                                     (IO_GetX(xi.LODR_TrayDtct) || OM.CmnOptn.bIdleRun) && //로더에 자제 확인 하여.
                                     ((OM.GetSupplyCnt() < OM.DevInfo.iTRAY_StackingCnt && !OM.CmnOptn.bGoldenTray) || OM.CmnOptn.bIdleRun || (OM.GetSupplyCnt() == 0 && OM.CmnOptn.bGoldenTray)) &&
                                     ((bIdxRNone && bIdxFSplyStat && bIdxFSplyPos) || (bIdxFNone && bIdxRSplyStat && bIdxRSplyPos) || (bIdxRNone && bIdxFNone));


                bool isCycleEnd = DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && (OM.EqpStat.bWrapingEnd || OM.CmnOptn.bGoldenTray);   //;



                if (ER_IsErr())
                {
                    return(false);
                }
                //Normal Decide Step.
                if (isCycleSupply)
                {
                    Step.eSeq = sc.Supply;
                }
                else if (isCycleEnd)
                {
                    Stat.bWorkEnd = true; return(true);
                }
                Stat.bWorkEnd = false;

                if (Step.eSeq != sc.Idle)
                {
                    Log.Trace(m_sPartName, Step.eSeq.ToString() + " Start");
                    InitCycleStep();
                    m_CycleTime[(int)Step.eSeq].Start();
                }
            }

            //Cycle.
            Step.eLastSeq = Step.eSeq;
            switch (Step.eSeq)
            {
            default:                      Log.Trace(m_sPartName, "default End");                                    Step.eSeq = sc.Idle;   return(false);

            case (sc.Idle):                                                                                                                       return(false);

            case (sc.Supply): if (CycleSupply())
                {
                    Log.Trace(m_sPartName, sCycle + " End"); m_CycleTime[(int)Step.eSeq].End(); Step.eSeq = sc.Idle;
                }
                return(false);
            }
        }
Example #5
0
        //Manual Processing.
        public static bool SetManCycle(mc _iNo)
        {
            m_iCrntManNo = m_iManNo;

            if (_iNo < 0)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (_iNo >= mc.MAX_MANUAL_CYCLE)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (m_iManNo != mc.NoneCycle)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle"); return(false);
            }
            if (SEQ._bRun)
            {
                Log.ShowMessage("ERROR", "Autorunning"); return(false);
            }
            if (_iNo > mc.STCK_Home && !SEQ.InspectHomeDone())
            {
                return(false);
            }

            //   mcLDR_RHome
            m_bManSetting = true; //SetManCycle함수는 화면 쓰레드. 업데이트 함수에서 다른쓰레드로 들어와서 갱신하기에 플레그 걸어 막아둠.    //   mcIDX_Home
            m_iManNo      = _iNo;

            //   mcLTL_Home
            //   mcRTL_Home

            //SM.ER.SetDisp(true);jinseop

            bool bRet = true;                                                                                                                //   mcSTG_Home

            //   mcULD_Home
            /********************/
            /********************/
            if (m_iManNo == mc.NoneCycle)
            {
                bRet = false;
            }
            else if (m_iManNo == mc.AllHome)
            {
            }
            else if (m_iManNo == mc.LODR_Home)
            {
            }
            else if (m_iManNo == mc.TOOL_Home)
            {
            }
            else if (m_iManNo == mc.BARZ_Home)
            {
            }
            else if (m_iManNo == mc.IDXR_Home)
            {
            }
            else if (m_iManNo == mc.IDXF_Home)
            {
            }
            else if (m_iManNo == mc.STCK_Home)
            {
            }

            else if (m_iManNo == mc.LODR_CycleSply)
            {
                if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Fwd && SM.MT_GetCmdPos(mi.IDXR_XRear) < OM.CmnOptn.dIdxRSplyPos)
                {
                    Log.ShowMessage("Warring", "Rear Index Clamp is Up!");
                    bRet = false;
                }
                if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Fwd && SM.MT_GetCmdPos(mi.IDXF_XFrnt) < OM.CmnOptn.dIdxFSplyPos)
                {
                    Log.ShowMessage("Warring", "Front Index Clamp is Up!");
                    bRet = false;
                }
            }

            else if (m_iManNo == mc.IDXF_CycleGet)
            {
                if (!SM.MT_CmprPos(mi.IDXR_XRear, SM.PM_GetValue(mi.IDXR_XRear, pv.IDXR_XRearWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Rear Index is not in wait Position.");
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.IDXF_CycleBarcode)
            {
                if (!SM.MT_CmprPos(mi.IDXR_XRear, SM.PM_GetValue(mi.IDXR_XRear, pv.IDXR_XRearWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Rear Index is not in wait Position.");
                    bRet = false;
                }
                if (!DM.ARAY[ri.IDXR].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "Rear IndexData Exist!");
                    bRet = false;
                }
                if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Fwd)
                {
                    Log.ShowMessage("Warring", "Rear Index Clamp is Up!");
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.IDXF_CycleOut)
            {
                if (!SM.MT_CmprPos(mi.IDXR_XRear, SM.PM_GetValue(mi.IDXR_XRear, pv.IDXR_XRearWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Rear Index is not in wait Position.");
                    bRet = false;
                }
                if (!DM.ARAY[ri.OUTZ].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "OutZone Data Exist!");
                    bRet = false;
                }

                if (!DM.ARAY[ri.IDXR].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "Rear IndexData Exist!");
                    bRet = false;
                }
                if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Fwd)
                {
                    Log.ShowMessage("Warring", "Rear Index Clamp is Up!");
                    bRet = false;
                }
            }


            else if (m_iManNo == mc.IDXR_CycleGet)
            {
                if (!SM.MT_CmprPos(mi.IDXF_XFrnt, SM.PM_GetValue(mi.IDXF_XFrnt, pv.IDXF_XFrntWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Front Index is not in wait Position.");
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.IDXR_CycleBarcode)
            {
                if (!SM.MT_CmprPos(mi.IDXF_XFrnt, SM.PM_GetValue(mi.IDXF_XFrnt, pv.IDXF_XFrntWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Front Index is not in wait Position.");
                    bRet = false;
                }

                if (!DM.ARAY[ri.IDXF].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "Front IndexData Exist!");
                    bRet = false;
                }
                if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Fwd)
                {
                    Log.ShowMessage("Warring", "Front Index Clamp is Up!");
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.IDXR_CycleOut)
            {
                if (!SM.MT_CmprPos(mi.IDXF_XFrnt, SM.PM_GetValue(mi.IDXF_XFrnt, pv.IDXF_XFrntWait), 1.0))
                {
                    Log.ShowMessage("Warring", "Front Index is not in wait Position.");
                    bRet = false;
                }
                if (!DM.ARAY[ri.OUTZ].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "OutZone Data Exist!");
                    bRet = false;
                }

                if (!DM.ARAY[ri.IDXF].CheckAllStat(cs.None))
                {
                    Log.ShowMessage("Warring", "Front IndexData Exist!");
                    bRet = false;
                }
                if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Fwd)
                {
                    Log.ShowMessage("Warring", "Front Index Clamp is Up!");
                    bRet = false;
                }
            }
            else if (m_iManNo == mc.TOOL_CycleVisn)
            {
            }
            else if (m_iManNo == mc.TOOL_CycleNGPick)
            {
            }
            else if (m_iManNo == mc.TOOL_CycleNGPlace)
            {
            }
            else if (m_iManNo == mc.TOOL_CycleGoodPick)
            {
            }
            else if (m_iManNo == mc.TOOL_CycleGoodPlace)
            {
            }

            else if (m_iManNo == mc.STCK_CycleToStack)
            {
            }
            else if (m_iManNo == mc.STCK_CycleStack)
            {
            }
            else if (m_iManNo == mc.STCK_CycleOut)
            {
            }

            else if (m_iManNo == mc.BARZ_CycleBarPick)
            {
            }
            else if (m_iManNo == mc.BARZ_CycleBarPlace)
            {
            }
            else if (m_iManNo == mc.BARZ_CycleOut)
            {
            }
            if (!bRet)
            {
                Init();
            }

            /********************/
            /* 처리..           */
            /********************/

            if (m_iManNo == mc.NoneCycle)
            {
            }
            else if (m_iManNo == mc.AllHome)
            {
                SM.MT_SetServoAll(true);
                SEQ.LODR.InitHomeStep();
                SEQ.TOOL.InitHomeStep();
                SEQ.BARZ.InitHomeStep();
                SEQ.IDXR.InitHomeStep();
                SEQ.IDXF.InitHomeStep();
                SEQ.STCK.InitHomeStep();
            }
            else if (m_iManNo == mc.LODR_Home)
            {
                SM.MT_SetServoAll(true); SEQ.LODR.InitHomeStep();
            }
            else if (m_iManNo == mc.TOOL_Home)
            {
                SM.MT_SetServoAll(true); SEQ.TOOL.InitHomeStep();
            }
            else if (m_iManNo == mc.BARZ_Home)
            {
                SM.MT_SetServoAll(true); SEQ.BARZ.InitHomeStep();
            }
            else if (m_iManNo == mc.IDXR_Home)
            {
                SM.MT_SetServoAll(true); SEQ.IDXR.InitHomeStep();
            }
            else if (m_iManNo == mc.IDXF_Home)
            {
                SM.MT_SetServoAll(true); SEQ.IDXF.InitHomeStep();
            }
            else if (m_iManNo == mc.STCK_Home)
            {
                SM.MT_SetServoAll(true); SEQ.STCK.InitHomeStep();
            }

            else if (m_iManNo == mc.LODR_CycleSply)
            {
                SEQ.LODR.InitCycleStep();
            }

            else if (m_iManNo == mc.IDXF_CycleGet)
            {
                SEQ.IDXF.InitCycleStep();
            }
            else if (m_iManNo == mc.IDXF_CycleBarcode)
            {
                SEQ.IDXF.InitCycleStep();
            }
            else if (m_iManNo == mc.IDXF_CycleOut)
            {
                SEQ.IDXF.InitCycleStep();
            }
            else if (m_iManNo == mc.IDXR_CycleGet)
            {
                SEQ.IDXR.InitCycleStep();
            }
            else if (m_iManNo == mc.IDXR_CycleBarcode)
            {
                SEQ.IDXR.InitCycleStep();
            }
            else if (m_iManNo == mc.IDXR_CycleOut)
            {
                SEQ.IDXR.InitCycleStep();
            }

            else if (m_iManNo == mc.TOOL_CycleVisn)
            {
                SEQ.TOOL.InitCycleStep();
            }
            else if (m_iManNo == mc.TOOL_CycleNGPick)
            {
                SEQ.TOOL.InitCycleStep();
            }
            else if (m_iManNo == mc.TOOL_CycleNGPlace)
            {
                SEQ.TOOL.InitCycleStep();
            }
            else if (m_iManNo == mc.TOOL_CycleGoodPick)
            {
                SEQ.TOOL.InitCycleStep();
            }
            else if (m_iManNo == mc.TOOL_CycleGoodPlace)
            {
                SEQ.TOOL.InitCycleStep();
            }

            else if (m_iManNo == mc.STCK_CycleToStack)
            {
                SEQ.STCK.InitCycleStep();
            }
            else if (m_iManNo == mc.STCK_CycleStack)
            {
                SEQ.STCK.InitCycleStep();
            }
            else if (m_iManNo == mc.STCK_CycleOut)
            {
                SEQ.STCK.InitCycleStep();
            }

            else if (m_iManNo == mc.BARZ_CycleBarPick)
            {
                SEQ.BARZ.InitCycleStep();
            }
            else if (m_iManNo == mc.BARZ_CycleBarPlace)
            {
                SEQ.BARZ.InitCycleStep();
            }
            else if (m_iManNo == mc.BARZ_CycleOut)
            {
                SEQ.BARZ.InitCycleStep();
            }

            //else if (m_iManNo == mBARZ_CycleBarPick  c.TOOL_SubsAlignVisn ) { SEQ.TOOL.InitCycleStep(); }
            //else if (m_iManNo == mBARZ_CycleBarPlace c.TOOL_WafrAlignVisn ) { SEQ.TOOL.InitCycleStep(); }
            //else if (m_iManNo == mBARZ_CycleOut      c.WSTG_WaferGet      ) { SEQ.WSTG.InitCycleStep(); }
            //else if (m_iManNo == mc.TOOL_Eject         ) { SEQ.TOOL.InitCycleStep(); }
            //else if (m_iManNo == mc.TOOL_DispCheck     ) { SEQ.TOOL.InitCycleStep(); }
            //else if (m_iManNo == mc.TOOL_HghtCheck     ) { SEQ.TOOL.InitCycleStep(); }
            //else if (m_iManNo == mc.WSTG_ExpdWork      ) { SML.MT.GoAbsRun((int)mi.WSTG_ZExpd, PM.GetValue(mi.WSTG_ZExpd, pv.WSTG_ZExpdWork));}
            //else if (m_iManNo == mc.SSTG_SubsRailConv  ) { SEQ.SSTG.InitCycleStep(); }
            //else if (m_iManNo == mc.SSTG_WafrRailConv  ) { SEQ.WSTG.InitCycleStep(); }
            //else if (m_iManNo == mc.SSTG_SubsRailHome  ) { SML.MT.GoHome((int)mi.SSTG_XRail); }


            //else if (m_iManNo == mc.PCK_CyclePick    ) {SEQ.PCK.InitCycleStep(); }
            //else if (m_iManNo == mc.PCK_CycleVisn    ) {SEQ.PCK.InitCycleStep(); }
            //else if (m_iManNo == mc.PCK_CyclePrnt    ) {SEQ.PCK.InitCycleStep(); }
            //else if (m_iManNo == mc.PCK_CyclePlce    ) {SEQ.PCK.InitCycleStep(); }

            //else if (m_iManNo == mc.IDX_CycleSupply  ) {SEQ.IDX.InitCycleStep(); }
            //else if (m_iManNo == mc.IDX_CycleWork    ) {SEQ.IDX.InitCycleStep(); }
            //else if (m_iManNo == mc.IDX_CycleOut     ) {SEQ.IDX.InitCycleStep(); }
            //else if (m_iManNo == mc.IDX_LtPitchMove  ) {SML.MT.GoIncMan((int)mi.IDX_X,  OM.DevInfo.dTrayColPitch);}
            //else if (m_iManNo == mc.IDX_RtPitchMove  ) {SML.MT.GoIncMan((int)mi.IDX_X, -OM.DevInfo.dTrayColPitch);}


            m_bManSetting = false; //m_bManSetting 중요함 리턴전에 꼭 펄스 시켜야함. 쓰레드가 달라서. ::Update에서 m_iManNo=0이 되므로 주의.
            return(true);
        }