示例#1
0
        private void FormOperation_FormClosing(object sender, FormClosingEventArgs e)
        {
            tmUpdate.Enabled = false;
            DM.SaveMap();

            //VL.Close();
        }
示例#2
0
        public static void Init()
        {
            SML.TPara Para;

            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            Para.iWidth          = 1280;
            Para.iHeight         = 863;
            Para.bTabHides       = new bool[6];
            Para.bUseErrPic      = true;
            Para.iCntErr         = 60;
            Para.iCntDIn         = 32;
            Para.iCntDOut        = 32;
            Para.iCntCylinder    = 9;
            Para.iCntMotr        = 3;
            Para.eLanSel         = EN_LAN_SEL.English;
            Para.eDio            = EN_DIO_SEL.AXL;
            Para.eMotors         = new EN_MOTR_SEL[Para.iCntMotr];

            Para.eMotors[0] = EN_MOTR_SEL.AXL;
            Para.eMotors[1] = EN_MOTR_SEL.AXL;
            Para.eMotors[2] = EN_MOTR_SEL.AXL;

            SML.Init(Para);
            DM.Init();
            OM.Init();
            LOT.Init();
            SPC.Init();
            PM.Init(PM.PstnCnt);

            MainThread.Priority = ThreadPriority.Highest;
            //MainThread.Priority = ThreadPriority.Normal;
            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_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.IDX] = IDX;
        }
示例#3
0
        public FormOperation(Panel _pnBase)
        {
            InitializeComponent();

            this.TopLevel = false;
            this.Parent   = _pnBase;

            //DispDayList();
            DispLotInfo();

            FrmCam = new FormCam(pnCam);
            FrmCam.Show();

            //Loader
            //DM.ARAY[ri.LODR].SetDisp     (cs.None     , "None"     , Color.White        );
            //DM.ARAY[ri.USBR].SetMaxColRow(1           , 1                           );
            //DM.ARAY[ri.USBL].SetMaxColRow(1           , 1                           );

            DM.LoadMap();
        }
示例#4
0
        public FormOperation(Panel _pnBase)
        {
            InitializeComponent();

            FrmPassword = new FormPassword();
            FrmLotOpen  = new FormLotOpen();

            this.TopLevel = false;
            this.Parent   = _pnBase;

            //FrmMain = _FrmMain;
            DayInfoList();
            LotInfoList();

            pnPassWord.Visible = false;
            tmUpdate.Enabled   = true;

            btLotEnd.Enabled  = LOT.GetLotOpen();
            btStart.Enabled   = LOT.GetLotOpen();
            btLotOpen.Enabled = !LOT.GetLotOpen();
            //
            DM.ARAY[(int)ri.IDX].SetParent(pnIdx);
            DM.ARAY[(int)ri.IDX].Name = "riIDX";
            DM.ARAY[(int)ri.IDX].SetDispColor(cs.None, Color.White); DM.ARAY[(int)ri.IDX].SetDispName(cs.None, "NotExsist"); DM.ARAY[(int)ri.IDX].SetVisible(cs.None, true);
            DM.ARAY[(int)ri.IDX].SetDispColor(cs.Empty, Color.Gray); DM.ARAY[(int)ri.IDX].SetDispName(cs.Empty, "Empty"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Empty, true);
            DM.ARAY[(int)ri.IDX].SetDispColor(cs.Unkwn, Color.Aqua); DM.ARAY[(int)ri.IDX].SetDispName(cs.Unkwn, "Unknown"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Unkwn, true);
            DM.ARAY[(int)ri.IDX].SetDispColor(cs.Move, Color.Yellow); DM.ARAY[(int)ri.IDX].SetDispName(cs.Move, "Move"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Move, true);
            DM.ARAY[(int)ri.IDX].SetDispColor(cs.Work, Color.Blue); DM.ARAY[(int)ri.IDX].SetDispName(cs.Work, "Work"); DM.ARAY[(int)ri.IDX].SetVisible(cs.Work, true);
            DM.ARAY[(int)ri.IDX].SetMaxColRow(1, 1);

            //
            //DM.ARAY[(int)ri.PST_IDX].SetParent(pnPst);
            //DM.ARAY[(int)ri.PST_IDX].Name = "riPst";
            //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.None , Color.White ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.None , "NotExsist" ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.None , true);
            //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.Empty, Color.Gray  ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.Empty, "Empty"     ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.Empty, true);
            //DM.ARAY[(int)ri.PST_IDX].SetDispColor(cs.Work , Color.Blue  ); DM.ARAY[(int)ri.PST_IDX].SetDispName(cs.Work , "Work"      ); DM.ARAY[(int)ri.PST_IDX].SetVisible(cs.Work , true);
            //DM.ARAY[(int)ri.PST_IDX].SetMaxColRow(1,  5);

            DM.LoadMap();
        }
