Exemplo n.º 1
0
        public static bool  InspectFlowMeter()
        {
            bool isOk = true;

            if (SM.IO_GetY(yi.BARZ_Blower))
            {
                m_tmTemp.Clear();
            }
            if (!SM.IO_GetY(yi.BARZ_Blower) && !SM.IO_GetX(xi.ETC_FlowMeter) && m_tmTemp.OnDelay(500))
            {
                SM.ER_SetErr(ei.ETC_FlowMeter, "Flow Meter Sensor Checked");
                isOk = false;
            }

            return(isOk);
        }
Exemplo n.º 2
0
        public static void Update()
        {
            double dPreTime = CTimer.GetTime_us();
            double dCrntTime;

            while (true)
            {
                dCrntTime = CTimer.GetTime_us();
                m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0;
                if (m_dMainThreadCycleTime > 2)
                {
                    Log.Trace(m_dMainThreadCycleTime.ToString());
                }
                dPreTime = dCrntTime;
                Thread.Sleep(1);

                //Motion Dll Update
                SM.Update(m_iSeqStat);

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

                //Inspection
                InspectMainAir();
                InspectEmergency();
                InspectActuator();
                InspectMotor();
                InspectCrash();
                InspectTemp();
                InspectLightGrid();

                //Update ErrorProc.
                UpdateButton();

                //Check Button.
                UpdateSeqState();

                //Update Motor State (Input)
                MM.Update();

                //SPC
                SPC.Update(LOT.GetLotNo(), OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
        public static bool  InspectHomeDone()
        {
            //Local Var.
            bool isOk = true;

            //Inspect.
            for (mi i = 0; i < mi.MAX_MOTR; i++)
            {
                if (!SM.MT_GetHomeDone(i))
                {
                    SM.ER_SetErr(ei.MTR_HomeEnd, SM.MT_GetName(i)); isOk = false;
                }
            }

            //Ok.
            return(isOk);
        }
Exemplo n.º 5
0
        public static void Close()
        {
            MainThread.Abort();
            MainThread.Join();

            SM.Close();
            OM.Close();
            LOT.Close();
            SPC.Close();

            //for (int i = 1; i < (int)si.MAX_RS232; i++)
            //{
            //    Com[i].PortClose();
            //}

            //ML.IO_SetY(yi.SSTG_HeaterOn,false);
            //SEQ.Oracle.CloseDB();
        }
Exemplo n.º 6
0
        public static void Update()
        {
            double dPreTime = CTimer.GetTime_us();
            double dCrntTime;

            while (true)
            {
                dCrntTime = CTimer.GetTime_us();
                m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0;
                dPreTime = dCrntTime;
                Thread.Sleep(0);
                SM.Update(m_iSeqStat);

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

                //Inspection
                InspectMainAir();
                InspectEmergency();
                InspectActuator();
                InspectMotor();
                InspectCrash();
                InspectTemp();
                InspectFlowMeter();
                InspectMainServo();
                InspectDoor();


                //Update ErrorProc.
                UpdateButton();

                //Check Button.
                UpdateSeqState();

                //Update Motor State (Input)
                MM.Update();

                //SPC
                SPC.Update(LOT.CrntLotData.sEmployeeID, LOT.CrntLotData.sLotNo, OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint);
            }
        }
Exemplo n.º 7
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bOut = SM.IO_GetY(m_iYadd, false);

            if (bOut)
            {
                lbState.BackColor = Color.Red;
                lbState.Text      = "ON";
            }
            else
            {
                lbState.BackColor = SystemColors.Control;
                lbState.Text      = "OFF";
            }

            tmUpdate.Enabled = true;
        }
Exemplo n.º 8
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bOut = SM.IO_GetY(m_iYadd, false);

            if (bOut)
            {
                btAction.ForeColor = Color.Lime;
                btAction.Text      = "ON";
            }
            else
            {
                btAction.ForeColor = Color.Black;
                btAction.Text      = "OFF";
            }

            tmUpdate.Enabled = true;
        }
Exemplo n.º 9
0
        public static bool  InspectActuator()
        {
            //Local Var.
            bool isOk  = true;
            bool isErr = false;

            //Inspect.
            for (ci i = 0; i < ci.MAX_ACTR; i++)
            {
                isErr = SM.CL_Err(i);
                if (isErr)
                {
                    SM.ER_SetErr(ei.ATR_TimeOut, SM.CL_GetName(i)); isOk = false;
                }
            }

            //Ok.
            return(isOk);
        }
Exemplo n.º 10
0
        private void HidePage(int _iPageIdx)
        {
            switch (_iPageIdx)
            {
            case 0: FrmOperation.Hide(); break;

            case 1: FrmDevice.Hide();
                FrmDeviceSet.Hide(); break;

            case 2: /*FrmMacro    .Hide();*/ break;

            case 3: FrmOption.Hide(); break;

            case 4: FrmSPC.Hide(); break;

            case 5: SM.HideDllMainWin(); break;

            default: FrmOperation.Hide(); break;
            }
        }
Exemplo n.º 11
0
        //FormMain FrmMain;
        public FrameMotrPosAPT()
        {
            InitializeComponent();

            SM.PM_SetGetCmdPos(mi.LODR_ZLift);
            SM.PM_SetGetCmdPos(mi.TOOL_XRjct);
            SM.PM_SetGetCmdPos(mi.IDXR_XRear);
            SM.PM_SetGetCmdPos(mi.IDXF_XFrnt);
            SM.PM_SetGetCmdPos(mi.TOOL_YTool);
            SM.PM_SetGetCmdPos(mi.TOOL_ZPckr);
            SM.PM_SetGetCmdPos(mi.BARZ_XPckr);
            SM.PM_SetGetCmdPos(mi.BARZ_ZPckr);
            SM.PM_SetGetCmdPos(mi.STCK_ZStck);
            SM.PM_SetGetCmdPos(mi.TOOL_ZVisn);

            PM.Load(OM.GetCrntDev().ToString());

            PM.UpdatePstn(true);
            tmUpdate.Enabled = false;
        }
Exemplo n.º 12
0
        private void btAction_Click(object sender, EventArgs e)
        {
            fb sCylderPos = 0;

            if (SM.CL_GetCmd(m_iActrId) == 0)
            {
                sCylderPos = fb.Fwd;
            }
            else
            {
                sCylderPos = fb.Bwd;
            }

            SM.CL_Move(m_iActrId, sCylderPos);

            string sMsg = "FrameCyl Form_Cylinder Move Button Click" + SM.CL_GetName(m_iActrId).ToString();

            sMsg += SM.CL_GetCmd(m_iActrId) == 0 ? "(Fwd)" : "(Bwd)";

            Log.Trace("Operator", sMsg);
        }
Exemplo n.º 13
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bCmd     = SM.CL_GetCmd(m_iActrId) == fb.Bwd ? true : false;
            bool bErr     = SM.CL_Err(m_iActrId);
            bool bDone    = SM.CL_Complete(m_iActrId);
            bool bDoneFwd = SM.CL_Complete(m_iActrId, fb.Fwd);
            bool bDoneBwd = SM.CL_Complete(m_iActrId, fb.Bwd);

            //if (bDone)
            //{
            //    lbFwd.BackColor = bCmd ? Color.ForestGreen    : SystemColors.Control;
            //    lbBwd.BackColor = bCmd ? SystemColors.Control : Color.ForestGreen   ;
            //}
            if (bErr)
            {
                lbFwd.BackColor = Color.Red;
                lbBwd.BackColor = Color.Red;
            }


            if (bCmd != m_bPreCmd)
            {
                if (SM.CL_GetCmd(m_iActrId) == fb.Bwd)
                {
                    lbBwd.BackColor = Color.ForestGreen; lbFwd.BackColor = SystemColors.Control;
                }
                else
                {
                    lbFwd.BackColor = Color.ForestGreen; lbBwd.BackColor = SystemColors.Control;
                }
            }

            m_bPreCmd        = bCmd;
            tmUpdate.Enabled = true;
        }
