public static bool InspectEmergency() { bool isOk = true; //Check Emergency if (ML.IO_GetX(xi.ETC_LEmgSw) || ML.IO_GetX(xi.ETC_REmgSw) || ML.IO_GetX(xi.ETC_LDREmgSw) || ML.IO_GetX(xi.ETC_ULDEmgSw)) { ML.MT_EmgStopAll(); ML.MT_SetServoAll(false); if (ML.IO_GetX(xi.ETC_LEmgSw)) { ML.ER_SetErr(ei.ETC_Emergency, "좌측 Emergency Switch 가 눌렸습니다."); } if (ML.IO_GetX(xi.ETC_REmgSw)) { ML.ER_SetErr(ei.ETC_Emergency, "우측 Emergency Switch 가 눌렸습니다."); } if (ML.IO_GetX(xi.ETC_LDREmgSw)) { ML.ER_SetErr(ei.ETC_Emergency, "로더 Emergency Switch 가 눌렸습니다."); } if (ML.IO_GetX(xi.ETC_ULDEmgSw)) { ML.ER_SetErr(ei.ETC_Emergency, "언로더 Emergency Switch 가 눌렸습니다."); } isOk = false; } return(isOk); }
public static bool InspectEmergency() { bool isOk = true; //Check Emergency if (ML.IO_GetX(xi.LODR_EmgSw1) || ML.IO_GetX(xi.ETC_EmgSw2) || ML.IO_GetX(xi.ETC_EmgSw3) || ML.IO_GetX(xi.ULDR_EmgSw4)) { ML.MT_EmgStopAll(); ML.MT_SetServoAll(false); if (ML.IO_GetX(xi.LODR_EmgSw1)) { ML.ER_SetErr(ei.ETC_Emergency, "Loader Emergency Switch pushed."); } if (ML.IO_GetX(xi.ETC_EmgSw2)) { ML.ER_SetErr(ei.ETC_Emergency, "Main1 Emergency Switch pushed."); } if (ML.IO_GetX(xi.ETC_EmgSw3)) { ML.ER_SetErr(ei.ETC_Emergency, "Main2 Emergency Switch pushed."); } if (ML.IO_GetX(xi.ULDR_EmgSw4)) { ML.ER_SetErr(ei.ETC_Emergency, "Unloader Emergency Switch pushed."); } isOk = false; } return(isOk); }
//Functions. //Inspection Machine Status. public static bool InspectMainAir() { bool isOk = true; if (!ML.IO_GetX(xi.ETC_MainAir)) { ML.ER_SetErr((int)ei.ETC_MainAir, "Cheked Main Air"); isOk = false; } return(isOk); }
//Functions. //Inspection Machine Status. public static bool InspectMainAir() { bool isOk = true; //if(!ML.IO_GetY(yi.ETC_MainAirSol)) isOk = false ; if (!ML.IO_GetX(xi.ETC_MainAir)) { isOk = false; } //LOL if (!isOk && m_iSeqStat != EN_SEQ_STAT.ssError) SML.ER.SetErrMsg((int)ei.ETC_MainAir, "Cheked Main Air"); return(isOk); }
public static bool InspectDoor() { //Local Var. bool isOk = true; if (!ML.IO_GetX(xi.ETC_FDoor)) { ML.ER_SetErr(ei.ETC_Door, "Front Door Opened"); isOk = false; } if (!ML.IO_GetX(xi.ETC_RDoor)) { ML.ER_SetErr(ei.ETC_Door, "Rear Door Opened"); isOk = false; } //Ok. return(isOk); }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; bool bIn = ML.IO_GetX(m_iXadd); if (bIn) { lbState.BackColor = Color.Red; lbState.Text = "ON"; } else { lbState.BackColor = SystemColors.Control;//Color.FloralWhite;// lbState.Text = "OFF"; } tmUpdate.Enabled = true; }
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; } }
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; } }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; //로그인/로그아웃 방식 if (SM.FrmLogOn.GetLevel() == (int)EN_LEVEL.LogOff) { btOperator.Text = " LOG IN"; pnManual.Enabled = false; } else { btOperator.Text = " " + SM.FrmLogOn.GetLevel().ToString(); pnManual.Enabled = true; } //if (SML.FrmLogOn.GetLevel() != (int)EN_LEVEL.LogOff) //{ // btStart.Enabled = LOT.GetLotOpen(); //} SPC.LOT.DispLotInfo(lvLotInfo); SPC.DAY.DispDayInfo(lvDayInfo); string Str; int iPreErrCnt = 0; int iCrntErrCnt = 0; for (int i = 0; i < ML.ER_MaxCount(); i++) { if (ML.ER_GetErr((ei)i)) { iCrntErrCnt++; } } if (iPreErrCnt != iCrntErrCnt) { lbErr.Items.Clear(); int iErrNo = ML.ER_GetLastErr(); for (int i = 0; i < ML.ER_MaxCount(); i++) { if (ML.ER_GetErr((ei)i)) { Str = string.Format("[ERR{0:000}]", i); Str += ML.ER_GetErrName(i) + " " + ML.ER_GetErrSubMsg((ei)i); lbErr.Items.Add(Str); } } } if (SEQ._iSeqStat != EN_SEQ_STAT.Error) { lbErr.Items.Clear(); } iPreErrCnt = iCrntErrCnt; if (!ML.MT_GetHomeDoneAll()) { btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red; } else { btAllHome.ForeColor = Color.Black; } if (LOT.GetLotOpen() && !SEQ._bRun) { btLotOpen.Text = "WORK ING"; //btLotOpen.Enabled = true; btLotEnd.Enabled = true; } else { btLotOpen.Text = "WORK STT"; //btLotOpen.Enabled = true ; btLotEnd.Enabled = false; } //결과 색 이름 표기 pnC0.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor0); lbC0.Text = OM.CmnOptn.sRsltName0; lbCnt0.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt0].ToString(); pnC1.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor1); lbC1.Text = OM.CmnOptn.sRsltName1; lbCnt1.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt1].ToString(); pnC2.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor2); lbC2.Text = OM.CmnOptn.sRsltName2; lbCnt2.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt2].ToString(); pnC3.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor3); lbC3.Text = OM.CmnOptn.sRsltName3; lbCnt3.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt3].ToString(); pnC4.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor4); lbC4.Text = OM.CmnOptn.sRsltName4; lbCnt4.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt4].ToString(); pnC5.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor5); lbC5.Text = OM.CmnOptn.sRsltName5; lbCnt5.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt5].ToString(); pnC6.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor6); lbC6.Text = OM.CmnOptn.sRsltName6; lbCnt6.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt6].ToString(); pnC7.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor7); lbC7.Text = OM.CmnOptn.sRsltName7; lbCnt7.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt7].ToString(); pnC8.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor8); lbC8.Text = OM.CmnOptn.sRsltName8; lbCnt8.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt8].ToString(); pnC9.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor9); lbC9.Text = OM.CmnOptn.sRsltName9; lbCnt9.Text = OM.EqpStat.iRsltCnts[(int)cs.Rslt9].ToString(); pnCA.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorA); lbCA.Text = OM.CmnOptn.sRsltNameA; lbCntA.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltA].ToString(); pnCB.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorB); lbCB.Text = OM.CmnOptn.sRsltNameB; lbCntB.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltB].ToString(); pnCC.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorC); lbCC.Text = OM.CmnOptn.sRsltNameC; lbCntC.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltC].ToString(); pnCD.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorD); lbCD.Text = OM.CmnOptn.sRsltNameD; lbCntD.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltD].ToString(); pnCE.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorE); lbCE.Text = OM.CmnOptn.sRsltNameE; lbCntE.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltE].ToString(); pnCF.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorF); lbCF.Text = OM.CmnOptn.sRsltNameF; lbCntF.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltF].ToString(); pnCG.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorG); lbCG.Text = OM.CmnOptn.sRsltNameG; lbCntG.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltG].ToString(); pnCH.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorH); lbCH.Text = OM.CmnOptn.sRsltNameH; lbCntH.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltH].ToString(); pnCI.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorI); lbCI.Text = OM.CmnOptn.sRsltNameI; lbCntI.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltI].ToString(); pnCJ.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorJ); lbCJ.Text = OM.CmnOptn.sRsltNameJ; lbCntJ.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltJ].ToString(); pnCK.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorK); lbCK.Text = OM.CmnOptn.sRsltNameK; lbCntK.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltK].ToString(); pnCL.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorL); lbCL.Text = OM.CmnOptn.sRsltNameL; lbCntL.Text = OM.EqpStat.iRsltCnts[(int)cs.RsltL].ToString(); C0.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor0); T0.Text = OM.CmnOptn.sRsltName0; N0.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt0].ToString(); C1.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor1); T1.Text = OM.CmnOptn.sRsltName1; N1.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt1].ToString(); C2.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor2); T2.Text = OM.CmnOptn.sRsltName2; N2.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt2].ToString(); C3.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor3); T3.Text = OM.CmnOptn.sRsltName3; N3.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt3].ToString(); C4.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor4); T4.Text = OM.CmnOptn.sRsltName4; N4.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt4].ToString(); C5.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor5); T5.Text = OM.CmnOptn.sRsltName5; N5.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt5].ToString(); C6.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor6); T6.Text = OM.CmnOptn.sRsltName6; N6.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt6].ToString(); C7.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor7); T7.Text = OM.CmnOptn.sRsltName7; N7.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt7].ToString(); C8.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor8); T8.Text = OM.CmnOptn.sRsltName8; N8.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt8].ToString(); C9.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColor9); T9.Text = OM.CmnOptn.sRsltName9; N9.Text = OM.EqpStat.iPreRsltCnts[(int)cs.Rslt9].ToString(); CA.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorA); TA.Text = OM.CmnOptn.sRsltNameA; NA.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltA].ToString(); CB.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorB); TB.Text = OM.CmnOptn.sRsltNameB; NB.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltB].ToString(); CC.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorC); TC.Text = OM.CmnOptn.sRsltNameC; NC.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltC].ToString(); CD.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorD); TD.Text = OM.CmnOptn.sRsltNameD; ND.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltD].ToString(); CE.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorE); TE.Text = OM.CmnOptn.sRsltNameE; NE.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltE].ToString(); CF.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorF); TF.Text = OM.CmnOptn.sRsltNameF; NF.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltF].ToString(); CG.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorG); TG.Text = OM.CmnOptn.sRsltNameG; NG.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltG].ToString(); CH.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorH); TH.Text = OM.CmnOptn.sRsltNameH; NH.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltH].ToString(); CI.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorI); TI.Text = OM.CmnOptn.sRsltNameI; NI.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltI].ToString(); CJ.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorJ); TJ.Text = OM.CmnOptn.sRsltNameJ; NJ.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltJ].ToString(); CK.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorK); TK.Text = OM.CmnOptn.sRsltNameK; NK.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltK].ToString(); CL.BackColor = Color.FromArgb(OM.CmnOptn.iRsltColorL); TL.Text = OM.CmnOptn.sRsltNameL; NL.Text = OM.EqpStat.iPreRsltCnts[(int)cs.RsltL].ToString(); //인풋 lbPREB_PkgInDetect.BackColor = ML.IO_GetX(xi.PREB_PkgInDetect) ? Color.Lime : Color.Gray; lbPREB_PkgInDetect.Text = ML.IO_GetX(xi.PREB_PkgInDetect) ? "ON" : "OFF"; lbPREB_StrpDetect.BackColor = ML.IO_GetX(xi.PREB_StrpDetect) ? Color.Lime : Color.Gray; lbPREB_StrpDetect.Text = ML.IO_GetX(xi.PREB_StrpDetect) ? "ON" : "OFF"; lbRAIL_Vsn1Detect.BackColor = ML.IO_GetX(xi.RAIL_Vsn1Detect) ? Color.Lime : Color.Gray; lbRAIL_Vsn1Detect.Text = ML.IO_GetX(xi.RAIL_Vsn1Detect) ? "ON" : "OFF"; lbRAIL_Vsn2Detect.BackColor = ML.IO_GetX(xi.RAIL_Vsn2Detect) ? Color.Lime : Color.Gray; lbRAIL_Vsn2Detect.Text = ML.IO_GetX(xi.RAIL_Vsn2Detect) ? "ON" : "OFF"; lbRAIL_Vsn3Detect.BackColor = ML.IO_GetX(xi.RAIL_Vsn3Detect) ? Color.Lime : Color.Gray; lbRAIL_Vsn3Detect.Text = ML.IO_GetX(xi.RAIL_Vsn3Detect) ? "ON" : "OFF"; lbPSTB_MarkDetect.BackColor = ML.IO_GetX(xi.PSTB_MarkDetect) ? Color.Lime : Color.Gray; lbPSTB_MarkDetect.Text = ML.IO_GetX(xi.PSTB_MarkDetect) ? "ON" : "OFF"; lbPSTB_PkgDetect1.BackColor = ML.IO_GetX(xi.PSTB_PkgDetect1) ? Color.Lime : Color.Gray; lbPSTB_PkgDetect1.Text = ML.IO_GetX(xi.PSTB_PkgDetect1) ? "ON" : "OFF"; lbPSTB_PkgDetect2.BackColor = ML.IO_GetX(xi.PSTB_PkgDetect2) ? Color.Lime : Color.Gray; lbPSTB_PkgDetect2.Text = ML.IO_GetX(xi.PSTB_PkgDetect2) ? "ON" : "OFF"; //실린더 lbPREB_StprUpDn.BackColor = ML.CL_GetCmd(ci.PREB_StprUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbPREB_StprUpDn.Text = ML.CL_GetCmd(ci.PREB_StprUpDn) == fb.Fwd ? "UP" : "DN"; lbRAIL_Vsn1StprUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn1StprUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn1StprUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn1StprUpDn) == fb.Fwd ? "UP" : "DN"; lbRAIL_Vsn2StprUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn2StprUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn2StprUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn2StprUpDn) == fb.Fwd ? "UP" : "DN"; lbRAIL_Vsn3StprUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn3StprUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn3StprUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn3StprUpDn) == fb.Fwd ? "UP" : "DN"; lbPSTB_MarkStprUpDn.BackColor = ML.CL_GetCmd(ci.PSTB_MarkStprUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbPSTB_MarkStprUpDn.Text = ML.CL_GetCmd(ci.PSTB_MarkStprUpDn) == fb.Fwd ? "UP" : "DN"; lbPSTB_PusherFwBw.BackColor = ML.CL_GetCmd(ci.PSTB_PusherFwBw) == fb.Fwd ? Color.Aqua : Color.Yellow; lbPSTB_PusherFwBw.Text = ML.CL_GetCmd(ci.PSTB_PusherFwBw) == fb.Fwd ? "FW" : "BW"; lbRAIL_Vsn1AlignFwBw.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn1AlignFwBw) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn1AlignFwBw.Text = ML.CL_GetCmd(ci.RAIL_Vsn1AlignFwBw) == fb.Fwd ? "FW" : "BW"; lbRAIL_Vsn2AlignFwBw.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn2AlignFwBw) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn2AlignFwBw.Text = ML.CL_GetCmd(ci.RAIL_Vsn2AlignFwBw) == fb.Fwd ? "FW" : "BW"; lbRAIL_Vsn3AlignFwBw.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn3AlignFwBw) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn3AlignFwBw.Text = ML.CL_GetCmd(ci.RAIL_Vsn3AlignFwBw) == fb.Fwd ? "FW" : "BW"; lbPSTB_MarkAlignFWBw.BackColor = ML.CL_GetCmd(ci.PSTB_MarkAlignFWBw) == fb.Fwd ? Color.Aqua : Color.Yellow; lbPSTB_MarkAlignFWBw.Text = ML.CL_GetCmd(ci.PSTB_MarkAlignFWBw) == fb.Fwd ? "FW" : "BW"; lbRAIL_Vsn1SttnUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn1SttnUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn1SttnUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn1SttnUpDn) == fb.Fwd ? "UP" : "DN"; lbRAIL_Vsn2SttnUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn2SttnUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn2SttnUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn2SttnUpDn) == fb.Fwd ? "UP" : "DN"; lbRAIL_Vsn3SttnUpDn.BackColor = ML.CL_GetCmd(ci.RAIL_Vsn3SttnUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbRAIL_Vsn3SttnUpDn.Text = ML.CL_GetCmd(ci.RAIL_Vsn3SttnUpDn) == fb.Fwd ? "UP" : "DN"; lbPSTB_MarkSttnUpDn.BackColor = ML.CL_GetCmd(ci.PSTB_MarkSttnUpDn) == fb.Fwd ? Color.Aqua : Color.Yellow; lbPSTB_MarkSttnUpDn.Text = ML.CL_GetCmd(ci.PSTB_MarkSttnUpDn) == fb.Fwd ? "UP" : "DN"; //아웃풋. lbRAIL_FeedingAC1.BackColor = ML.IO_GetY(yi.RAIL_FeedingAC1) ? Color.Lime : Color.Gray; lbRAIL_FeedingAC1.Text = ML.IO_GetY(yi.RAIL_FeedingAC1) ? "ON" : "OFF"; lbRAIL_FeedingAC2.BackColor = ML.IO_GetY(yi.RAIL_FeedingAC2) ? Color.Lime : Color.Gray; lbRAIL_FeedingAC2.Text = ML.IO_GetY(yi.RAIL_FeedingAC2) ? "ON" : "OFF"; lbRAIL_FeedingAC3.BackColor = ML.IO_GetY(yi.RAIL_FeedingAC3) ? Color.Lime : Color.Gray; lbRAIL_FeedingAC3.Text = ML.IO_GetY(yi.RAIL_FeedingAC3) ? "ON" : "OFF"; lbMainAir.BackColor = ML.IO_GetY(yi.ETC_MainAirOnOff) ? Color.Lime : Color.Gray; lbMainAir.Text = ML.IO_GetY(yi.ETC_MainAirOnOff) ? "ON" : "OFF"; PanelRefresh(); //Strip Check bool Strip1 = !DM.ARAY[ri.PREB].CheckAllStat(cs.None); bool Sensor1 = ML.IO_GetX(xi.PREB_StrpDetect); bool Strip2 = !DM.ARAY[ri.VSN1].CheckAllStat(cs.None); bool Sensor2 = ML.IO_GetX(xi.RAIL_Vsn1Detect); bool Strip3 = !DM.ARAY[ri.VSN2].CheckAllStat(cs.None); bool Sensor3 = ML.IO_GetX(xi.RAIL_Vsn2Detect); bool Strip4 = !DM.ARAY[ri.VSN3].CheckAllStat(cs.None); bool Sensor4 = ML.IO_GetX(xi.RAIL_Vsn3Detect); bool Strip5 = !DM.ARAY[ri.PSTB].CheckAllStat(cs.None); bool Sensor5 = ML.IO_GetX(xi.PSTB_MarkDetect) || ML.IO_GetX(xi.PSTB_PkgDetect1) || ML.IO_GetX(xi.PSTB_PkgDetect2); bool Lift1Dn = ML.CL_Complete(ci.RAIL_Vsn1SttnUpDn, fb.Bwd); bool Lift2Dn = ML.CL_Complete(ci.RAIL_Vsn2SttnUpDn, fb.Bwd); bool Lift3Dn = ML.CL_Complete(ci.RAIL_Vsn3SttnUpDn, fb.Bwd); bool Lift4Dn = ML.CL_Complete(ci.PSTB_MarkSttnUpDn, fb.Bwd); if (Strip1 && Sensor1) { s1.Visible = true; } else if (!Strip1 && !Sensor1) { s1.Visible = false; } else { s1.Visible = SEQ._bFlick ? true : false; } if (Strip2 && Sensor2) { s2.Visible = true; } else if (Strip2 && !Sensor2 && !Lift1Dn) { s2.Visible = true; } else if (!Strip2 && !Sensor2) { s2.Visible = false; } else { s2.Visible = SEQ._bFlick ? true : false; } if (Strip3 && Sensor3) { s3.Visible = true; } else if (Strip3 && !Sensor3 && !Lift2Dn) { s3.Visible = true; } else if (!Strip3 && !Sensor3) { s3.Visible = false; } else { s3.Visible = SEQ._bFlick ? true : false; } if (Strip4 && Sensor4) { s4.Visible = true; } else if (Strip4 && !Sensor4 && !Lift3Dn) { s4.Visible = true; } else if (!Strip4 && !Sensor4) { s4.Visible = false; } else { s4.Visible = SEQ._bFlick ? true : false; } if (Strip5 && Sensor5) { s5.Visible = true; } else if (Strip5 && !Sensor5 && !Lift4Dn) { s5.Visible = true; } else if (!Strip5 && !Sensor5) { s5.Visible = false; } else { s5.Visible = SEQ._bFlick ? true : false; } //Sensor RA1.BackColor = ML.IO_GetX(xi.PREB_PkgInDetect) ? Color.Lime : SystemColors.ActiveCaption; RA2.BackColor = ML.IO_GetX(xi.PREB_StrpDetect) ? Color.Lime : SystemColors.ActiveCaption; RB1.BackColor = ML.IO_GetX(xi.RAIL_Vsn1Detect) ? Color.Lime : SystemColors.ActiveCaption; RC1.BackColor = ML.IO_GetX(xi.RAIL_Vsn2Detect) ? Color.Lime : SystemColors.ActiveCaption; RD1.BackColor = ML.IO_GetX(xi.RAIL_Vsn3Detect) ? Color.Lime : SystemColors.ActiveCaption; RE1.BackColor = ML.IO_GetX(xi.PSTB_MarkDetect) ? Color.Lime : SystemColors.ActiveCaption; RF1.BackColor = ML.IO_GetX(xi.PSTB_PkgDetect1) ? Color.Lime : SystemColors.ActiveCaption; RF2.BackColor = ML.IO_GetX(xi.PSTB_PkgDetect2) ? Color.Lime : SystemColors.ActiveCaption; tmUpdate.Enabled = true; }
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 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); 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_LStopLp, ML.IO_GetX(xi.ETC_LStopSw) || !m_bRun || bStopBtnFlick); ML.IO_SetY(yi.ETC_LResetLp, ML.IO_GetX(xi.ETC_LResetSw) || (m_bFlick && isErr)); ML.IO_SetY(yi.ETC_LAirLp, ML.IO_GetX(xi.ETC_LAirSw) || ML.IO_GetY(yi.ETC_MainAir)); ML.IO_SetY(yi.ETC_LInitLp, ML.IO_GetX(xi.ETC_LInitSw)); ML.IO_SetY(yi.ETC_RStartLp, ML.IO_GetX(xi.ETC_RStartSw) || m_bRun); ML.IO_SetY(yi.ETC_RStopLp, ML.IO_GetX(xi.ETC_RStopSw) || !m_bRun || bStopBtnFlick); ML.IO_SetY(yi.ETC_RResetLp, ML.IO_GetX(xi.ETC_RResetSw) || (m_bFlick && isErr)); ML.IO_SetY(yi.ETC_RAirLp, ML.IO_GetX(xi.ETC_RAirSw) || ML.IO_GetY(yi.ETC_MainAir)); ML.IO_SetY(yi.ETC_RInitLp, ML.IO_GetX(xi.ETC_RInitSw)); ML.IO_SetY(yi.ETC_Manual1, ML.IO_GetX(xi.ETC_Manual1)); ML.IO_SetY(yi.ETC_Manual2, ML.IO_GetX(xi.ETC_Manual2)); ML.IO_SetY(yi.ETC_Manual3, ML.IO_GetX(xi.ETC_Manual3)); ML.IO_SetY(yi.ETC_Manual4, ML.IO_GetX(xi.ETC_Manual4)); ML.IO_SetY(yi.ETC_Manual5, ML.IO_GetX(xi.ETC_Manual5)); // ML.IO_SetY(yi.ETC_StartLpR , ML.IO_GetX(xi.ETC_StartSwR ) || m_bRun ); // ML.IO_SetY(yi.ETC_StopLpR , ML.IO_GetX(xi.ETC_StopSwR ) || !m_bRun || bStopBtnFlick ); // ML.IO_SetY(yi.ETC_ResetLpR , ML.IO_GetX(xi.ETC_ResetSwR ) || (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_InitLpR , ML.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) { //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) { ML.IO_SetY(yi.ETC_MainAir, !ML.IO_GetY(yi.ETC_MainAir)); } //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) { 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, 30000)) { //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, 30000)) // 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; } }
private bool CycleReset() { if (tmTimeOut.OnDelay(iCycleStep != 0 && iCycleStep == iPreCycleStep, 2000)) { sErrMsg = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle TimeOut iCycleStep={0:00}", iCycleStep); Log.Trace(sErrMsg); ML.IO_SetY(Para.yiReset, false); ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); return(true); } if (iPreCycleStep != iCycleStep) { string sTemp = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle iCycleStep={0:00}", iCycleStep); Log.Trace(sTemp); } iPreCycleStep = iCycleStep; switch (iCycleStep) { default: sErrMsg = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle Default Clear at iCycleStep={0:00}", iCycleStep); Log.Trace(sErrMsg); ML.IO_SetY(Para.yiReset, false); ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); return(true); case 10: iResetSendCnt = 0; ML.IO_SetY(Para.yiReset, false); ML.IO_SetY(Para.yiJobStart, false); ML.IO_SetY(Para.yiLotStart, false); iCycleStep++; return(false); //여기서 레디 안들어와 있으면. case 11: if (!ML.IO_GetX(Para.xiVisnReady)) { ML.IO_SetY(Para.yiReset, true); tmDelay.Clear(); iCycleStep++; return(false); } iCycleStep = 14; return(false); //레디 안들어왔으면 리셑을 켜서 레디를 먼저 한다. case 12: if (!tmDelay.OnDelay(50)) { return(false); } //if(!ML.IO_GetX(Para.xiVisnReady)) return false ; ML.IO_SetY(Para.yiReset, false); iCycleStep++; return(false); case 13: //if(!tmDelay.OnDelay(500)) return false ; iCycleStep++; return(false); //여기부터 세팅. //밑에서 씀. case 14: ML.IO_SetY(Para.yiReset, true); iCycleStep++; return(false); case 15: if (ML.IO_GetX(Para.xiVisnReady)) { return(false); //이게 맞는건가??? } ML.IO_SetY(Para.yiReset, false); iCycleStep++; return(false); case 16: if (!ML.IO_GetX(Para.xiVisnReady)) { return(false); } tmDelay.Clear(); iCycleStep++; return(false); case 17: if (!tmDelay.OnDelay(100)) { return(false); } iResetSendCnt++; if (iResetSendCnt == 1) { //if(!ML.IO_GetX(Para.xiVisnBusy)) //{ iCycleStep = 14; return(false); //} } if (iResetSendCnt > 1) { if (ML.IO_GetX(Para.xiVisnBusy)) { sErrMsg = "Vision Reset Failed!"; return(true); } } return(true); } }
public bool GetIOEnd() { return(ML.IO_GetX(Para.xiVisnEnd)); }
public bool GetIOReady() { return(ML.IO_GetX(Para.xiVisnReady)); }
private bool CycleJobChange() { if (tmTimeOut.OnDelay(iCycleStep != 0 && iCycleStep == iPreCycleStep, 3000)) { sErrMsg = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle TimeOut iCycleStep={0:00}", iCycleStep); Log.Trace(sErrMsg); ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); ML.IO_SetY(Para.yiJobStart, false); return(true); } if (iPreCycleStep != iCycleStep) { string sTemp = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle iCycleStep={0:00}", iCycleStep); Log.Trace(sTemp); } iPreCycleStep = iCycleStep; switch (iCycleStep) { default: sErrMsg = string.Format(Para.Id.ToString() + " " + eSendingCmd.ToString() + " Cycle Default Clear at iCycleStep={0:00}", iCycleStep); Log.Trace(sErrMsg); ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); ML.IO_SetY(Para.yiJobStart, false); return(true); case 10: if (!ML.IO_GetX(Para.xiVisnReady)) { sErrMsg = Para.Id.ToString() + " Vision Not Ready!"; ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); return(true); } if (ML.IO_GetX(Para.xiVisnBusy)) { sErrMsg = Para.Id.ToString() + " Vision is Busy!"; ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); return(true); } if (!WriteJob(sPara)) { //쓰기 실패. sErrMsg = Para.Id.ToString() + " Vision WriteJob Failed!"; ML.ER_SetErr(ei.VSN_ComErr, sErrMsg); return(true); } ML.IO_SetY(Para.yiJobStart, true); iCycleStep++; return(false); case 11: if (!ML.IO_GetX(Para.xiVisnBusy)) { return(false); } ML.IO_SetY(Para.yiJobStart, false); iCycleStep++; return(false); case 12: if (ML.IO_GetX(Para.xiVisnBusy)) { return(false); } iCycleStep++; return(false); case 13: return(true); } }