示例#5
0
        //public EN_SEQ_STAT m_iSeqStat;

        public FormOperation(Panel _pnBase)
        {
            InitializeComponent();

            //sFormText = this.GetType().Name;

            this.TopLevel = false;
            this.Parent   = _pnBase;

            //DispDayList();
            DispLotInfo();

            MakeDoubleBuffered(pnULDR, true);
            MakeDoubleBuffered(pnPSHR, true);
            MakeDoubleBuffered(pnPICK, true);
            MakeDoubleBuffered(pnPULD, true);
            MakeDoubleBuffered(pnTULD, true);
            MakeDoubleBuffered(pnTMRK, true);
            MakeDoubleBuffered(pnTRJM, true);
            MakeDoubleBuffered(pnTVSN, true);
            MakeDoubleBuffered(pnTLDR, true);
            MakeDoubleBuffered(pnTRJV, true);
            MakeDoubleBuffered(pnPLDR, true);
            MakeDoubleBuffered(pnLODR, true);
            //tmUpdate.Enabled = true;

            //btStart.Enabled = LOT.GetLotOpen();

            m_tmStartBt = new CDelayTimer();

            DM.ARAY[ri.LODR].SetParent(pnLODR); DM.ARAY[ri.LODR].Name = "LODR";
            DM.ARAY[ri.PLDR].SetParent(pnPLDR); DM.ARAY[ri.PLDR].Name = "PLDR";
            DM.ARAY[ri.TLDR].SetParent(pnTLDR); DM.ARAY[ri.TLDR].Name = "TLDR";
            DM.ARAY[ri.TVSN].SetParent(pnTVSN); DM.ARAY[ri.TVSN].Name = "TVSN";
            DM.ARAY[ri.TMRK].SetParent(pnTMRK); DM.ARAY[ri.TMRK].Name = "TMRK";
            DM.ARAY[ri.TULD].SetParent(pnTULD); DM.ARAY[ri.TULD].Name = "TULD";
            DM.ARAY[ri.TRJM].SetParent(pnTRJM); DM.ARAY[ri.TRJM].Name = "TRJM";
            DM.ARAY[ri.TRJV].SetParent(pnTRJV); DM.ARAY[ri.TRJV].Name = "TRJV";
            DM.ARAY[ri.PULD].SetParent(pnPULD); DM.ARAY[ri.PULD].Name = "PULD";
            DM.ARAY[ri.ULDR].SetParent(pnULDR); DM.ARAY[ri.ULDR].Name = "ULDR";
            DM.ARAY[ri.PICK].SetParent(pnPICK); DM.ARAY[ri.PICK].Name = "PICK";
            DM.ARAY[ri.PSHR].SetParent(pnPSHR); DM.ARAY[ri.PSHR].Name = "PSHR";
            //DM.ARAY[ri.MASK].SetParent(pnSTCK); DM.ARAY[ri.PSTC].Name = "PSTC";

            //Loader
            DM.ARAY[ri.LODR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.LODR].SetDisp(cs.Work, "Work", Color.Yellow);
            DM.ARAY[ri.LODR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.LODR].SetDisp(cs.Empty, "Empty", Color.Silver);

            //Index Rear
            DM.ARAY[ri.PLDR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PLDR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);

            //Index Rear
            DM.ARAY[ri.TLDR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TLDR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);

            //Index Front
            DM.ARAY[ri.TVSN].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TVSN].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.TVSN].SetDisp(cs.Good, "Good", Color.Green);
            DM.ARAY[ri.TVSN].SetDisp(cs.NGVisn, "Visn Fail", Color.Coral);

            //Picker
            DM.ARAY[ri.TMRK].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TMRK].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.TMRK].SetDisp(cs.Good, "Good", Color.Green);
            DM.ARAY[ri.TMRK].SetDisp(cs.NGVisn, "Visn Fail", Color.Coral);
            DM.ARAY[ri.TMRK].SetDisp(cs.NGMark, "Mark Fail", Color.Red);

            //Fail Tray
            DM.ARAY[ri.TULD].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TULD].SetDisp(cs.Good, "Good", Color.Lime);
            DM.ARAY[ri.TULD].SetDisp(cs.NGVisn, "Visn Fail", Color.Coral);
            DM.ARAY[ri.TULD].SetDisp(cs.NGMark, "Mark Fail", Color.Red);

            //Good Tray
            DM.ARAY[ri.TRJM].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TRJM].SetDisp(cs.NGVisn, "Visn Fail", Color.Coral);
            DM.ARAY[ri.TRJM].SetDisp(cs.NGMark, "Mark Fail", Color.Red);

            //Out Zone
            DM.ARAY[ri.TRJV].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TRJV].SetDisp(cs.NGVisn, "Visn Fail", Color.Coral);

            //Out Zone
            DM.ARAY[ri.PULD].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PULD].SetDisp(cs.Good, "Good", Color.Lime);

            //Pre Stack Zone
            DM.ARAY[ri.ULDR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.ULDR].SetDisp(cs.Work, "Work", Color.Yellow);
            DM.ARAY[ri.ULDR].SetDisp(cs.WorkEnd, "WorkEnd", Color.Blue);
            DM.ARAY[ri.ULDR].SetDisp(cs.Empty, "Empty ", Color.Silver);

            DM.ARAY[ri.PICK].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PICK].SetDisp(cs.Empty, "Empty ", Color.Silver);
            DM.ARAY[ri.PICK].SetDisp(cs.Unknown, "Unknown ", Color.Aqua);

            DM.ARAY[ri.PSHR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PSHR].SetDisp(cs.Good, "Good  ", Color.Lime);



            DM.LoadMap();


            var path = new System.Drawing.Drawing2D.GraphicsPath();

            path.AddEllipse(0, 0, pnTMRK.Width, pnTMRK.Height);
            pnTMRK.Region = new Region(path);
            pnTULD.Region = new Region(path);
            pnTRJM.Region = new Region(path);
            pnTVSN.Region = new Region(path);
            pnTLDR.Region = new Region(path);
            pnTRJV.Region = new Region(path);
            pnPLDR.Region = new Region(path);
            pnPSHR.Region = new Region(path);
            pnPICK.Region = new Region(path);
            pnPULD.Region = new Region(path);
        }
示例#6
0
        private static void UpdateButton()
        {
            //Check Inspect.
            //if (!OM.CmnOptn.bIgnrDoor)
            InspectDoor();

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

            if (m_iStep == EN_SEQ_STEP.Idle)
            {
                InspectLightGrid();
            }
            //Local Var.
            bool isErr     = SM.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;   // || SM.IO_GetXUp(xi.ETC_StartSwR) || m_bBtnStart ;
            bool bStopSw  = SM.IO_GetXUp(xi.ETC_StopSw) || m_bBtnStop;     // || SM.IO_GetXUp(xi.ETC_StopSwR ) || m_bBtnStop  ;
            bool bResetSw = SM.IO_GetXUp(xi.ETC_ResetSw) || m_bBtnReset;   // || SM.IO_GetXUp(xi.ETC_ResetSwR) || m_bBtnReset ;
            bool bAirSw   = m_bBtnAir;
            bool bInitSw  = SM.IO_GetXUp(xi.ETC_InitSw);

            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 (m_iSeqStat == EN_SEQ_STAT.RunWarn)
                {
                    Log.Trace("SeqStat", "ssRunWarn");
                }

                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(yi.ETC_AirLp     , SM.IO_GetX(xi.ETC_AirSw    ) || SM.IO_GetY(yi.ETC_MainAirSol     ));
            SM.IO_SetY(yi.ETC_InitLp, SM.IO_GetX(xi.ETC_InitSw));

            //  SM.IO_SetY(yi.ETC_StartLpR  , SM.IO_GetX(xi.ETC_StartSwR ) ||  m_bRun                             );
            //  SM.IO_SetY(yi.ETC_StopLpR   , SM.IO_GetX(xi.ETC_StopSwR  ) || !m_bRun || bStopBtnFlick            );
            //  SM.IO_SetY(yi.ETC_ResetLpR  , SM.IO_GetX(xi.ETC_ResetSwR ) || (m_bFlick && isErr)                 );
            ////SM.IO_SetY(yi.ETC_AirLp     , SM.IO_GetX(xi.ETC_AirSw    ) || SM.IO_GetY(yi.ETC_MainAirSol     ));
            //  SM.IO_SetY(yi.ETC_InitLpR   , SM.IO_GetX(xi.ETC_InitSwR  )                                        );

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


            //Init. Button Flags.
            if (bStartSw)
            {
                if (!SM.IO_GetX(xi.VISN_Ready))
                {
                    Log.ShowMessage("Vision", SM.IO_GetXName(xi.VISN_Ready) + "Vision Ready IO is not On");
                    bStartSw = false;
                }
                if (COracle.bMakingDMC1List)
                {
                    Log.ShowMessage("OracleDB", "Please Wait for Finish Making DMC1 List!");
                    bStartSw = false;
                }
                if (COracle.bMakingPanelList)
                {
                    Log.ShowMessage("OracleDB", "Please Wait for Finish Making Panel List!");
                    bStartSw = false;
                }
                //if(!RockKey.Check()) { Log.ShowMessage("Error" , "Rock Key Error"        ); bStartSw = false ; }
                if (!isHomeEnd)
                {
                    Log.ShowMessage("Error", "Please Initial First"); bStartSw = false;
                }
                //

                if (!LOT.GetLotOpen())
                {
                    Log.ShowMessage("Error", "Open Lot!"); 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((int)yi.ETC_MainAirSol , !SM.IO_GetY((int)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);
                SM.ER_SetNeedShowErr(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);
                SM.ER_SetErr(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;

                SM.ER_SetErr(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())
                    {
                        //랏엔드 상황.

                        if (OM.CmnOptn.bGoldenTray)
                        {
                            LOT.LotEnd();
                            int iIdx = 0;
                            if (DM.ARAY[ri.IDXR].CheckAllStat(cs.None))
                            {
                                iIdx = ri.IDXF;
                            }
                            else
                            {
                                iIdx = ri.IDXR;
                            }
                            int iCntGood = DM.ARAY[iIdx].GetCntStat(cs.Good);
                            int iCntNG   = DM.ARAY[iIdx].GetCntStat(cs.NG1) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG2) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG3) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG4) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG5) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG6) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG7) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG8) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG9) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG10);
                            int iCntEmpty = DM.ARAY[iIdx].GetCntStat(cs.NG0);
                            Log.ShowMessage("Golden Tray Ended", "Good=" + iCntGood + " NG=" + iCntNG + " Empty=" + iCntEmpty);
                            SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Bwd);
                            SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);
                        }
                        else
                        {
                            if (OM.EqpStat.iWorkBundle >= OM.DevInfo.iTRAY_BundleCnt)
                            {
                                LOT.LotEnd();
                                Log.ShowMessage("Checked", "Lot Ended.");
                                Log.Trace("SEQ", LOT.GetLotNo() + "LotEnd");
                            }
                            else
                            {
                                m_bRunEnd = true;
                                Log.ShowMessage("Checked", OM.EqpStat.iWorkBundle.ToString() + " Bundle Ended.");
                                Log.Trace("SEQ", LOT.GetLotNo() + OM.EqpStat.iWorkBundle.ToString() + "BundleEnd");
                                OM.EqpStat.bWrapingEnd = false;                                   //요걸 초기화 해야 로딩을 한다.
                            }
                        }

                        //m_bRunEnd = true;
                        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())
                    {
                        if (OM.CmnOptn.bGoldenTray)
                        {
                            LOT.LotEnd();
                            int iIdx = 0;
                            if (DM.ARAY[ri.IDXR].CheckAllStat(cs.None))
                            {
                                iIdx = ri.IDXF;
                            }
                            else
                            {
                                iIdx = ri.IDXR;
                            }
                            int iCntGood = DM.ARAY[iIdx].GetCntStat(cs.Good);
                            int iCntNG   = DM.ARAY[iIdx].GetCntStat(cs.NG1) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG2) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG3) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG4) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG5) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG6) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG7) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG8) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG9) +
                                           DM.ARAY[iIdx].GetCntStat(cs.NG10);
                            int iCntEmpty = DM.ARAY[iIdx].GetCntStat(cs.NG0);
                            Log.ShowMessage("Golden Tray Ended", "Good=" + iCntGood + " NG=" + iCntNG + " Empty=" + iCntEmpty);
                            SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Bwd);
                            SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);
                        }
                        else
                        {
                            if (OM.EqpStat.iWorkBundle >= OM.DevInfo.iTRAY_BundleCnt)
                            {
                                LOT.LotEnd();
                                Log.ShowMessage("Checked", "Lot Ended.");
                                Log.Trace("SEQ", LOT.GetLotNo() + "LotEnd");
                            }
                            else
                            {
                                m_bRunEnd = true;
                                Log.ShowMessage("Checked", OM.EqpStat.iWorkBundle.ToString() + " Bundle Ended.");
                                Log.Trace("SEQ", LOT.GetLotNo() + OM.EqpStat.iWorkBundle.ToString() + "BundleEnd");
                                OM.EqpStat.bWrapingEnd = false;                                   //요걸 초기화 해야 로딩을 한다.
                            }
                        }
                    }
                    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;
            }
        }