Exemplo n.º 14
0
        public void ShowPage(int _iPageIdx)
        {
            FrmDeviceSet.UpdateDevInfo(true);
            PM.UpdatePstn(true);
            //PM.Load(OM.GetCrntDev());

            switch (_iPageIdx)
            {
            case 0: FrmOperation.Show(); break;

            case 1: FrmDevice.Show(); break;

            case 2: /*FrmMacro    .Show();*/ break;

            case 3: FrmOption.Show(); break;

            case 4: FrmSPC.Show(); break;

            //FrmSPC      .ShowUpdate();    break;
            case 5: SM.SetDllMainWin(pnBase); break;

            default: FrmOperation.Show(); break;
            }
        }
Exemplo n.º 15
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bCmd  = SM.CL_GetCmd(m_iActrId) == 0 ? true : false;
            bool bErr  = SM.CL_Err(m_iActrId);
            bool bDone = SM.CL_Complete(m_iActrId);

            if (bDone)
            {
                btAction.ForeColor = Color.Lime;
            }
            else if (bErr)
            {
                btAction.ForeColor = Color.Red;
            }
            else
            {
                btAction.ForeColor = Color.Black;
            }

            if (bCmd != m_bPreCmd)
            {
                if ((int)SM.CL_GetCmd(m_iActrId) == 0)
                {
                    btAction.ImageIndex = iFwd; btAction.Text = sFwd;
                }
                else
                {
                    btAction.ImageIndex = iBwd; btAction.Text = sBwd;
                }
            }

            m_bPreCmd        = bCmd;
            tmUpdate.Enabled = true;
        }
Exemplo n.º 16
0
        public void Update(string _sCrntLotNo, EN_SEQ_STAT Stat)
        {
            //Err Log

            bool isErr = Stat == EN_SEQ_STAT.Error && SM.ER_GetErrLevel((ei)SM.ER_GetLastErr()) == EN_ERR_LEVEL.Error; // SML.ER.IsErr();

            if (isErr && !bPreErr)
            {
                Data.ErrNo     = SM.ER_GetLastErr();
                Data.ErrName   = SM.ER_GetErrName((ei)SM.ER_GetLastErr());
                Data.StartedAt = DateTime.Now.ToOADate();
                Data.ErrMsg    = SML.ER.GetErrSubMsg(SM.ER_GetLastErr());
                Data.LotId     = _sCrntLotNo;
            }
            if (!isErr && bPreErr)
            {
                Data.EndedAt = DateTime.Now.ToOADate();
                TimeSpan Span;
                Span         = TimeSpan.FromDays(Data.EndedAt - Data.StartedAt);
                Data.ErrTime = Span.TotalMilliseconds;
                SaveDataIni(Data.StartedAt);
            }
            bPreErr = isErr;
        }
Exemplo n.º 17
0
        public static void Init(int _iWidth, int _iHeight)
        {
            Log.StartLogMan();
            //Common
            SM.TPara Para;
            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            //Para.iWidth    = 1280;
            //Para.iHeight   = 863;
            Para.iWidth    = _iWidth;
            Para.iHeight   = _iHeight;
            Para.bTabHides = new bool[6];

            switch (Eqp.sLanguage)
            {
            default: CLanguage.ChangeLanguage("en"); Para.eLanSel = EN_LAN_SEL.English; break;

            case "English": CLanguage.ChangeLanguage("en"); Para.eLanSel = EN_LAN_SEL.English; break;

            case "Korean": CLanguage.ChangeLanguage("ko"); Para.eLanSel = EN_LAN_SEL.Korean; break;

            case "Chinese": CLanguage.ChangeLanguage("zh-Hans"); Para.eLanSel = EN_LAN_SEL.Chinese; break;
            }

            //Error
            SM.TParaErr Err;
            Para.Err.bUseErrPic = true;
            Para.Err.eErr       = new ei();
            Para.bTabHides[0]   = false;
            //D IO
            SM.TParaDio Dio;
            Para.Dio.eDioSel  = EN_DIO_SEL.AXL;
            Para.Dio.eX       = new xi();
            Para.Dio.eY       = new yi();
            Para.bTabHides[1] = false;
            //A IO
            SM.TParaAio Aio;
            Para.Aio.eAioSel    = EN_AIO_SEL.AXL;
            Para.Aio.eX         = new ax();
            Para.Aio.eY         = new ay();
            Para.Aio.iRangeAMin = 0;
            Para.Aio.iRangeAMax = 0;
            Para.bTabHides[2]   = false;

            //TowerLamp
            Para.bTabHides[3] = false;

            //Cylinder
            SM.TParaCyl Cyl;
            Para.Cyl.eCyl     = new ci();
            Para.bTabHides[4] = false;

            //Motor
            SM.TParaMtr Mtr;
            Para.Mtr.eMtrSel = new EN_MTR_SEL[(int)mi.MAX_MOTR];
            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                Para.Mtr.eMtrSel[i] = EN_MTR_SEL.AXL;
            }
            Para.Mtr.eMtr     = new mi();
            Para.bTabHides[5] = false;

            SM.Init(Para);
            OM.Init();
            DM.Init();
            LOT.Init();
            SPC.Init();
            PM.Init(Pstn.Cnt);

            ArrayPos.TPara PosPara; //= new ArrayPos.TPara();
            PosPara.dColGrGap = OM.DevInfo.dColGrGap;
            PosPara.iColCnt   = OM.DevInfo.iColCnt;
            PosPara.iRowCnt   = OM.DevInfo.iRowCnt;
            PosPara.dColPitch = OM.DevInfo.dColPitch;
            PosPara.dRowPitch = OM.DevInfo.dRowPitch;
            PosPara.iColGrCnt = OM.DevInfo.iColGrCnt;
            PosPara.iRowGrCnt = OM.DevInfo.iRowGrCnt;
            PosPara.dColGrGap = OM.DevInfo.dColGrGap;
            PosPara.dRowGrGap = OM.DevInfo.dRowGrGap;

            PosPara.iColSbGrCnt = OM.DevInfo.iColSbGrCnt;
            PosPara.iRowSbGrCnt = OM.DevInfo.iRowSbGrCnt;

            PosPara.dRowSbGrGap = OM.DevInfo.dRowSbGrGap;
            PosPara.dColSbGrGap = OM.DevInfo.dColSbGrGap;
            if (!OM.StripPos.SetPara(PosPara))
            {
                Log.ShowMessage("Strip Position Err", OM.StripPos.Error);
            }

            ML.IO_SetY(yi.ETC_MainAirOnOff, true);

            //WinApi.TimeBeginPeriod(1);
            Process.GetCurrentProcess().PriorityBoostEnabled = true;
            Process.GetCurrentProcess().PriorityClass        = ProcessPriorityClass.RealTime;

            MainThread.Priority = ThreadPriority.Highest;
            MainThread.Start();

            m_tmToStop    = new CDelayTimer();
            m_tmToStrt    = new CDelayTimer();
            m_tmFlickOn   = new CDelayTimer();
            m_tmFlickOff  = new CDelayTimer();
            m_tmCloseDoor = new CDelayTimer();
            m_tmTemp      = new CDelayTimer();

            m_cyWorktime = new CCycleTimer();

            m_bBtnReset = false;
            m_bBtnStart = false;
            m_bBtnStop  = false;
            m_bBtnAir   = false;

            m_bRun     = false;
            m_bRunEdge = false;
            m_bFlick   = false;
            m_iStep    = EN_SEQ_STEP.Idle;
            m_iSeqStat = EN_SEQ_STAT.Stop;

            //Run End Buzzer.
            m_bRunEnd = false;

            m_Part[(int)pi.LODR] = LODR;
            m_Part[(int)pi.PREB] = PREB;
            m_Part[(int)pi.VSNZ] = VSNZ;
            m_Part[(int)pi.PSTB] = PSTB;
            m_Part[(int)pi.ULDR] = ULDR;
        }
