Exemplo n.º 1
0
 private void btAllHome_Click(object sender, EventArgs e)
 {
     if (!OM.MstOptn.bDebugMode)
     {
         if (Log.ShowMessageModal("Confirm", "Do you want to All Homming?") != DialogResult.Yes)
         {
             return;
         }
         MM.SetManCycle(mc.AllHome);
     }
     else
     {
         DialogResult Rslt;
         Rslt = MessageBox.Show(new Form()
         {
             TopMost = true
         }, "홈동작을 생략 하겠습니까?", "Confirm", MessageBoxButtons.YesNoCancel);
         if (Rslt == DialogResult.Yes)
         {
             SM.MT_SetServoAll(true);
             Thread.Sleep(100);
             for (mi i = 0; i < mi.MAX_MOTR; i++)
             {
                 SM.MT_SetHomeDone(i, true);
             }
         }
         else if (Rslt == DialogResult.No)
         {
             MM.SetManCycle(mc.AllHome);
         }
     }
 }
Exemplo n.º 2
0
        public static bool  InspectEmergency()
        {
            bool isOk = true;

            //Check Emergency
            if (SM.IO_GetX(xi.ETC_FtEmgSw) ||
                SM.IO_GetX(xi.ETC_LtEmgSw) ||
                SM.IO_GetX(xi.ETC_RrEmgSw) ||
                SM.IO_GetX(xi.ETC_RtEmgSw))
            {
                SM.MT_EmgStopAll();
                SM.MT_SetServoAll(false);
                if (SM.IO_GetX(xi.ETC_FtEmgSw))
                {
                    SM.ER_SetErr(ei.ETC_Emergency, "전면 Emergency Switch 가 눌렸습니다.");
                }
                if (SM.IO_GetX(xi.ETC_LtEmgSw))
                {
                    SM.ER_SetErr(ei.ETC_Emergency, "좌측 Emergency Switch 가 눌렸습니다.");
                }
                if (SM.IO_GetX(xi.ETC_RrEmgSw))
                {
                    SM.ER_SetErr(ei.ETC_Emergency, "뒷면 Emergency Switch 가 눌렸습니다.");
                }
                if (SM.IO_GetX(xi.ETC_RtEmgSw))
                {
                    SM.ER_SetErr(ei.ETC_Emergency, "우측 Emergency Switch 가 눌렸습니다.");
                }

                isOk = false;
            }

            return(isOk);
        }
Exemplo n.º 3
0
        private void btForcedHomeEnd_Click(object sender, EventArgs e)
        {
            SM.MT_SetServoAll(true);

            Thread.Sleep(100);

            for (mi i = 0; i < mi.MAX_MOTR; i++)
            {
                SM.MT_SetHomeDone(i, true);
            }
        }
Exemplo n.º 4
0
        //    CPartInterface * m_pPart[MAX_PART] ;

        //--------------------------------------------------------------------------------------------------------

        public static void Reset()
        {
            //Check running flag.
            if (m_bRun)
            {
                return;
            }
            if (m_iSeqStat == EN_SEQ_STAT.Init)
            {
                return;
            }
            if (m_iStep == EN_SEQ_STEP.ToStopCon)
            {
                return;
            }
            if (m_iStep == EN_SEQ_STEP.ToStop)
            {
                return;
            }
            if (MM.GetManNo() != mc.NoneCycle)
            {
                return;
            }

            LOT.Reset();

            Log.Trace("Seq", "Reset");

            m_tmToStop.Clear();
            m_tmToStrt.Clear();
            m_tmFlickOn.Clear();
            m_tmFlickOff.Clear();
            m_tmTemp.Clear();
            m_tmCloseDoor.Clear();

            //Init. Var.
            m_bBtnReset = false;
            m_bBtnStart = false;
            m_bBtnStop  = false;

            m_bRunEnd = false;
            m_bRun    = false;
            m_iStep   = EN_SEQ_STEP.Idle;

            //Error.
            SM.ER_Clear();

            //Manual.
            MM.Reset();

            //Part.
            for (int i = 0; i < (int)pi.MAX_PART; i++)
            {
                m_Part[i].Reset();
            }

            //Lot End Flag Reset.
            LOT.Reset();
            //FM_CloseMsgOk();

            m_iSeqStat = EN_SEQ_STAT.Stop;

            //System.
            //if(!EM_IsErr()) return; //20150801 선계원 홈잡을때 리셑 누르면 홈스텝이 날라가서 처박았음.
            //SM.MT.ResetAll();
            SM.MT_ResetAll();
            SM.MT_SetServoAll(true);
        }