示例#7
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;
            }
        }
示例#8
0
        //public EN_SEQ_STAT m_iSeqStat;

        public FormOperation(Panel _pnBase)
        {
            InitializeComponent();

            this.TopLevel = false;
            this.Parent   = _pnBase;

            //DispDayList();
            DispLotInfo();

            tmUpdate.Enabled = true;

            //btStart.Enabled = LOT.GetLotOpen();

            m_tmStartBt = new CDelayTimer();

            DM.ARAY[ri.SPLR].SetParent(pnSPLR); DM.ARAY[ri.SPLR].Name = "SPLR";
            DM.ARAY[ri.IDXR].SetParent(pnIDXR); DM.ARAY[ri.IDXR].Name = "IDXR";
            DM.ARAY[ri.IDXF].SetParent(pnIDXF); DM.ARAY[ri.IDXF].Name = "IDXF";
            DM.ARAY[ri.PCKR].SetParent(pnPCKR); DM.ARAY[ri.PCKR].Name = "PCKR";
            DM.ARAY[ri.TRYF].SetParent(pnTRYF); DM.ARAY[ri.TRYF].Name = "TRYF";
            DM.ARAY[ri.TRYG].SetParent(pnTRYG); DM.ARAY[ri.TRYG].Name = "TRYG";
            DM.ARAY[ri.OUTZ].SetParent(pnOUTZ); DM.ARAY[ri.OUTZ].Name = "OUTZ";
            DM.ARAY[ri.STCK].SetParent(pnSTCK); DM.ARAY[ri.STCK].Name = "STCK";
            DM.ARAY[ri.BARZ].SetParent(pnBARC); DM.ARAY[ri.BARZ].Name = "BARC";
            DM.ARAY[ri.INSP].SetParent(pnINSP); DM.ARAY[ri.INSP].Name = "INSP";
            DM.ARAY[ri.PSTC].SetParent(pnPSTC); DM.ARAY[ri.PSTC].Name = "PSTC";
            //DM.ARAY[ri.MASK].SetParent(pnSTCK); DM.ARAY[ri.PSTC].Name = "PSTC";

            //Loader
            DM.ARAY[ri.SPLR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.SPLR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.SPLR].SetDisp(cs.Empty, "Empty", Color.Silver);

            //Index Rear
            DM.ARAY[ri.IDXR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.IDXR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.IDXR].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.IDXR].SetDisp(cs.Vision, "Vision", Color.Yellow);
            DM.ARAY[ri.IDXR].SetDisp(cs.Good, "Good", Color.Green);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG0, "V_Empty", Color.Orange);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG1, "V_MixDevice", Color.Coral);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG2, "V_UnitID", Color.DarkOrchid);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG3, "V_UnitDMC1", Color.DarkTurquoise);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG4, "V_UnitDMC2", Color.Olive);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG5, "V_GlobtopLeft", Color.DeepSkyBlue);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG6, "V_GlobtopTop", Color.Crimson);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG7, "V_GlobtopRight", Color.SlateBlue);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG8, "V_GlobtopBottom", Color.DarkCyan);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG9, "V_MatchingError", Color.DarkKhaki);
            DM.ARAY[ri.IDXR].SetDisp(cs.NG10, "V_UserDefine", Color.DarkGoldenrod);

            //Index Front
            DM.ARAY[ri.IDXF].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.IDXF].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.IDXF].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.IDXF].SetDisp(cs.Vision, "Vision", Color.Yellow);
            DM.ARAY[ri.IDXF].SetDisp(cs.Good, "Good", Color.Green);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG0, "V_Empty", Color.Orange);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG1, "V_MixDevice", Color.Coral);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG2, "V_UnitID", Color.DarkOrchid);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG3, "V_UnitDMC1", Color.DarkTurquoise);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG4, "V_UnitDMC2", Color.Olive);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG5, "V_GlobtopLeft", Color.DeepSkyBlue);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG6, "V_GlobtopTop", Color.Crimson);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG7, "V_GlobtopRight", Color.SlateBlue);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG8, "V_GlobtopBottom", Color.DarkCyan);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG9, "V_MatchingError", Color.DarkKhaki);
            DM.ARAY[ri.IDXF].SetDisp(cs.NG10, "V_UserDefine", Color.DarkGoldenrod);

            //Picker
            DM.ARAY[ri.PCKR].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PCKR].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.PCKR].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.PCKR].SetDisp(cs.Good, "Good", Color.Green);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG0, "V_Empty", Color.Orange);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG1, "V_MixDevice", Color.Coral);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG2, "V_UnitID", Color.DarkOrchid);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG3, "V_UnitDMC1", Color.DarkTurquoise);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG4, "V_UnitDMC2", Color.Olive);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG5, "V_GlobtopLeft", Color.DeepSkyBlue);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG6, "V_GlobtopTop", Color.Crimson);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG7, "V_GlobtopRight", Color.SlateBlue);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG8, "V_GlobtopBottom", Color.DarkCyan);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG9, "V_MatchingError", Color.DarkKhaki);
            DM.ARAY[ri.PCKR].SetDisp(cs.NG10, "V_UserDefine", Color.DarkGoldenrod);

            //Fail Tray
            DM.ARAY[ri.TRYF].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TRYF].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG0, "V_Empty", Color.Orange);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG1, "V_MixDevice", Color.Coral);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG2, "V_UnitID", Color.DarkOrchid);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG3, "V_UnitDMC1", Color.DarkTurquoise);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG4, "V_UnitDMC2", Color.Olive);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG5, "V_GlobtopLeft", Color.DeepSkyBlue);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG6, "V_GlobtopTop", Color.Crimson);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG7, "V_GlobtopRight", Color.SlateBlue);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG8, "V_GlobtopBottom", Color.DarkCyan);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG9, "V_MatchingError", Color.DarkKhaki);
            DM.ARAY[ri.TRYF].SetDisp(cs.NG10, "V_UserDefine", Color.DarkGoldenrod);

            //Good Tray
            DM.ARAY[ri.TRYG].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.TRYG].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.TRYG].SetDisp(cs.Good, "Good", Color.Green);

            //Out Zone
            DM.ARAY[ri.OUTZ].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.OUTZ].SetDisp(cs.Good, "Good", Color.Green);

            //Pre Stack Zone
            DM.ARAY[ri.PSTC].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PSTC].SetDisp(cs.Good, "Good", Color.Green);

            //Stack Zone
            DM.ARAY[ri.STCK].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.STCK].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.STCK].SetDisp(cs.Good, "Good", Color.Green);

            //Barcode Zone
            DM.ARAY[ri.BARZ].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.BARZ].SetDisp(cs.Unknown, "UnKnown", Color.Aqua);
            DM.ARAY[ri.BARZ].SetDisp(cs.Barcode, "Barcode", Color.Tan);
            DM.ARAY[ri.BARZ].SetDisp(cs.BarRead, "BarRead", Color.Fuchsia);
            DM.ARAY[ri.BARZ].SetDisp(cs.WorkEnd, "WorkEnd", Color.Blue);

            DM.ARAY[ri.INSP].SetDisp(cs.NG0, "V_Empty", Color.Orange);
            DM.ARAY[ri.INSP].SetDisp(cs.NG1, "V_MixDevice", Color.Coral);
            DM.ARAY[ri.INSP].SetDisp(cs.NG2, "V_UnitID", Color.DarkOrchid);
            DM.ARAY[ri.INSP].SetDisp(cs.NG3, "V_UnitDMC1", Color.DarkTurquoise);
            DM.ARAY[ri.INSP].SetDisp(cs.NG4, "V_UnitDMC2", Color.Olive);
            DM.ARAY[ri.INSP].SetDisp(cs.NG5, "V_GlobtopLeft", Color.DeepSkyBlue);
            DM.ARAY[ri.INSP].SetDisp(cs.NG6, "V_GlobtopTop", Color.Crimson);
            DM.ARAY[ri.INSP].SetDisp(cs.NG7, "V_GlobtopRight", Color.SlateBlue);
            DM.ARAY[ri.INSP].SetDisp(cs.NG8, "V_GlobtopBottom", Color.DarkCyan);
            DM.ARAY[ri.INSP].SetDisp(cs.NG9, "V_MatchingError", Color.DarkKhaki);
            DM.ARAY[ri.INSP].SetDisp(cs.NG10, "V_UserDefine", Color.DarkGoldenrod);
            DM.ARAY[ri.INSP].SetDisp(cs.Good, "Good", Color.Green);


            DM.ARAY[ri.SPLR].SetMaxColRow(1, 1);
            DM.ARAY[ri.IDXR].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.IDXF].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.PCKR].SetMaxColRow(1, 1);
            DM.ARAY[ri.TRYF].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.TRYG].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.OUTZ].SetMaxColRow(1, 1);
            DM.ARAY[ri.PSTC].SetMaxColRow(1, 1);
            DM.ARAY[ri.STCK].SetMaxColRow(1, OM.DevInfo.iTRAY_StackingCnt);
            DM.ARAY[ri.BARZ].SetMaxColRow(1, 1);
            DM.ARAY[ri.INSP].SetMaxColRow(1, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.PSTC].SetMaxColRow(1, 1);
            DM.ARAY[ri.MASK].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);


            DM.ARAY[ri.IDXR].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.IDXF].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.TRYF].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.TRYG].SetMask(DM.ARAY[ri.MASK]);



            FrmPrint = new FormPrint();
            //FrmOracle = new FormOracle();

            SEQ.Oracle.SetSendMsgFunc(SendListMsg);

            DM.LoadMap();
        }