Exemplo n.º 18
0
        //One Cycle.
        //여기부터.
        bool CycleInsp(ref TCycle _tCycle)
        {
            //Check Cycle Time Out.
            string sTemp;

            if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000))
            {
                SM.ER_SetNeedShowErr(false);
                sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                _tCycle.iStep = 0;
                return(true);
            }

            if (_tCycle.iStep != _tCycle.iPreStep)
            {
                sTemp = string.Format("Step={0:00}", _tCycle.iStep);
                Log.Trace("Vision Communction", sTemp);
            }

            _tCycle.iPreStep = _tCycle.iStep;

            //Cycle.
            switch (_tCycle.iStep)
            {
            default:
                sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                Log.Trace("Vision Communction", sTemp);
                _tCycle.iStep = 0;
                return(true);

            case 10:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                //SML.MT.OneShotTrg((int)mi.TOOL_YTool,true,1000);
                //SM.IO_SetY(Para.yVisn_ManInsp, true);
                SM.IO_SetY(yi.VISN_ManInsp, true);
                Log.Trace("Vision Shot", "ON");
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 11:
                //if(_tCycle.tmDelay.OnDelay(true, 10))return false;
                if (!SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                //SM.IO_SetY(Para.yVisn_ManInsp, false);
                SM.IO_SetY(yi.VISN_ManInsp, false);
                Log.Trace("Vision Shot", "OFF");
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 12:
                //if(_tCycle.tmDelay.OnDelay(1000))return false;
                //SM.IO_SetY(Para.yVisn_ManInsp, false);
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 13:
                //if(_tCycle.tmDelay.OnDelay(1000))return false;
                //if(SM.IO_GetY(Para.yVisn_ManInsp))
                //{
                //SM.IO_SetY(yi.VISN_ManInsp, false);
                Log.Trace("Vision Shot", "OFF2");
                //return false;
                //}
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                Log.Trace("Vision Shot", "END");
                _tCycle.iStep = 0;
                return(true);
            }
        }
Exemplo n.º 19
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;
            pnIdx.Refresh();
            //pnPst.Refresh();

            tbTargetCnt.Text = OM.DevOptn.iTargetCnt.ToString();
            tbCrntCnt.Text   = OM.EqpStat.iWorkCnt.ToString();

            tbNodeCnt.Text = OM.EqpStat.iNodeCnt.ToString();
            tbCttrCnt.Text = OM.EqpStat.iCttrCnt.ToString();
            tbDegree.Text  = OM.NodePos[SEQ.IDX.iNodeCnt].dDegree.ToString();

            int iLevel = (int)FormPassword.GetLevel();

            switch (iLevel)
            {
            case (int)EN_LEVEL.Operator: btOperator.Text = "OPERATOR"; break;

            case (int)EN_LEVEL.Engineer: btOperator.Text = "ENGINEER"; break;

            case (int)EN_LEVEL.Master: btOperator.Text = " ADMIN  "; break;

            default: btOperator.Text = " ERROR  "; break;
            }

            if (bPreLotOpen != LOT.GetLotOpen())
            {
                btLotEnd.Enabled  = LOT.GetLotOpen();
                btStart.Enabled   = LOT.GetLotOpen();
                btLotOpen.Enabled = !LOT.GetLotOpen();
                bPreLotOpen       = LOT.GetLotOpen();
            }


            SPC.DAY.DispDayInfo(lvDayInfo);
            SPC.LOT.DispLotInfo(lvLotInfo);

            string Str;
            int    iPreErrCnt  = 0;
            int    iCrntErrCnt = 0;

            for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
            {
                if (SML.ER.GetErr(i))
                {
                    iCrntErrCnt++;
                }
            }
            if (iPreErrCnt != iCrntErrCnt)
            {
                lbErr.Items.Clear();
                int iErrNo = SML.ER.GetLastErr();
                for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
                {
                    if (SML.ER.GetErr(i))
                    {
                        Str  = string.Format("[ERR{0:000}]", i);
                        Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrMsg(i);
                        lbErr.Items.Add(Str);
                    }
                }
            }
            if (SEQ._iSeqStat != EN_SEQ_STAT.Error)
            {
                lbErr.Items.Clear();
            }
            iPreErrCnt = iCrntErrCnt;


            string sCycleTimeSec;
            int    iCycleTimeMs;


            //Door Sensor.  나중에 찾아보자
            //bool isAllCloseDoor = SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorFt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorLt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRr) ;
            //if (FormPassword.GetLevel() != EN_LEVEL.lvOperator && isAllCloseDoor && CMachine._bRun)
            //{
            //    //FM_SetLevel(lvOperator);
            //}

            if (!SM.MT_GetHomeDoneAll())
            {
                btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red;
            }
            else
            {
                btAllHome.ForeColor = Color.Black;
            }

            //DM.ARAY[(int)ri.LENS ].SetMaxColRow(OM.DevInfo.iLensColCnt , OM.DevInfo.iLensRowCnt);
            //DM.ARAY[(int)ri.REAR ].SetMaxColRow(OM.DevInfo.iRearColCnt , OM.DevInfo.iRearRowCnt);
            //DM.ARAY[(int)ri.FRNT ].SetMaxColRow(OM.DevInfo.iFrntColCnt , OM.DevInfo.iFrntRowCnt);
            //DM.ARAY[(int)ri.PICK ].SetMaxColRow(2, 1);

            pnIDXDetect1.BackColor = !SM.IO_GetX(xi.IDX_Detect1) ? Color.Lime : Color.Red;
            pnIDXDetect2.BackColor = !SM.IO_GetX(xi.IDX_Detect2) ? Color.Lime : Color.Red;
            pnIDXDetect3.BackColor = !SM.IO_GetX(xi.IDX_Detect3) ? Color.Lime : Color.Red;
            pnIDXDetect4.BackColor = !SM.IO_GetX(xi.IDX_Detect4) ? Color.Lime : Color.Red;
            pnIDXDetect5.BackColor = !SM.IO_GetX(xi.IDX_Detect5) ? Color.Lime : Color.Red;

            pnULDDetect1.BackColor = SM.IO_GetX(xi.ULD_Detect1) ? Color.Lime : Color.Red;
            pnULDDetect2.BackColor = SM.IO_GetX(xi.ULD_Detect2) ? Color.Lime : Color.Red;
            pnULDDetect3.BackColor = SM.IO_GetX(xi.ULD_Detect3) ? Color.Lime : Color.Red;
            pnULDDetect4.BackColor = SM.IO_GetX(xi.ULD_Detect4) ? Color.Lime : Color.Red;
            pnULDDetect5.BackColor = SM.IO_GetX(xi.ULD_Detect5) ? Color.Lime : Color.Red;

            //Option View
            if (OM.CmnOptn.bUsedLine1)
            {
                pnOption1.BackColor = Color.Lime; lbOption1.Text = "ON";
            }
            else
            {
                pnOption1.BackColor = Color.Red; lbOption1.Text = "OFF";
            }
            if (OM.CmnOptn.bUsedLine2)
            {
                pnOption2.BackColor = Color.Lime; lbOption2.Text = "ON";
            }
            else
            {
                pnOption2.BackColor = Color.Red; lbOption2.Text = "OFF";
            }
            if (OM.CmnOptn.bUsedLine3)
            {
                pnOption3.BackColor = Color.Lime; lbOption3.Text = "ON";
            }
            else
            {
                pnOption3.BackColor = Color.Red; lbOption3.Text = "OFF";
            }
            if (OM.CmnOptn.bUsedLine4)
            {
                pnOption4.BackColor = Color.Lime; lbOption4.Text = "ON";
            }
            else
            {
                pnOption4.BackColor = Color.Red; lbOption4.Text = "OFF";
            }
            if (OM.CmnOptn.bUsedLine5)
            {
                pnOption5.BackColor = Color.Lime; lbOption5.Text = "ON";
            }
            else
            {
                pnOption5.BackColor = Color.Red; lbOption5.Text = "OFF";
            }
            if (OM.CmnOptn.bIgnrWork)
            {
                pnOption6.BackColor = Color.Lime; lbOption6.Text = "ON";
            }
            else
            {
                pnOption6.BackColor = Color.Red; lbOption6.Text = "OFF";
            }

            btCyl1.Text      = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ?  "FWD"      : "BWD";
            btCyl1.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ?  Color.Lime : Color.Black;

            btCyl2.Text      = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ?  "FWD"      : "BWD";
            btCyl2.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ?  Color.Lime : Color.Black;

            btCyl3.Text      = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ?  "FWD"      : "BWD";
            btCyl3.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ?  Color.Lime : Color.Black;

            btCyl4.Text      = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ?  "FWD"      : "BWD";
            btCyl4.ForeColor = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ?  Color.Lime : Color.Black;

            //btCyl5 .Text      = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ?  "FWD"      : "BWD"      ;
            //btCyl5 .ForeColor = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ?  Color.Lime : Color.Black;

            btCyl6.Text      = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ?  "FWD"      : "BWD";
            btCyl6.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ?  Color.Lime : Color.Black;

            btCyl7.Text      = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ? "FWD"       : "BWD";
            btCyl7.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ?  Color.Lime : Color.Black;

            //btCyl7 .Text      = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ?  "FWD"      : "BWD"      ;
            //btCyl7 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ?  Color.Lime : Color.Black;

            //btCyl8 .Text      = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ?  "FWD"      : "BWD"      ;
            //btCyl8 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ?  Color.Lime : Color.Black;

            btCyl8.Text      = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ?  "FWD"      : "BWD";
            btCyl8.ForeColor = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ?  Color.Lime : Color.Black;

            btCyl9.Text      = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ?  "FWD"      : "BWD";
            btCyl9.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ?  Color.Lime : Color.Black;

            //if (CMachine._iSeqStat == EN_SEQ_STAT.ssWorkEnd || CMachine._iSeqStat == EN_SEQ_STAT.ssStop)
            //{
            //    CMachine.Reset();
            //    if (bRepeat) CMachine._bBtnStart = true;
            //}
            tmUpdate.Enabled = true;
        }