Exemplo n.º 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.AllHome && !SEQ.InspectHomeDone())
            {
                return(false);
            }

            //Check Alarm.
            //if (SM.ER.IsErr()) { Init(); return false; } //아 밑에 처리 하는 애 때문에 잠시 이렇게 함.          //test

            //    if(!IO_GetX(xETC_MainPower) ) {FM_MsgOk("ERR","Power On Plz");      return false ;} //test
            //if (!SM.IO.GetX((int)EN_INPUT_ID.xETC_MainAirChk)) { MessageBox.Show("Check Main Air!", "ERROR"); return false; } //test
            m_bStdCalPick = false; //   mcLDR_FHome
            //   mcLDR_RHome
            m_bManSetting = true;  //SetManCycle함수는 화면 쓰레드. 업데이트 함수에서 다른쓰레드로 들어와서 갱신하기에 플레그 걸어 막아둠.    //   mcIDX_Home
            m_iManNo      = _iNo;

            //   mcLTL_Home
            //   mcRTL_Home

            //SM.ER.SetDisp(true);

            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.IDX_Home)
            {
            }


            else if (m_iManNo == mc.IDX_CycleWork)
            {
            }
            else if (m_iManNo == mc.IDX_CycleOut)
            {
            }
            //else if (m_iManNo == mc.IDX_CycleSupply    ) { }
            else if (m_iManNo == mc.IDX_CycleManSttWait)
            {
            }

            else if (m_iManNo == mc.IDX_HolderFwd)
            {
            }
            else if (m_iManNo == mc.IDX_HolderBwd)
            {
            }
            else if (m_iManNo == mc.IDX_CutterFwd)
            {
            }
            else if (m_iManNo == mc.IDX_CutterBwd)
            {
            }

            if (!bRet)
            {
                Init();
            }

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

            if (m_iManNo == mc.NoneCycle)
            {
            }
            else if (m_iManNo == mc.AllHome)
            {
                SM.MT_SetServoAll(true);
                SEQ.IDX.InitHomeStep();
                //SEQ.PCK.InitHomeStep();
                //LTL.InitHomeStep();
                //RTL.InitHomeStep();
                //STG.InitHomeStep();
                //ULD.InitHomeStep();
            }
            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_CycleManSttWait)
            {
                SEQ.IDX.InitCycleStep();
            }

            else if (m_iManNo == mc.IDX_HolderFwd)
            {
                SM.CL_Move(ci.IDX_Hold1UpDn, fb.Fwd);
                SM.CL_Move(ci.IDX_Hold2UpDn, fb.Fwd);
                SM.CL_Move(ci.IDX_TwstLtDnUp, fb.Fwd);
                SM.CL_Move(ci.IDX_TwstRtDnUp, fb.Fwd);
            }
            else if (m_iManNo == mc.IDX_HolderBwd)
            {
                SM.CL_Move(ci.IDX_Hold1UpDn, fb.Bwd);
                SM.CL_Move(ci.IDX_Hold2UpDn, fb.Bwd);
                SM.CL_Move(ci.IDX_TwstLtDnUp, fb.Bwd);
                SM.CL_Move(ci.IDX_TwstRtDnUp, fb.Bwd);
            }
            else if (m_iManNo == mc.IDX_CutterFwd)
            {
                SM.CL_Move(ci.IDX_CutLtFwBw, fb.Fwd);
                SM.CL_Move(ci.IDX_CutRtFwBw, fb.Fwd);
                SM.CL_Move(ci.IDX_CutterDnUp, fb.Fwd);
                SM.CL_Move(ci.IDX_CutBaseUpDn, fb.Fwd);
            }
            else if (m_iManNo == mc.IDX_CutterBwd)
            {
                SM.CL_Move(ci.IDX_CutLtFwBw, fb.Bwd);
                SM.CL_Move(ci.IDX_CutRtFwBw, fb.Bwd);
                SM.CL_Move(ci.IDX_CutterDnUp, fb.Bwd);
                SM.CL_Move(ci.IDX_CutBaseUpDn, fb.Bwd);
            }

            m_bManSetting = false; //m_bManSetting 중요함 리턴전에 꼭 펄스 시켜야함. 쓰레드가 달라서. ::Update에서 m_iManNo=0이 되므로 주의.
            return(true);
        }
Exemplo n.º 6
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);
        }