示例#9
0
 private void FormOperation_FormClosing(object sender, FormClosingEventArgs e)
 {
     SEQ.Oracle.SetSendMsgFunc(null);
     tmUpdate.Enabled = false;
     DM.SaveMap();
 }
示例#10
0
        //Serial통신
        //static public RS232_3310g         Barcord = new RS232_3310g        (4, "Barcord"   );
        public static void Init()
        {
            SM.TPara Para;
            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            Para.iWidth          = 1280;
            Para.iHeight         = 863;
            Para.bTabHides       = new bool[6];

            Para.bUseErrPic   = true;
            Para.iCntErr      = 60;
            Para.iCntDIn      = (int)xi.MAX_INPUT;
            Para.iCntDOut     = (int)yi.MAX_OUTPUT;
            Para.iCntCylinder = (int)ci.MAX_ACTR;
            Para.iCntMotr     = (int)mi.MAX_MOTR;
            Para.eLanSel      = EN_LAN_SEL.English;
            Para.eDio         = EN_DIO_SEL.AXL;
            Para.eMotors      = new EN_MOTR_SEL[Para.iCntMotr];

            Para.eMotors[0] = EN_MOTR_SEL.AXL;
            Para.eMotors[1] = EN_MOTR_SEL.AXL;
            Para.eMotors[2] = EN_MOTR_SEL.AXL;
            Para.eMotors[3] = EN_MOTR_SEL.AXL;
            Para.eMotors[4] = EN_MOTR_SEL.AXL;
            Para.eMotors[5] = EN_MOTR_SEL.AXL;
            Para.eMotors[6] = EN_MOTR_SEL.AXL;
            Para.eMotors[7] = EN_MOTR_SEL.AXL;
            Para.eMotors[8] = EN_MOTR_SEL.AXL;

            //AI TAB 2
            Para.eAio       = EN_AIO_SEL.AXL;
            Para.iCntAIn    = 0;
            Para.iCntAOut   = 0;
            Para.iRangeAMin = 0;
            Para.iRangeAMax = 0;

            SM.Init(Para);
            OM.Init();
            DM.Init();
            LOT.Init();
            SPC.Init();

            uint[] uaPstnCnt = { (uint)pv.MAX_PSTN_MOTR0,
                                 (uint)pv.MAX_PSTN_MOTR1,
                                 (uint)pv.MAX_PSTN_MOTR2,
                                 (uint)pv.MAX_PSTN_MOTR3,
                                 (uint)pv.MAX_PSTN_MOTR4,
                                 (uint)pv.MAX_PSTN_MOTR5,
                                 (uint)pv.MAX_PSTN_MOTR6,
                                 (uint)pv.MAX_PSTN_MOTR7,
                                 (uint)pv.MAX_PSTN_MOTR8 };



            PM.Init(uaPstnCnt);



            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_tmMotor1    = new CDelayTimer();
            m_tmMotor2    = new CDelayTimer();
            m_tmMotor3    = new CDelayTimer();

            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.WRK] = WRK;
            m_Part[(int)pi.OUT] = OUT;


            //Temp       .PortOpen();

            MainThread.Priority = ThreadPriority.Highest;
            MainThread.Start();
        }