Exemplo n.º 20
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.º 21
0
        private static void UpdateButton()
        {
            //if (!OM.CmnOptn.bIgnrDoor) InspectDoor();

            if (m_iStep != EN_SEQ_STEP.Idle)
            {
                InspectHomeDone();
            }

            //Local Var.
            bool isErr     = SML.ER.IsErr();
            bool isHomeEnd = SM.MT_GetHomeDoneAll();

            //vision manual button.
            //CDelayTimer tmVisnCycle ;
            //if(IO_GetX(xETC_LStopSw)&& m_iSeqStat == ssStop ){
            //if(tmVisnCycle.OnDelay(true , 1000)) {
            //    tmVisnCycle.Clear();
            //    if(MM.GetManNo() == mcNoneCycle) {
            //        MM.SetManCycle(mcVSN_CycleWork);
            //    }
            //}
            //}
            //else {
            //tmVisnCycle.Clear();
            //}

            bool bStartSw = SM.IO_GetXUp(xi.ETC_StartSw) || m_bBtnStart;
            bool bStopSw  = SM.IO_GetXUp(xi.ETC_StopSw) || m_bBtnStop;
            bool bResetSw = SM.IO_GetXUp(xi.ETC_ResetSw) || m_bBtnReset;
            bool bAirSw   = SM.IO_GetXUp(xi.ETC_AirSw) || m_bBtnAir;

            //bool bInitSw    = SM.IO_GetXUp(xi.ETC_LInitSw ) || SM.IO_GetXUp(xi.ETC_RInitSw )                ;

            if (SM.IO_GetXUp(xi.ETC_StartSw))
            {
                Log.Trace("IO_GetXUp(xETC_StartSw)", "true");
            }

            if (m_bBtnStart)
            {
                Log.Trace("m_bBtnStart", "true");
            }

            if (bStartSw)
            {
                Log.Trace("bStartSw", "Started");

                if (m_iSeqStat == EN_SEQ_STAT.Init)
                {
                    Log.Trace("SeqStat", "ssInit   ");
                }
                if (m_iSeqStat == EN_SEQ_STAT.WorkEnd)
                {
                    Log.Trace("SeqStat", "ssWorkEnd");
                }
                if (m_iSeqStat == EN_SEQ_STAT.Error)
                {
                    Log.Trace("SeqStat", "ssError  ");
                }
                if (m_iSeqStat == EN_SEQ_STAT.Running)
                {
                    Log.Trace("SeqStat", "ssRunning");
                }
                if (m_iSeqStat == EN_SEQ_STAT.Stop)
                {
                    Log.Trace("SeqStat", "ssStop   ");
                }

                if (MM.GetManNo() != (int)mc.NoneCycle)
                {
                    Log.Trace("ManCycle", string.Format(MM.GetManNo().ToString()));
                    bStartSw = false;
                }
            }

            //Update Switch's Lamp
            bool bStopBtnFlick = (m_iStep == EN_SEQ_STEP.ToStopCon || m_iStep == EN_SEQ_STEP.ToStop) && m_bFlick;


            //버튼 클릭시나
            SM.IO_SetY(yi.ETC_StartLp, SM.IO_GetX(xi.ETC_StartSw) || m_bRun);
            SM.IO_SetY(yi.ETC_StopLp, SM.IO_GetX(xi.ETC_StopSw) || !m_bRun || bStopBtnFlick);
            SM.IO_SetY(yi.ETC_ResetLp, SM.IO_GetX(xi.ETC_ResetSw) || (m_bFlick && isErr));
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_LAirLp    , SM.IO.GetX((int)EN_INPUT_ID.xETC_LAirSw   ) || SM.IO.GetY((int)EN_OUTPUT_ID.yETC_MainAirSol));
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_LInitLp   , SM.IO.GetX((int)EN_INPUT_ID.xETC_LInitSw  )                                                 );

            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_RStartLp  , SM.IO.GetX((int)EN_INPUT_ID.xETC_RStartSw ) ||  m_bRun                                      );
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_RStopLp   , SM.IO.GetX((int)EN_INPUT_ID.xETC_RStopSw  ) || !m_bRun || bStopBtnFlick                     );
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_RResetLp  , SM.IO.GetX((int)EN_INPUT_ID.xETC_RResetSw ) || (m_bFlick && isErr)                          );
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_RAirLp    , SM.IO.GetX((int)EN_INPUT_ID.xETC_RAirSw   ) || SM.IO.GetY((int)EN_OUTPUT_ID.yETC_MainAirSol));
            //SM.IO.SetY((int)EN_OUTPUT_ID.yETC_RInitLp   , SM.IO.GetX((int)EN_INPUT_ID.xETC_RInitSw  )                                                 );

            //Center Man Button
            m_bBtnStart = false;
            m_bBtnStop  = false;
            m_bBtnReset = false;
            m_bBtnAir   = false;


            //Init. Button Flags.
            if (bStartSw)
            {
                //bool bAllArayNone = DM.ARAY[riLSP].CheckAllStat(csNone) && DM.ARAY[riLDR].CheckAllStat(csNone) && DM.ARAY[riLST].CheckAllStat(csNone) &&
                //                    DM.ARAY[riPSB].CheckAllStat(csNone) && DM.ARAY[riULD].CheckAllStat(csNone) && DM.ARAY[riVSN].CheckAllStat(csNone)  ;
                if (!isHomeEnd)
                {
                    Log.ShowMessage("Error", "장비 홈을 잡아주세요."); bStartSw = false;
                }
                if (!LOT.GetLotOpen())
                {
                    Log.ShowMessage("Error", "장비 랏오픈을 해주세요."); bStartSw = false;
                }
                if (!InspectStripDispr())
                {
                    m_bInspDispr = true; bStartSw = false;
                }
                if (!InspectStripUnknown())
                {
                    m_bInspUnkwn = true; bStartSw = false;
                }

                if (m_iSeqStat == EN_SEQ_STAT.WorkEnd || m_iSeqStat == EN_SEQ_STAT.RunWarn)
                {
                    Reset();
                }
            }

            //if (bInitSw)
            //{
            //    MM.SetManCycle(mc.AllHome);
            //}

            //Air Switch.
            if (bAirSw && !m_bRun && m_iSeqStat != EN_SEQ_STAT.Init)
            {
                SM.IO_SetY(yi.ETC_MainAirSol, !SM.IO_GetY(yi.ETC_MainAirSol));
            }

            //Buzzer Off.
            if (isErr && bStopSw)
            {
                SML.TL.SetBuzzOff(true);
            }

            //Set Condition Flags.
            if (bStartSw)    //스타트버튼 안눌리는것 때문에 테스트.
            {
                Log.Trace("isErr", isErr ? "true":"false");
                Log.Trace("ManualMan.GetManNo()", string.Format(MM.GetManNo().ToString()));
            }
            if (bStopSw)
            {
                Log.Trace("Stop", "Stop");
            }

            bool isStopCon  = bStopSw || (isErr && !m_bReqStop && m_bRun);
            bool isRunCon   = bStartSw && !isErr /*&& ManualMan.GetManNo() == mcNone*/;
            bool isResetCon = bResetSw && !m_bRun;

            //Run.
            if (isRunCon && (m_iStep == EN_SEQ_STEP.Idle))
            {
                m_iStep = EN_SEQ_STEP.ToStartCon;
                SML.TL.SetBuzzOff(false);
                SML.ER.SetDisp(true);
            }
            if (isRunCon && (m_iStep == EN_SEQ_STEP.Idle))  //스타트버튼 안눌리는것 때문에 테스트.
            {
                Log.Trace("isRunCon && m_iStep", string.Format(m_iStep.ToString()));
            }
            if (isStopCon && (m_iStep != EN_SEQ_STEP.Idle))    //스타트버튼 안눌리는것 때문에 테스트.
            {
                Log.Trace("isStopCon  &&  m_iStep", string.Format(m_iStep.ToString()));
                Log.Trace("bStopSw", bStopSw    ? "True" : "False");
                Log.Trace("isErr", isErr      ? "True" : "False");
                Log.Trace("m_bReqStop", m_bReqStop ? "True" : "False");
                Log.Trace("m_bRun", m_bRun     ? "True" : "False");

                m_bReqStop = true;
            }

            if (isResetCon && (m_iStep == EN_SEQ_STEP.Idle))
            {
                Reset();
            }

            if (m_tmToStrt.OnDelay(m_iStep == EN_SEQ_STEP.ToStartCon || m_iStep == EN_SEQ_STEP.ToStart, 30000))
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStrtTimeOut : m_iStep=%d", m_iStep);
                Log.Trace("SEQ", Msg);
                SML.ER.SetErr((int)ei.ETC_ToStartTO);
                m_iStep = EN_SEQ_STEP.Idle;
                m_bRun  = false;
            }

            //CDelayTimer StopBtn = null;
            //StopBtn = new CDelayTimer();
            //if(m_iStep == EN_SEQ_STEP.scToStopCon)
            //{
            //    if(StopBtn.OnDelay(SM.IO.GetX((int)IP.xETC_StopSw)||SM.IO.GetX((int)IP.xETC_StopSw) , 5000))
            //    {
            //        Log.Trace("SEQ","Forced Stop");
            //        m_bRun = false ;
            //        m_iStep    = EN_SEQ_STEP.scIdle;
            //        m_bReqStop = false;
            //    }
            //}
            //else
            //{
            //    StopBtn.Clear();
            //}


            if (m_tmToStop.OnDelay(m_iStep == EN_SEQ_STEP.ToStopCon || m_iStep == EN_SEQ_STEP.ToStop, 30000))        //  20000)) {
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStopTimeOut : m_iStep=%d", m_iStep);
                Log.Trace("SEQ", Msg);
                m_bRun = false;

                //ToStop();
                SML.ER.SetErr((int)ei.ETC_ToStopTO);
                m_iStep    = EN_SEQ_STEP.Idle;
                m_bReqStop = false;
            }

            EN_SEQ_STEP iPreStep = m_iStep;

            if (iPreStep != m_iStep)
            {
                string sMsg = "";
                sMsg = "Step Changed" + string.Format(iPreStep.ToString()) + " -> " + string.Format(m_iStep.ToString());
                Log.Trace("SEQ", sMsg);
            }
            iPreStep = m_iStep;


            //이상하게 중간에 랏엔드가 되는 현상 발견해서 넣어둠.
            bool bPreLotEnd = LOT.GetLotEnd();

            if (LOT.GetLotEnd() != bPreLotEnd)
            {
                Log.Trace("SEQ", LOT.GetLotEnd() ? "LotEnd True" : "LotEnd False");
            }
            bPreLotEnd = LOT.GetLotEnd();



            //Running Step.
            switch (m_iStep)
            {
            case EN_SEQ_STEP.Idle: return;

            case EN_SEQ_STEP.ToStartCon: if (!ToStartCon())
                {
                    return;
                }
                m_iStep = EN_SEQ_STEP.ToStart;
                Log.Trace("SEQ", "scToStartCon END");
                return;

            case EN_SEQ_STEP.ToStart: if (!ToStart())
                {
                    return;
                }
                m_bRun     = true;
                m_bRunEdge = true;

                m_iStep = EN_SEQ_STEP.Run;
                Log.Trace("SEQ", "scToStart END");
                return;

            case EN_SEQ_STEP.Run: if (!m_bReqStop)
                {
                    if (Autorun())
                    {
                        //랏엔드 상황.
                        LOT.LotEnd();
                        Log.Trace("SEQ", "scRun LotEnd");
                        m_bRunEnd = true;
                        m_iStep   = EN_SEQ_STEP.ToStopCon;
                        ////랏엔드 상황.
                        //LOT.LotEnd();
                        //Log.Trace("SEQ","scRun LotEnd");
                        //m_iStep = EN_SEQ_STEP.ToStopCon ;
                    }
                    return;
                }
                m_bReqStop = false;
                m_iStep    = EN_SEQ_STEP.ToStopCon;
                Log.Trace("SEQ", "scRun END");
                return;

            case EN_SEQ_STEP.ToStopCon:  if (!ToStopCon())
                {
                    if (Autorun())
                    {
                        //랏엔드 상황.
                        LOT.LotEnd();
                        Log.Trace("SEQ", "scToStopCon LotEnd");
                    }
                    return;
                }
                m_bRun  = false;
                m_iStep = EN_SEQ_STEP.ToStop;
                Log.Trace("SEQ", "scToStopCon END");
                return;

            case EN_SEQ_STEP.ToStop:  if (!ToStop())
                {
                    return;
                }
                m_iStep    = EN_SEQ_STEP.Idle;
                m_bReqStop = false;

                DM.SaveMap();
                Log.Trace("SEQ", "scToStop END");

                return;
            }
        }
Exemplo n.º 22
0
 private void btLightOnOff_Click(object sender, EventArgs e)
 {
     SM.IO_SetY(yi.ETC_LightOnOff, !SM.IO_GetY(yi.ETC_LightOnOff));
 }
Exemplo n.º 23
0
        private void tmRot_Tick(object sender, EventArgs e)
        {
            if (iActionID != 0 && iActionID != iPreActionID)
            {
                iActionStep = 10;
                m_tmCycle.Clear();
            }
            iPreActionID = iActionID;

            if (iActionID == 0)
            {
                return;
            }

            string sTemp = "";

            if (m_tmCycle.OnDelay(iActionStep != 0 && iActionStep == iActionPreStep, 4000))
            {
                sTemp = string.Format("iActionStep={0:00}", iActionStep);
                Log.Trace("OperAction TimeOver", sTemp);
                iActionID = 0;
            }

            iActionPreStep = iActionStep;
            switch (iActionStep)
            {
            default:
                sTemp = string.Format("Cycle Default iActionStep={0:00}", iActionStep);
                if (iActionPreStep == iActionStep)
                {
                    Log.Trace("OperAction", sTemp);
                }
                iActionID = 0;
                return;

            case 10:
                if (iActionID == 1)
                {
                    iActionStep = 100;
                }
                if (iActionID == 2)
                {
                    iActionStep = 200;
                }
                if (iActionID == 3)
                {
                    iActionStep = 300;
                }
                if (iActionID == 4)
                {
                    iActionStep = 400;
                }
                return;

            //Unclamp IDXF
            case 100:
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Bwd);
                iActionStep++;
                return;

            case 101:
                if (!SM.CL_Complete(ci.IDXF_ClampClOp, fb.Bwd))
                {
                    return;
                }
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampUpDn, fb.Bwd);
                iActionStep++;
                return;

            case 102:
                if (!SM.CL_Complete(ci.IDXF_ClampUpDn, fb.Bwd))
                {
                    return;
                }
                iActionID = 0;
                return;

            //Unclamp IDXR
            case 200:
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);
                iActionStep++;
                return;

            case 201:
                if (!SM.CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return;
                }
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampUpDn, fb.Bwd);
                iActionStep++;
                return;

            case 202:
                if (!SM.CL_Complete(ci.IDXR_ClampUpDn, fb.Bwd))
                {
                    return;
                }
                iActionID = 0;
                return;

            //clamp IDXF
            case 300:
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampUpDn, fb.Fwd);
                iActionStep++;
                return;

            case 301:
                if (!SM.CL_Complete(ci.IDXF_ClampUpDn, fb.Fwd))
                {
                    return;
                }
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Fwd);
                iActionStep++;
                return;

            case 302:
                if (!SM.CL_Complete(ci.IDXF_ClampClOp, fb.Fwd))
                {
                    return;
                }
                iActionID = 0;
                return;


            //clamp IDXR
            case 400:
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampUpDn, fb.Fwd);
                iActionStep++;
                return;

            case 401:
                if (!SM.CL_Complete(ci.IDXR_ClampUpDn, fb.Fwd))
                {
                    return;
                }
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                iActionStep++;
                return;

            case 402:
                if (!SM.CL_Complete(ci.IDXR_ClampClOp, fb.Fwd))
                {
                    return;
                }
                iActionID = 0;
                return;
            }
        }