示例#11
0
        public bool CycleWork()
        {
            String sTemp;

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

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

            PreStep.iCycle = Step.iCycle;

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

            int c, r;

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

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

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

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

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

            case 14:
                if (!CL_Complete(ci.ULDR_GrpRtrCwCCw, fb.Fwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.ULDR_GrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                DM.ShiftData((int)ri.TULD, (int)ri.PULD);
                Step.iCycle = 0;
                return(true);
            }
        }
示例#12
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;
        }
示例#13
0
        public static void Init()
        {
            SML.TPara Para;
            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            Para.iWidth          = 1280;
            Para.iHeight         = 863;
            Para.bTabHides       = new bool[6];

            Para.bUseErrPic   = true;
            Para.iCntErr      = 60;
            Para.iCntDIn      = 96;
            Para.iCntDOut     = 64;
            Para.iCntCylinder = (int)ci.MAX_ACTR;
            Para.iCntMotr     = (int)mi.MAX_MOTR;
            Para.eLanSel      = EN_LAN_SEL.English;
            Para.eDio         = EN_DIO_SEL.AXL;
            Para.eMotors      = new EN_MOTR_SEL[Para.iCntMotr];

            Para.eMotors[0] = EN_MOTR_SEL.AXL;
            Para.eMotors[1] = EN_MOTR_SEL.AXL;
            Para.eMotors[2] = EN_MOTR_SEL.AXL;
            Para.eMotors[3] = EN_MOTR_SEL.AXL;
            Para.eMotors[4] = EN_MOTR_SEL.AXL;
            Para.eMotors[5] = EN_MOTR_SEL.AXL;
            Para.eMotors[6] = EN_MOTR_SEL.AXL;
            Para.eMotors[7] = EN_MOTR_SEL.AXL;
            Para.eMotors[8] = EN_MOTR_SEL.AXL;
            Para.eMotors[9] = EN_MOTR_SEL.AXL;


            SML.Init(Para);
            OM.Init();
            DM.Init();
            LOT.Init();
            SPC.Init();
            PM.Init(PM.PstnCnt);


            VisnCom.TPara VisnPara = new VisnCom.TPara();
            VisnPara.sVisnPcName = "Visn";               //파일저장시에 파일명에 삽입.
            VisnPara.sVisnFolder = "c:\\Data";           //파일저장 하는 폴더.

            Visn.Init(ref VisnPara);

            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_cyTrayWorktime = 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.IDXR] = IDXR;
            m_Part[(int)pi.IDXF] = IDXF;
            m_Part[(int)pi.TOOL] = TOOL;
            m_Part[(int)pi.STCK] = STCK;
            m_Part[(int)pi.BARZ] = BARZ;

            BarcordLODR.PortOpen();
            BarcordBARZ.PortOpen();

            DateTime Time     = DateTime.Now;
            bool     bConnect = SEQ.Oracle.Init(OM.CmnOptn.sOracleIP, OM.CmnOptn.sOraclePort, OM.CmnOptn.sOracleID, OM.CmnOptn.sOraclePassword, OM.CmnOptn.sOracleSID);   //SEQ.Oracle.OpenDB();//"192.168.1.77" , "1521" , "hr","hr"

            if (!bConnect)
            {
                Log.ShowMessage("Oracle Open Failed!", SEQ.Oracle.GetLastMsg());
            }

            TimeSpan Span = DateTime.Now - Time;
            double   dVal = Span.TotalMilliseconds;
        }
示例#14
0
        private void btDownload_Click(object sender, EventArgs e)             //HRM-930B 참고
        {
            if (tbFromName.Text == "")
            {
                return;
            }

            //Check Running Status
//            bool bAllArayNone = DM.ARAY[(int)ri.SLD].CheckAllStat(cs.None);

            //if (LOT.GetLotOpen())
            //{
            //    if (!bAllArayNone)
            //    {
            //        FM_MsgOk("Error", "자제나 메거진이 남아 있으면 잡파일을 바꿀수 없습니다.");
            //        return;
            //    }
            //}

            if (lvDevice.SelectedIndices.Count <= 0)
            {
                return;
            }
            int iDeviceSel = lvDevice.SelectedIndices[0];

            string sName = lvDevice.Items[iDeviceSel].SubItems[1].Text;
            string sTemp = "DOWNLOAD JOB FILE. (" + lbSelDevice.Text + ")";

            if (OM.GetCrntDev() == sName)
            {
                Log.ShowMessage("ERROR", "현재 잡파일과 같은 잡파일 입니다.");
                return;
            }
            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            OM.LoadJobFile(sName);                                           pbStatus.Minimum = 0;
            PM.Load(sName);                                                  pbStatus.Value   = 70;
            pbStatus.Value = 100;

            lbSelDevice.Text  = "";
            tbFromName.Text   = "";
            lbCrntDevice.Text = sName;

            PM.UpdatePstn(true);

            //            DM.ARAY[(int)ri.SLD].SetMaxColRow(OM.DevInfo.iSTGColCnt, OM.DevInfo.iSTGRowCnt);


            //VSN_L.SendJobChange(sName);
            //VSN_R.SendJobChange(sName);



            //세이브버튼 누를때 , 디바이스셑 크리에트할때 , 디바이스 체인지 누를때...
            //Rs232_DisprFt.SetPTV(OM.DevOptn.dDspPrsPres , 10 , OM.DevOptn.dDspVacPres);
            //Rs232_DisprRr.SetPTV(OM.DevOptn.dDspPrsPres , 10 , OM.DevOptn.dDspVacPres);
            //CDelayTimer TimeOut;
            //Rs232_DisprFt.SetLoadCh(OM.DevOptn.iDspChFt + 1);
            //TimeOut.Clear();
            //while (!Rs232_DisprFt.GetMsgEnd())
            //{ //메세지 다 주고 받을때까지 기다림.
            //    Sleep(1);
            //    if (TimeOut.OnDelay(true, 1000))
            //    {
            //        FM_MsgOk("Error", "프론트 디스펜서 채널 로드 통신타임아웃");
            //        break;
            //    }
            //}
            //if (Rs232_DisprFt.GetErrMsg() != "")
            //{
            //    FM_MsgOk("Disp Ft Error", Rs232_DisprFt.GetErrMsg().c_str());
            //}
            //
            //
            //Rs232_DisprRr.SetLoadCh(OM.DevOptn.iDspChRr + 1);
            //TimeOut.Clear();
            //while (!Rs232_DisprRr.GetMsgEnd())
            //{ //메세지 다 주고 받을때까지 기다림.
            //    Sleep(1);
            //    if (TimeOut.OnDelay(true, 1000))
            //    {
            //        FM_MsgOk("Error", "리어 디스펜서 채널 로드 통신타임아웃");
            //        break;
            //    }
            //}
            //if (Rs232_DisprRr.GetErrMsg() != "")
            //{
            //    FM_MsgOk("Disp Rr Error", Rs232_DisprRr.GetErrMsg().c_str());
            //}
            //

            //            DM.ARAY[(int)ri.SLD].SetStat(cs.None);
            DM.LoadMap();
        }
示例#15
0
        public FormOperation(Panel _pnBase)
        {
            InitializeComponent();

            this.TopLevel = false;
            this.Parent   = _pnBase;

            DispLotInfo();
            DispDayList();

            MakeDoubleBuffered(pnLODR, true); MakeDoubleBuffered(pnLODR1, true);
            MakeDoubleBuffered(pnPREB, true);
            MakeDoubleBuffered(pnVSN1, true); MakeDoubleBuffered(pnWRK1, true); MakeDoubleBuffered(pnRST1, true);
            MakeDoubleBuffered(pnVSN2, true); MakeDoubleBuffered(pnWRK2, true); MakeDoubleBuffered(pnRST2, true);
            MakeDoubleBuffered(pnVSN3, true); MakeDoubleBuffered(pnWRK3, true); MakeDoubleBuffered(pnRST3, true);
            MakeDoubleBuffered(pnPSTB, true);
            MakeDoubleBuffered(pnULDR, true); MakeDoubleBuffered(pnULDR1, true);


            DM.ARAY[ri.LODR].SetParent(pnLODR1); DM.ARAY[ri.LODR].Name = "LODR";
            DM.ARAY[ri.PREB].SetParent(pnPREB); DM.ARAY[ri.PREB].Name  = "PREB";

            DM.ARAY[ri.VSN1].SetParent(pnVSN1); DM.ARAY[ri.VSN1].Name = "VSN1";
            DM.ARAY[ri.VSN2].SetParent(pnVSN2); DM.ARAY[ri.VSN2].Name = "VSN2";
            DM.ARAY[ri.VSN3].SetParent(pnVSN3); DM.ARAY[ri.VSN3].Name = "VSN3";

            DM.ARAY[ri.WRK1].SetParent(pnRST1); DM.ARAY[ri.WRK1].Name = "WRK1";
            DM.ARAY[ri.WRK2].SetParent(pnRST2); DM.ARAY[ri.WRK2].Name = "WRK2";
            DM.ARAY[ri.WRK3].SetParent(pnRST3); DM.ARAY[ri.WRK3].Name = "WRK3";

            DM.ARAY[ri.RLT1].SetParent(pnWRK1); DM.ARAY[ri.RLT1].Name = "RST1";
            DM.ARAY[ri.RLT2].SetParent(pnWRK2); DM.ARAY[ri.RLT2].Name = "RST2";
            DM.ARAY[ri.RLT3].SetParent(pnWRK3); DM.ARAY[ri.RLT3].Name = "RST3";

            DM.ARAY[ri.PSTB].SetParent(pnPSTB); DM.ARAY[ri.PSTB].Name  = "PSTB";
            DM.ARAY[ri.ULDR].SetParent(pnULDR1); DM.ARAY[ri.ULDR].Name = "ULDR";

            DM.ARAY[ri.SPC].Name = "SPC";  //SPC 저장용.

            //Loader
            DM.ARAY[ri.LODR].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.LODR].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.LODR].SetDisp(cs.None, "None", Color.White);

            //PreBuffer
            DM.ARAY[ri.PREB].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PREB].SetDisp(cs.Unknown, "Unknown", Color.Aqua);

            //Vision1
            DM.ARAY[ri.VSN1].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.VSN1].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.VSN1].SetDisp(cs.Work, "Work", Color.Blue);
            DM.ARAY[ri.VSN1].SetDisp(cs.Wait, "Wait", Color.Yellow);

            DM.ARAY[ri.WRK1].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.WRK1].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.WRK1].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.WRK1].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.WRK1].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.WRK1);

            DM.ARAY[ri.RLT1].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.RLT1].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.RLT1].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.RLT1].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.RLT1].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.RLT1);

            //Vision2
            DM.ARAY[ri.VSN2].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.VSN2].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.VSN2].SetDisp(cs.Work, "Work", Color.Blue);
            DM.ARAY[ri.VSN2].SetDisp(cs.Wait, "Wait", Color.Yellow);

            DM.ARAY[ri.WRK2].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.WRK2].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.WRK2].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.WRK2].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.WRK2].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.WRK2);

            DM.ARAY[ri.RLT2].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.RLT2].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.RLT2].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.RLT2].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.RLT2].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.RLT2);

            //Vision3
            DM.ARAY[ri.VSN3].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.VSN3].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.VSN3].SetDisp(cs.Work, "Work", Color.Blue);
            DM.ARAY[ri.VSN3].SetDisp(cs.Wait, "Wait", Color.Yellow);

            DM.ARAY[ri.WRK3].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.WRK3].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.WRK3].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.WRK3].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.WRK3].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.WRK3);

            DM.ARAY[ri.RLT3].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.RLT3].SetDisp(cs.Unknown, "Unknown", Color.Aqua);
            DM.ARAY[ri.RLT3].SetDisp(cs.Good, "Good", Color.Lime);
            //DM.ARAY[ri.RLT3].SetDisp(cs.ToBuf   , "ToBuff"  ,Color.Brown     );
            //DM.ARAY[ri.RLT3].SetDisp(cs.FromBuf , "FromBuff",Color.DarkOrange);
            SetDisp(ri.RLT3);

            //Post Buffer
            DM.ARAY[ri.PSTB].SetDisp(cs.None, "None", Color.White);
            DM.ARAY[ri.PSTB].SetDisp(cs.Work, "Work", Color.Blue);
            DM.ARAY[ri.PSTB].SetDisp(cs.Good, "Good", Color.Lime);
            SetDisp(ri.PSTB);

            //Unloader
            DM.ARAY[ri.ULDR].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.ULDR].SetDisp(cs.Work, "Work", Color.Blue);
            DM.ARAY[ri.ULDR].SetDisp(cs.None, "None", Color.White);

            DM.LoadMap();
        }