Exemplo n.º 24
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            //로그인/로그아웃 방식
            if (SML.FrmLogOn.GetLevel() == (int)EN_LEVEL.LogOff)
            {
                btOperator.Text   = "LOG IN";
                pnDataMap.Enabled = false;
                //pnDayInfo .Enabled = false;
                pnLotInfo.Enabled = false;
                pnError.Enabled   = false;
                pnOperMan.Enabled = false;
                //pnWorkInfo.Enabled = false;
                pnLotOpen.Enabled = false;
                //btStart   .Enabled = LOT.LotList.Count == 0 || !LOT.LotOpened;
                btStart.Enabled      = false;
                btStop.Enabled       = false;
                btReset.Enabled      = false;
                btLightOnOff.Enabled = false;
                btOperator.Enabled   = true;
            }
            else
            {
                btOperator.Text   = SML.FrmLogOn.GetLevel().ToString();
                pnDataMap.Enabled = true;
                //pnDayInfo .Enabled = true;
                pnLotInfo.Enabled = true;
                pnError.Enabled   = true;
                pnOperMan.Enabled = true;
                //pnWorkInfo.Enabled = true;
                pnLotOpen.Enabled = true;
                //btStart   .Enabled = LOT.LotList.Count != 0 || LOT.LotOpened;
                btStart.Enabled      = true;
                btStop.Enabled       = true;
                btReset.Enabled      = true;
                btLightOnOff.Enabled = true;
            }



            btLotOpen.Enabled = !LOT.GetLotOpen();


            lbDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            TimeSpan Span;

            try{
                Span = TimeSpan.FromMilliseconds(SPC.LOT.Data.RunTime);
            }
            catch (Exception ex) {
                Span = TimeSpan.FromMilliseconds(0);
            }
            //label11.Text = OM.EqpStat.iLDRSplyCnt.ToString() ;

            string Str;
            int    iPreErrCnt  = 0;
            int    iCrntErrCnt = 0;

            for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
            {
                if (SML.ER.GetErr(i))
                {
                    iCrntErrCnt++;
                }
            }
            if (iPreErrCnt != iCrntErrCnt)
            {
                lbErr.Items.Clear();
                int iErrNo = SM.ER_GetLastErr();
                for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
                {
                    if (SML.ER.GetErr(i))
                    {
                        Str  = string.Format("[ERR{0:000}]", i);
                        Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrSubMsg(i);
                        lbErr.Items.Add(Str);
                    }
                }
            }
            if (SEQ._iSeqStat != EN_SEQ_STAT.Error)
            {
                lbErr.Items.Clear();
            }
            iPreErrCnt = iCrntErrCnt;


            if (!SM.MT_GetHomeDoneAll())
            {
                btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red;
            }
            else
            {
                btAllHome.ForeColor = Color.Black;
            }

            SPC.LOT.DispLotInfo(lvLotInfo);

            btInputTrayF.Enabled   = !SEQ._bRun;
            btInputTrayG.Enabled   = !SEQ._bRun;
            btAllEmptyTray.Enabled = !SEQ._bRun;
            btBarCodeReTry.Enabled = !SEQ._bRun;

            if (SM.IO_GetX(xi.BARZ_PckrVac))
            {
                lbBarVac.BackColor = Color.Lime;
            }
            else
            {
                lbBarVac.BackColor = Color.Red;
            }

            //JS
            //Manual Button Text.
            if (SM.CL_GetCmd(ci.LODR_ClampClOp) == fb.Bwd)
            {
                btCylinder1.Text = "Loader Clamp OPEN";
            }
            else
            {
                btCylinder1.Text = "Loader Clamp CLOSE";
            }
            btCylinder1.ForeColor = SM.CL_Complete(ci.LODR_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.LODR_SperatorUpDn) == fb.Bwd)
            {
                btCylinder2.Text = "Loader Sperator DOWN";
            }
            else
            {
                btCylinder2.Text = "Loader Sperator Up";
            }
            btCylinder2.ForeColor = SM.CL_Complete(ci.LODR_SperatorUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXR_ClampClOp) == fb.Bwd)
            {
                btCylinder4.Text = "Index Rear Clamp OPEN";
            }
            else
            {
                btCylinder4.Text = "Index Rear Clamp CLOSE";
            }
            btCylinder4.ForeColor = SM.CL_Complete(ci.IDXR_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Bwd)
            {
                btCylinder5.Text = "Index Rear Clamp DOWN";
            }
            else
            {
                btCylinder5.Text = "Index Rear Clamp UP";
            }
            btCylinder5.ForeColor = SM.CL_Complete(ci.IDXR_ClampUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXF_ClampClOp) == fb.Bwd)
            {
                btCylinder6.Text = "Index Front Clamp OPEN";
            }
            else
            {
                btCylinder6.Text = "Index Front Clamp CLOSE";
            }
            btCylinder6.ForeColor = SM.CL_Complete(ci.IDXF_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Bwd)
            {
                btCylinder3.Text = "Index Front Clamp DOWN";
            }
            else
            {
                btCylinder3.Text = "Index Front Clamp UP";
            }
            btCylinder3.ForeColor = SM.CL_Complete(ci.IDXF_ClampUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_RailClOp) == fb.Bwd)
            {
                btCylinder7.Text = "Tray Rail      OPEN";
            }
            else
            {
                btCylinder7.Text = "Tray Rail      CLOSE";
            }
            btCylinder7.ForeColor = SM.CL_Complete(ci.STCK_RailClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_RailTrayUpDn) == fb.Bwd)
            {
                btCylinder8.Text = "Stacker Rail Tray DOWN";
            }
            else
            {
                btCylinder8.Text = "Stacker Rail Tray UP";
            }
            btCylinder8.ForeColor = SM.CL_Complete(ci.STCK_RailTrayUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_StackStprUpDn) == fb.Bwd)
            {
                btCylinder9.Text = "Stacker Stopper DOWN";
            }
            else
            {
                btCylinder9.Text = "Stacker Stopper UP";
            }
            btCylinder9.ForeColor = SM.CL_Complete(ci.STCK_StackStprUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_StackOpCl) == fb.Bwd)
            {
                btCylinder10.Text = "Stacker Rail     CLOSE";
            }
            else
            {
                btCylinder10.Text = "Stacker Rail     OPEN";
            }
            btCylinder10.ForeColor = SM.CL_Complete(ci.STCK_StackOpCl) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_BrcdStprUpDn) == fb.Bwd)
            {
                btCylinder11.Text = "Barcode Stopper DOWN";
            }
            else
            {
                btCylinder11.Text = "Barcode Stopper UP";
            }
            btCylinder11.ForeColor = SM.CL_Complete(ci.BARZ_BrcdStprUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_BrcdTrayUpDn) == fb.Bwd)
            {
                btCylinder12.Text = "Barcode Tray DOWN";
            }
            else
            {
                btCylinder12.Text = "Barcode Tray UP";
            }
            btCylinder12.ForeColor = SM.CL_Complete(ci.BARZ_BrcdTrayUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_YPckrFwBw) == fb.Bwd)
            {
                btCylinder13.Text = "Barcode Picker BWD";
            }
            else
            {
                btCylinder13.Text = "Barcode Picker FWD";
            }
            btCylinder13.ForeColor = SM.CL_Complete(ci.BARZ_YPckrFwBw)    ? Color.Black : Color.Lime;

            btManual1.ForeColor = (MM.GetManNo() == mc.LODR_Home) ? Color.Lime : Color.Black;
            btManual2.ForeColor = (MM.GetManNo() == mc.TOOL_Home) ? Color.Lime : Color.Black;
            btManual3.ForeColor = (MM.GetManNo() == mc.BARZ_Home) ? Color.Lime : Color.Black;
            btManual4.ForeColor = (MM.GetManNo() == mc.IDXR_Home) ? Color.Lime : Color.Black;
            btManual5.ForeColor = (MM.GetManNo() == mc.IDXF_Home) ? Color.Lime : Color.Black;
            btManual6.ForeColor = (MM.GetManNo() == mc.STCK_Home) ? Color.Lime : Color.Black;

            Refresh();
            tmUpdate.Enabled = true;
        }