示例#16
0
        static public MD_X1000 LaserMarking;         //= new MD_X1000       (0, "LaserMarking"   );
        //static public RS232_3310g         BarcordLODR = new RS232_3310g        (1, "BarcordLODR"   );
        //static public RS232_3310g         BarcordBARZ = new RS232_3310g        (2, "BarcordBARZ"   );


        //static public DispensePattern DispPtrn = new DispensePattern();
        //static public HeightPattern   HghtPtrn = new HeightPattern  ();

        //static public CSerialPort[] Com = new CSerialPort[(int)si.MAX_RS232];

        public static void Init()
        {
            //Common
            SM.TPara Para;
            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            Para.iWidth          = 1280;
            Para.iHeight         = 863;
            Para.bTabHides       = new bool[6];
            //Para.eLanSel   = EN_LAN_SEL.Chinese;
            //Para.eLanSel   = EN_LAN_SEL.Korean;

            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.InitErr(Para,Err);
            //SM.InitDio(Para,Dio);
            //SM.InitAio(Para,Aio);
            //SM.InitCyl(Para,Cyl);
            //SM.InitMtr(Para,Mtr);

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

            LaserMarking = new MD_X1000(2,
                                        xi.LSR_Error,
                                        xi.LSR_Warning,
                                        xi.LSR_TrgReady,
                                        xi.LSR_InPrint,
                                        xi.LSR_PrintEnd,
                                        xi.LSR_CheckOk,
                                        xi.LSR_CheckNg,
                                        yi.LSR_Triger,
                                        yi.LSR_Check);

            EmbededExe.CameraInit();

            //public MD_X1000(int _iPortId ,
            //            xi  _xError  ,
            //            xi  _xWarning,
            //            xi  _xReady  ,
            //            xi  _xWorking,
            //            xi  _xWorkEnd,
            //            xi  _xCheckOk,
            //            xi  _xCheckNg,
            //            yi  _yTrigger,
            //            yi  _yCheck  )


            //VisnComm.TPara VisnPara = new VisnComm.TPara();
            //VisnPara.sVisnPcName     = "Visn"          ; //파일저장시에 파일명에 삽입.
            //VisnPara.sVisnFolder     = "c:\\Data"      ; //파일저장 하는 폴더.
            //VisnPara.xVisn_Ready     = xi.VISN_Ready   ;
            //VisnPara.xVisn_Busy      = xi.VISN_Busy    ;

            //VisnPara.yVisn_Command   = yi.VISN_Command ;
            //VisnPara.yVisn_JobChange = yi.VISN_Change  ;
            //VisnPara.yVisn_Reset     = yi.VISN_Reset   ;
            //VisnPara.yVisn_ManMode   = yi.VISN_ManMode ;
            //VisnPara.yVisn_ManInsp   = yi.VISN_ManInsp ;
            //Visn.Init(ref VisnPara);

            MainThread.Priority = ThreadPriority.Highest;
            //MainThread.Priority = ThreadPriority.Normal;
            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();

            VC.Init();

            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.LODR].SetPartId((int)pi.LODR + ti.Max);
            m_Part[(int)pi.PLDR] = PLDR; //m_Part[(int)pi.LODR].SetPartId((int)pi.LODR + ti.Max);
            m_Part[(int)pi.MARK] = MARK; //m_Part[(int)pi.IDXR].SetPartId((int)pi.IDXR + ti.Max);
            m_Part[(int)pi.VISN] = VISN; //m_Part[(int)pi.IDXF].SetPartId((int)pi.IDXF + ti.Max);
            m_Part[(int)pi.TBLE] = TTBL; //m_Part[(int)pi.TOOL].SetPartId((int)pi.TOOL + ti.Max);
            m_Part[(int)pi.PULD] = PULD; //m_Part[(int)pi.IDXF].SetPartId((int)pi.IDXF + ti.Max);
            m_Part[(int)pi.ULDR] = ULDR; //m_Part[(int)pi.STCK].SetPartId((int)pi.STCK + ti.Max);
            m_Part[(int)pi.REJM] = REJM; //m_Part[(int)pi.STCK].SetPartId((int)pi.STCK + ti.Max);
            m_Part[(int)pi.REJV] = REJV; //m_Part[(int)pi.STCK].SetPartId((int)pi.STCK + ti.Max);
            //m_Part[(int)pi.] = BARZ; //m_Part[(int)pi.BARZ].SetPartId((int)pi.BARZ + ti.Max);

            //LoadCell   .PortOpen();
            //Dispr      .PortOpen();
            //HeightSnsr .PortOpen();
            //BarcordLODR.PortOpen();
            //BarcordBARZ.PortOpen();
            //Temp       .PortOpen();

            //ML.IO_SetY(yi.SSTG_HeaterOn,true);


            //DateTime Time =  DateTime.Now ;
            //bool bConnect = SEQ.Oracle.OpenDB(OM.CmnOptn.sOracleIP , OM.CmnOptn.sOraclePort , OM.CmnOptn.sOracleID , OM.CmnOptn.sOraclePassword);//"192.168.1.77" , "1521" , "hr","hr"
            //TimeSpan Span =  DateTime.Now - Time ;
            //double dVal = Span.TotalMilliseconds ;


            //if(!OM.CmnOptn.bOracleNotUse && !bConnect) Log.ShowMessage("Oracle","DB Connection Error");
        }
示例#17
0
        public bool CycleWork()
        {
            String sTemp;

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

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

            PreStep.iCycle = Step.iCycle;

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

            int r, c = -1;

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

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

                Step.iCycle++;
                return(false);

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

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

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

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

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

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

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

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

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

            case 20:
                if (!CL_Complete(ci.LODR_PckrRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                DM.ShiftData(ri.PLDR, ri.TLDR);
                Step.iCycle = 0;
                return(true);
            }
        }
示例#18
0
        public bool CycleMove()
        {
            String sTemp;

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

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



            PreStep.iCycle = Step.iCycle;

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

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

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

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

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

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

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


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

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

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

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

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

                Step.iCycle = 0;
                return(true);
            }
        }
示例#19
0
        private static void UpdateButton()
        {
            if (m_iStep != EN_SEQ_STEP.Idle)
            {
                InspectHomeDone();
                if (!OM.CmnOptn.bIgnrDoor)
                {
                    InspectDoor();
                }
            }

            //Local Var.
            bool isErr     = ML.ER_IsErr();
            bool isHomeEnd = ML.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 = ML.IO_GetXUp(xi.ETC_LStartSw) || ML.IO_GetXUp(xi.ETC_RStartSw) || m_bBtnStart; // || ML.IO_GetXUp(xi.ETC_StartSwR) || m_bBtnStart ;
            bool bStopSw  = ML.IO_GetXUp(xi.ETC_LStopSw) || ML.IO_GetXUp(xi.ETC_RStopSw) || m_bBtnStop;    // || ML.IO_GetXUp(xi.ETC_StopSwR ) || m_bBtnStop  ;
            bool bResetSw = ML.IO_GetXUp(xi.ETC_LResetSw) || ML.IO_GetXUp(xi.ETC_RResetSw) || m_bBtnReset; // || ML.IO_GetXUp(xi.ETC_ResetSwR) || m_bBtnReset ;
            bool bAirSw   = ML.IO_GetXUp(xi.ETC_LAirSw) || ML.IO_GetXUp(xi.ETC_RAirSw) || m_bBtnAir;
            bool bInitSw  = ML.IO_GetXUp(xi.ETC_LInitSw) || ML.IO_GetXUp(xi.ETC_RInitSw);
            bool bVisnSw  = ML.IO_GetXUp(xi.ETC_LVisnSw) || ML.IO_GetXUp(xi.ETC_RVisnSw);


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

                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;

            //버튼 클릭시나
            ML.IO_SetY(yi.ETC_LStartLp, ML.IO_GetX(xi.ETC_LStartSw) || m_bRun);
            ML.IO_SetY(yi.ETC_RStartLp, ML.IO_GetX(xi.ETC_RStartSw) || m_bRun);
            ML.IO_SetY(yi.ETC_LStopLp, ML.IO_GetX(xi.ETC_LStopSw) || !m_bRun || bStopBtnFlick);
            ML.IO_SetY(yi.ETC_RStopLp, ML.IO_GetX(xi.ETC_RStopSw) || !m_bRun || bStopBtnFlick);
            ML.IO_SetY(yi.ETC_LResetLp, ML.IO_GetX(xi.ETC_LResetSw) || (m_bFlick && isErr));
            ML.IO_SetY(yi.ETC_RResetLp, ML.IO_GetX(xi.ETC_RResetSw) || (m_bFlick && isErr));
            ML.IO_SetY(yi.ETC_LAirLp, ML.IO_GetX(xi.ETC_LAirSw) || ML.IO_GetY(yi.ETC_MainAirOnOff));
            ML.IO_SetY(yi.ETC_RAirLp, ML.IO_GetX(xi.ETC_RAirSw) || ML.IO_GetY(yi.ETC_MainAirOnOff));
            ML.IO_SetY(yi.ETC_LInitLp, ML.IO_GetX(xi.ETC_LInitSw));
            ML.IO_SetY(yi.ETC_RInitLp, ML.IO_GetX(xi.ETC_RInitSw));
            ML.IO_SetY(yi.ETC_LVisnLp, ML.IO_GetX(xi.ETC_LVisnSw));
            ML.IO_SetY(yi.ETC_RVisnLp, ML.IO_GetX(xi.ETC_RVisnSw));

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


            //Init. Button Flags.
            if (bStartSw)
            {
                if (!isHomeEnd)
                {
                    Log.ShowMessage("Error", "Machine Needed Initial"); bStartSw = false;
                }
                if (!LOT.GetLotOpen() && LOT.GetNextMgz() == "")
                {
                    Log.ShowMessage("Error", "Machine Need to Lot "); bStartSw = false;
                }                                                                                                                         //기존 랏오픈 패턴
                //if(LOT.GetNextMgz()=="") { Log.ShowMessage("Error" , "Machine Needed Lot List Registration"  ); bStartSw = false ; } //기존 랏오픈 패턴

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

            if (bInitSw)
            {
                if (!ML.IO_GetY(yi.ETC_MainAirOnOff))
                {
                    ML.ER_SetErr(ei.ETC_MainAir, "Check Main Air");
                    return;
                }

                MM.SetManCycle(mc.AllHome);
            }

            //Vision버튼 추가. 진섭
            if (bVisnSw)
            {
                if (!isHomeEnd)
                {
                    Log.ShowMessage("Error", "Machine Needed Initial");
                    //ML.ER_SetErr(ei.MTR_HomeEnd, "Machine Needed Initial");
                    return;
                }
                if (m_iSeqStat == EN_SEQ_STAT.Running || m_iSeqStat == EN_SEQ_STAT.Manual)
                {
                    Log.ShowMessage("Error", "Machine is not stopped.");
                    //ML.ER_SetErr(ei.)
                    return;
                }
                MM.SetManCycle(mc.VSNZ_Insp);
            }

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

            //Buzzer Off.
            if (isErr && bStopSw)
            {
                ML.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)
            {
                if (!_bRun && !MM.Working())
                {
                    ML.IO_SetY(yi.RAIL_FeedingAC1, false);
                    ML.IO_SetY(yi.RAIL_FeedingAC2, false);
                    ML.IO_SetY(yi.RAIL_FeedingAC3, false);
                }
                MM.Stop = true;
                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;
                ML.TL_SetBuzzOff(false);
                ML.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, 10000))
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStrtTimeOut : m_iStep=", m_iStep.ToString());
                Log.Trace("SEQ", Msg);
                ML.ER_SetErr(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(ML.IO_GetX((int)IP.xETC_StopSw)||ML.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();
            //}

            bool bVisnInsp = VSNZ.GetSeqStep() == (int)VisnZone.sc.Insp;

            if (m_tmToStop.OnDelay((m_iStep == EN_SEQ_STEP.ToStopCon || m_iStep == EN_SEQ_STEP.ToStop) && !bVisnInsp, 10000))
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStopTimeOut : m_iStep=", m_iStep.ToString());
                Log.Trace("SEQ", Msg);
                m_bRun = false;

                ML.ER_SetErr(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.ShowMessage("Checked", "Lot Ended.");
                        Log.Trace("SEQ", LOT.GetLotNo() + "LotEnd");
                        m_bRunEnd = true;
                        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;
            }
        }
示例#20
0
        private static void UpdateButton()
        {
            //Check Inspect.
            //if (!OM.CmnOptn.bIgnrDoor)
            InspectDoor();

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

            if (m_iStep == EN_SEQ_STEP.Idle)
            {
                InspectLightGrid();
            }
            //Local Var.
            bool isErr    = ML.ER_IsErr();
            bool bStartSw = ML.IO_GetXUp(xi.ETC_StartSw) || m_bBtnStart; // || ML.IO_GetXUp(xi.ETC_StartSwR) || m_bBtnStart ;
            bool bStopSw  = ML.IO_GetXUp(xi.ETC_StopSw) || m_bBtnStop;   // || ML.IO_GetXUp(xi.ETC_StopSwR ) || m_bBtnStop  ;
            bool bResetSw = ML.IO_GetXUp(xi.ETC_ResetSw) || m_bBtnReset; // || ML.IO_GetXUp(xi.ETC_ResetSwR) || m_bBtnReset ;
            bool bAirSw   = false;                                       //ML.IO_GetXUp(xi.ETC_AirSw  ) || m_bBtnAir ;
            bool bInitSw  = false;                                       //ML.IO_GetXUp(xi.ETC_InitSw ) ;
            bool bMotorSw = ML.IO_GetXUp(xi.ETC_MotorSw);

            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 (m_iSeqStat == EN_SEQ_STAT.RunWarn)
                {
                    Log.Trace("SeqStat", "ssRunWarn");
                }

                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;


            //버튼 클릭시나
            ML.IO_SetY(yi.ETC_StartLp, ML.IO_GetX(xi.ETC_StartSw) || m_bRun);
            ML.IO_SetY(yi.ETC_StopLp, ML.IO_GetX(xi.ETC_StopSw) || !m_bRun || bStopBtnFlick);
            ML.IO_SetY(yi.ETC_ResetLp, ML.IO_GetX(xi.ETC_ResetSw) || (m_bFlick && isErr));
            //ML.IO_SetY(yi.ETC_AirLp    , ML.IO_GetX(xi.ETC_AirSw   ) || ML.IO_GetY(yi.ETC_MainAirSol       ));
            //ML.IO_SetY(yi.ETC_InitLp   , ML.IO_GetX(xi.ETC_InitSw  )                                        );

            ML.IO_SetY(yi.ETC_MotorLp, ML.MT_GetServo(mi.OUT_TRelT));

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


            //Init. Button Flags.
            bool isHomeEnd = ML.MT_GetHomeDoneAll();

            if (bStartSw)
            {
                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);
            }

            if (bMotorSw)
            {
                if (ML.MT_GetServo(mi.OUT_TRelT))
                {
                    ML.MT_SetServo(mi.OUT_TRelT, false);
                    ML.MT_SetServo(mi.OUT_TRelB, false);
                }
                else
                {
                    ML.MT_SetServo(mi.OUT_TRelT, true);
                    ML.MT_SetServo(mi.OUT_TRelB, true);

                    ML.MT_SetHomeDone(mi.OUT_TRelT, true);
                    ML.MT_SetHomeDone(mi.OUT_TRelB, true);
                }
            }

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

            //Buzzer Off.
            if (isErr && bStopSw)
            {
                ML.TL_SetBuzzOff(true);
            }

            bool isStopCon  = bStopSw || (isErr && !m_bReqStop && m_bRun);
            bool isRunCon   = bStartSw && !isErr;
            bool isResetCon = bResetSw && !m_bRun;

            //Run.
            if (isRunCon && (m_iStep == EN_SEQ_STEP.Idle))
            {
                m_iStep = EN_SEQ_STEP.ToStartCon;
                ML.TL_SetBuzzOff(false);
                ML.ER_SetDisp(true);
            }

            if (isStopCon && (m_iStep != EN_SEQ_STEP.Idle))    //스타트버튼 안눌리는것 때문에 테스트.
            {
                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, 10000))
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStrtTimeOut : m_iStep=%d", m_iStep);
                Log.Trace("SEQ", Msg);
                ML.ER_SetErr(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(ML.IO_GetX((int)IP.xETC_StopSw)||ML.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, 10000))        //  20000)) {
            {
                //Trace Log.
                string Msg;
                Msg = string.Format("ToStopTimeOut : m_iStep=%d", m_iStep);
                Log.Trace("SEQ", Msg);
                m_bRun = false;

                ML.ER_SetErr(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.ShowMessage("Checked", "Lot Ended.");
                        Log.Trace("SEQ", LOT.GetLotNo() + "LotEnd");
                        m_bRunEnd = true;
                        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;
            }
        }