Exemplo n.º 25
0
 private void btStop_Click(object sender, EventArgs e)
 {
     SM.MT_Stop(m_eId);
 }
Exemplo n.º 26
0
        private void btPos_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;
            //if (m_iId == (int)mi.IDX_X) bRet = SEQ.IDX.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Y) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Z) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);

            if (!bRet)
            {
                return;
            }
            SM.MT_Stop(m_eId);

            sTemp = m_eId.ToString();


            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("Operator", ("FrameMotr Form_" + sTemp + "Motor Pos Move Button Click"));

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        SM.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        SM.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        SM.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        SM.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        SM.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        SM.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }
Exemplo n.º 27
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);
            }
        }
Exemplo n.º 28
0
        private void btLotOpen_Click(object sender, EventArgs e)
        {
            if (tbLotNo.Text == "")
            {
                Log.ShowMessage("Error", "Lot No is Empty");
                return;// tbLotId.Text = DateTime.Now.ToString("HHmmss");
            }
            if (tbMaterialNo.Text == "")
            {
                Log.ShowMessage("Error", "Material No is Empty");
                return;// tbLotId.Text = DateTime.Now.ToString("HHmmss");
            }
            if (tbLotAlias.Text == "")
            {
                Log.ShowMessage("Error", "Lot Alias is Empty");
                return;// tbLotId.Text = DateTime.Now.ToString("HHmmss");
            }
            if (tbEmployeeID.Text == "")
            {
                Log.ShowMessage("Error", "EmployeeID is Empty");
                return;// tbLotId.Text = DateTime.Now.ToString("HHmmss");
            }



            if (!SM.IO_GetX(xi.VISN_Ready))
            {
                Log.ShowMessage("Vision", SM.IO_GetXName(xi.VISN_Ready) + "Vision Ready IO is not On");
                return;
            }
            OM.EqpStat.bWrapingEnd = false;

            Log.Trace("LotOpen", "Try");

            string LotNo  = tbLotNo.Text.Trim();
            string Device = tbSelDevice.Text.Trim();

            CDelayTimer TimeOut = new CDelayTimer();

            TimeOut.Clear();
            SEQ.Visn.SendLotStart(LotNo);
            while (!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.LotStart))
            {
                Thread.Sleep(1);
                if (TimeOut.OnDelay(5000))
                {
                    Log.ShowMessage("Vision", "Lot Start TimeOut");
                    return;
                }
            }

            OM.EqpStat.iWorkBundle = 0;

            LOT.TLot Lot;
            Lot.sEmployeeID = tbEmployeeID.Text.Trim();
            Lot.sLotNo      = tbLotNo.Text.Trim();
            Lot.sMaterialNo = tbMaterialNo.Text.Trim();
            Lot.sLotAlias   = tbLotAlias.Text.Trim();
            LOT.LotOpen(Lot);

            OM.EqpStat.sLotSttTime = DateTime.Now.ToString("HH:mm:ss");
            if (!OM.CmnOptn.bOracleNotUse && !OM.CmnOptn.bIdleRun)
            {
                if (SEQ.Oracle.ProcessLotOpen(Lot.sLotNo, Lot.sMaterialNo, Lot.sLotAlias))
                {
                    if (!DeviceChange(SEQ.Oracle.Stat.sVisionRecipe_RecipeName))
                    {
                        Log.ShowMessage("Device", "'" + SEQ.Oracle.Stat.sVisionRecipe_RecipeName + "'" + "dosn't exist!");
                    }
                }
                else
                {
                    Log.ShowMessage("Oracle", SEQ.Oracle.GetLastMsg());
                    return;
                }
                //유닛아이디 리스트 만들기 시간 오래 걸려서
                //별도 스레드 만듬.
                SEQ.Oracle.ThreadMakeUnitIDDMC1List();
            }
            else
            {
                //Device Change에서 함.
                DM.ARAY[ri.SPLR].SetStat(cs.None);
                DM.ARAY[ri.IDXR].SetStat(cs.None);
                DM.ARAY[ri.IDXF].SetStat(cs.None);
                DM.ARAY[ri.PCKR].SetStat(cs.None);
                DM.ARAY[ri.TRYF].SetStat(cs.None);
                DM.ARAY[ri.TRYG].SetStat(cs.Good);
                DM.ARAY[ri.OUTZ].SetStat(cs.None);
                DM.ARAY[ri.STCK].SetStat(cs.Empty);
                DM.ARAY[ri.BARZ].SetStat(cs.None);
                DM.ARAY[ri.INSP].SetStat(cs.Good);
                DM.ARAY[ri.PSTC].SetStat(cs.None);
                Close();
            }

            //if (Log.ShowMessageModal("Confirm", "Do you want to All Homming?") != DialogResult.Yes) ;

            //20180305 오스람 요청... 랏오픈시에 올홈.
            MM.SetManCycle(mc.AllHome);
        }
Exemplo n.º 29
0
        bool CycleLotStart(ref TCycle _tCycle)
        {
            //Check Cycle Time Out.
            string sTemp;

            if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000))
            {
                SM.ER_SetNeedShowErr(false);
                sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                SM.IO_SetY(yi.VISN_Change, false);
                _tCycle.iStep = 0;
                return(true);
            }

            if (_tCycle.iStep != _tCycle.iPreStep)
            {
                sTemp = string.Format("Step={0:00}", _tCycle.iStep);
                Log.Trace("Vision Communction", sTemp);
            }

            _tCycle.iPreStep = _tCycle.iStep;

            //Cycle.
            switch (_tCycle.iStep)
            {
            default:
                sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                Log.Trace("Vision Communction", sTemp);
                SM.IO_SetY(yi.VISN_Change, false);
                _tCycle.iStep = 0;
                return(true);

            case 10:
                SM.IO_SetY(yi.VISN_LotStart, false);
                _tCycle.iStep++;
                return(false);

            case 11:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                SM.IO_SetY(yi.VISN_LotStart, true);
                _tCycle.iStep++;
                return(false);

            case 12:
                if (!SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                SM.IO_SetY(yi.VISN_LotStart, false);
                _tCycle.iStep++;
                return(false);

            case 13:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                _tCycle.iStep = 0;
                return(true);
            }
        }
Exemplo n.º 30
0
        //bool bNeedToBarcode = false ;
        public bool CycleBarcode()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 30000))
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + "-" + GetCrntCycleName() + sTemp;
                ER_SetErr(ei.PRT_CycleTO, sTemp);
                Log.Trace(m_sPartName, sTemp);
                return(true);
            }

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

            if (IO_GetX(xi.IDXR_Overload))
            {
                MT_Stop(mi.IDXR_XRear);
                ER_SetErr(ei.PRT_OverLoad, "Rear Index is Overload Error");
                return(true);
            }

            PreStep.iCycle = Step.iCycle;

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

            LOT.TLot Lot;



            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:                                                          //sometime when barcode works failed.!
                if (!OM.CmnOptn.bIdleRun && IO_GetX(xi.RAIL_TrayDtct2) && !MT_CmprPos(mi.IDXR_XRear, PM_GetValue(mi.IDXR_XRear, pv.IDXR_XRearBarcode)))
                {
                    //ER_SetErr(ei.PRT_Detect , IO_GetXName(xi.RAIL_TrayDtct2) +" is Something Detected!");
                    //return true ;
                }
                OM.EqpStat.sTraySttTime  = DateTime.Now.ToString("HH:mm:ss");
                OM.EqpStat.dTrayWorkTime = SEQ.bTrayWorkTimer ? SEQ.m_cyTrayWorktime.CheckTime_s() : 0;
                OM.EqpStat.dTrayUPH      = SEQ.bTrayWorkTimer ? 3600 / (OM.EqpStat.dTrayWorkTime / (DM.ARAY[ri.IDXF].GetMaxCol() * DM.ARAY[ri.IDXF].GetMaxRow() - DM.ARAY[ri.IDXF].GetCntStat(cs.None))) : 0;
                SEQ.m_cyTrayWorktime.Clear();
                SEQ.bTrayWorkTimer = true;

                if (OM.CmnOptn.bIdleRun)
                {
                    Step.iCycle = 100;
                    return(false);
                }

                //이조건이면 바코드 안찍는다.
                if (!OM.CmnOptn.bIdleRun)       //아이들 런이면 첫장부터 작업 한다.
                {
                    if (OM.GetSupplyCnt() == 1 || (OM.DevOptn.bUseBtmCover && OM.GetSupplyCnt() == OM.DevInfo.iTRAY_StackingCnt) || OM.CmnOptn.bGoldenTray)
                    {
                        Step.iCycle = 50;
                        return(false);
                    }
                }

                Step.iCycle++;
                return(false);

            case 11:

                if (!IO_GetX(xi.IDXR_TrayDtct) && !OM.CmnOptn.bIdleRun)
                {
                    ER_SetErr(ei.PKG_Dispr, "Rear Index tray detect sensor Not detected.");
                    return(true);
                }
                //Don need to barcode scan
                SEQ.BarcordLODR.SendScanOn();

                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearBarcode);
                Step.iCycle++;
                return(false);

            case 12:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearBarcode))
                {
                    return(false);
                }
                if (!OM.CmnOptn.bIdleRun && !IO_GetX(xi.RAIL_TrayDtct2))    //sensor zone is over when col 0
                {
                    ER_SetErr(ei.PRT_Missed, IO_GetXName(xi.RAIL_TrayDtct2) + " is Not Detected!");
                    return(true);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);    //레일 초기 진입시에 크리퍼랑 레일이랑 찐따지는것 방지용. 한번 풀었다 잡는다.
                Step.iCycle++;
                return(false);

            case 13:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return(false);
                }
                m_tmDelay.Clear();
                Step.iCycle++;
                return(false);

            case 14:
                if (m_tmDelay.OnDelay(3000))     //바코드 못읽었을때 상황.
                {
                    if (SEQ.BarcordLODR.GetText() == "")
                    {
                        ER_SetErr(ei.PRT_Barcode, "Barcode Reading Failed");
                        return(true);
                    }
                }
                if (SEQ.BarcordLODR.GetText() == "")
                {
                    return(false);
                }

                //temp
                //SEQ.LODR.iLDRSplyCnt++;

                if (SPC.LOT.Data.TrayNo == "")
                {
                    SPC.LOT.Data.TrayNo = SEQ.BarcordLODR.GetText();
                }
                OM.EqpStat.sTrayLabel = SEQ.BarcordLODR.GetText();

                if (!OM.CmnOptn.bOracleNotUse)
                {
                    if (!SEQ.Oracle.ProcessTrayLabel(OM.EqpStat.sTrayLabel))
                    {
                        SM.ER_SetErr(ei.ETC_Oracle, SEQ.Oracle.GetLastMsg());
                        Log.Trace("Oracle Fail Message", SEQ.Oracle.GetLastMsg());
                        return(true);
                    }

                    //쓰레드로 돌린다 PanelID가 많을때 10만개 정도...
                    SEQ.Oracle.ThreadMakePanelIDList();
                }

                Step.iCycle++;
                return(false);

            case 15:
                if (!OM.CmnOptn.bOracleNotUse)
                {
                    //쓰레드로 돌린다 PanelID가 많을때 10만개 정도...
                    if (COracle.bMakingPanelList)
                    {
                        return(false);
                    }
                    if (!COracle.bMakePanelListRet)
                    {
                        ER_SetErr(ei.ETC_Oracle, SEQ.Oracle.GetLastMsg());
                        return(true);
                    }
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                Step.iCycle++;
                return(false);

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

            case 17:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                Step.iCycle = 0;
                return(true);



            //골든디바이스 및 빈트레이일때 위에서 씀.
            case 50:
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1);
                Step.iCycle++;
                return(false);

            case 51:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);     //레일 초기 진입시에 크리퍼랑 레일이랑 찐따지는것 방지용. 한번 풀었다 잡는다.
                Step.iCycle++;
                return(false);

            case 52:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return(false);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 53:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Fwd))
                {
                    return(false);
                }


                //골드트레이가 아니고서.
                if (!OM.CmnOptn.bGoldenTray)
                {
                    DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Empty);
                    if (OM.CmnOptn.iInspCrvrTray == (int)vi.One)
                    {
                        DM.ARAY[ri.IDXR].SetStat(OM.DevInfo.iTRAY_PcktCntX - 1, 0, cs.Vision);
                    }
                    else if (OM.CmnOptn.iInspCrvrTray == (int)vi.Col)
                    {
                        for (int i = 0; i < OM.DevInfo.iTRAY_PcktCntY; i++)
                        {
                            DM.ARAY[ri.IDXR].SetStat(OM.DevInfo.iTRAY_PcktCntX - 1, i, cs.Vision);
                        }
                    }
                    else if (OM.CmnOptn.iInspCrvrTray == (int)vi.All)
                    {
                        DM.ARAY[ri.IDXR].SetStat(cs.Vision);
                    }
                    else
                    {
                        DM.ARAY[ri.IDXR].SetStat(cs.Vision);
                    }
                }
                else
                {
                    DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                }
                Step.iCycle = 0;
                return(true);


            //아이들 러닝용 위애서 씀.
            case 100:
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearBarcode);
                Step.iCycle++;
                return(false);

            case 101:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearBarcode))
                {
                    return(false);
                }
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1);
                Step.iCycle++;
                return(false);

            case 102:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                Step.iCycle = 0;
                return(true);
            }
        }