public static bool InspectEmergency() { bool isOk = true; //Check Emergency if (SM.IO_GetX(xi.ETC_FtEmgSw) || SM.IO_GetX(xi.ETC_LtEmgSw) || SM.IO_GetX(xi.ETC_RrEmgSw) || SM.IO_GetX(xi.ETC_RtEmgSw)) { SM.MT_EmgStopAll(); SM.MT_SetServoAll(false); if (SM.IO_GetX(xi.ETC_FtEmgSw)) { SM.ER_SetErr(ei.ETC_Emergency, "전면 Emergency Switch 가 눌렸습니다."); } if (SM.IO_GetX(xi.ETC_LtEmgSw)) { SM.ER_SetErr(ei.ETC_Emergency, "좌측 Emergency Switch 가 눌렸습니다."); } if (SM.IO_GetX(xi.ETC_RrEmgSw)) { SM.ER_SetErr(ei.ETC_Emergency, "뒷면 Emergency Switch 가 눌렸습니다."); } if (SM.IO_GetX(xi.ETC_RtEmgSw)) { SM.ER_SetErr(ei.ETC_Emergency, "우측 Emergency Switch 가 눌렸습니다."); } isOk = false; } return(isOk); }
private void btLotOpen_Click(object sender, EventArgs e) { if (tbLotId.Text == "") { tbLotId.Text = DateTime.Now.ToString("HHmmss"); } string LotNo = tbLotId.Text.Trim(); string Device = tbSelDevice.Text.Trim(); DM.ARAY[(int)ri.IDX].SetStat(cs.Empty); SPC.LOT.ClearData(); if (!SM.IO_GetX(xi.IDX_Detect1)) { DM.ARAY[ri.IDX].SetStat(0, 0, cs.Unkwn); } else { DM.ARAY[ri.IDX].SetStat(0, 0, cs.Empty); } if (!SM.IO_GetX(xi.IDX_Detect2)) { DM.ARAY[ri.IDX].SetStat(0, 1, cs.Unkwn); } else { DM.ARAY[ri.IDX].SetStat(0, 1, cs.Empty); } if (!SM.IO_GetX(xi.IDX_Detect3)) { DM.ARAY[ri.IDX].SetStat(0, 2, cs.Unkwn); } else { DM.ARAY[ri.IDX].SetStat(0, 2, cs.Empty); } if (!SM.IO_GetX(xi.IDX_Detect4)) { DM.ARAY[ri.IDX].SetStat(0, 3, cs.Unkwn); } else { DM.ARAY[ri.IDX].SetStat(0, 3, cs.Empty); } if (!SM.IO_GetX(xi.IDX_Detect5)) { DM.ARAY[ri.IDX].SetStat(0, 4, cs.Unkwn); } else { DM.ARAY[ri.IDX].SetStat(0, 4, cs.Empty); } LOT.LotOpen(LotNo, Device); Log.Trace("LotOpen", "Try"); OM.EqpStat.iWorkCnt = 0; Close(); }
private void timer1_Tick(object sender, EventArgs e) { for (int i = 0; i < (int)pi.MAX_PART; i++) { lvSequence.Items[i].SubItems[2].Text = SEQ.m_Part[i].GetToStartStep().ToString(); lvSequence.Items[i].SubItems[2].BackColor = SEQ.m_Part[i].GetToStartStep() == 0 ? Color.White : Color.Yellow; lvSequence.Items[i].SubItems[3].Text = SEQ.m_Part[i].GetCrntCycleName(); lvSequence.Items[i].SubItems[3].BackColor = SEQ.m_Part[i].GetSeqStep() == 0 ? Color.White : Color.Yellow; lvSequence.Items[i].SubItems[4].Text = SEQ.m_Part[i].GetCycleStep().ToString(); lvSequence.Items[i].SubItems[4].BackColor = SEQ.m_Part[i].GetCycleStep() == 0 ? Color.White : Color.Yellow; lvSequence.Items[i].SubItems[5].Text = SEQ.m_Part[i].GetToStopStep().ToString(); lvSequence.Items[i].SubItems[5].BackColor = SEQ.m_Part[i].GetToStopStep() == 0 ? Color.White : Color.Yellow; lvSequence.Items[i].SubItems[6].Text = SEQ.m_Part[i].GetHomeStep().ToString(); lvSequence.Items[i].SubItems[6].BackColor = SEQ.m_Part[i].GetHomeStep() == 0 ? Color.White : Color.Yellow; } //textBox1.Text = OM.EqpStat.iLDRSplyCnt.ToString(); //tbRcvDataId.Text = VC.GetVisnRecvViewMsgId().ToString(); //tbRcvData .Text = VC.GetVisnRecvViewMsg(); lbStat.Text = SEQ._iSeqStat.ToString(); pnNeedToLock.BackColor = SEQ.bNeedToLock ? Color.Lime : Color.Yellow; pnRun.BackColor = SEQ._bRun ? Color.Lime : Color.Yellow; pnSeqStatInit.BackColor = SEQ._iSeqStat == EN_SEQ_STAT.Init ? Color.Lime : Color.Yellow; pnSeqStatMan.BackColor = SEQ._iSeqStat == EN_SEQ_STAT.Manual ? Color.Lime : Color.Yellow; pnMstrSw.BackColor = SM.IO_GetX(xi.ETC_MstrSw) ? Color.Lime : Color.Yellow; pnFtDoor.BackColor = SM.IO_GetX(xi.ETC_FtDoor) ? Color.Lime : Color.Yellow; pnFtDoorSd.BackColor = SM.IO_GetX(xi.ETC_FtDoorSd) ? Color.Lime : Color.Yellow; pnLtDoorSd.BackColor = SM.IO_GetX(xi.ETC_LtDoorsd) ? Color.Lime : Color.Yellow; pnRrDoorLt.BackColor = SM.IO_GetX(xi.ETC_RrDoorLt) ? Color.Lime : Color.Yellow; pnRrDoorRt.BackColor = SM.IO_GetX(xi.ETC_RrDoorRt) ? Color.Lime : Color.Yellow; pnRtDoorSd.BackColor = SM.IO_GetX(xi.ETC_RtDoorSd) ? Color.Lime : Color.Yellow; }
public bool SendJobChange(String _sJobName) { SaveJobFile(_sJobName); if (!SM.IO_GetX(xi.VISN_Ready)) { return(false); } VisnCycle[(int)vs.JobChange].iStep = 10; return(true); }
public bool SendIndex(int _iIndx) { SaveCommand(_iIndx); if (!SM.IO_GetX(xi.VISN_Ready)) { SM.ER_SetErr(ei.VSN_ComErr, "Vision not ready"); return(false); } VisnCycle[(int)vs.Command].iStep = 10; return(true); }
//Functions. //Inspection Machine Status. public static bool InspectMainAir() { bool isOk = true; //if(!SM.IO_GetY(yi.ETC_MainAirSol)) isOk = false ; if (!SM.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 InspectEmergency() { bool isOk = true; //Check Emergency if (SM.IO_GetX(xi.ETC_EmgSw)) { SM.MT_EmgStopAll(); SM.ER_SetErr(ei.ETC_Emergency, "Emergency Switch가 눌렸습니다."); //SM.MT.SetServoAll(false); isOk = false; } return(isOk); }
public static bool InspectFlowMeter() { bool isOk = true; if (SM.IO_GetY(yi.BARZ_Blower)) { m_tmTemp.Clear(); } if (!SM.IO_GetY(yi.BARZ_Blower) && !SM.IO_GetX(xi.ETC_FlowMeter) && m_tmTemp.OnDelay(500)) { SM.ER_SetErr(ei.ETC_FlowMeter, "Flow Meter Sensor Checked"); isOk = false; } return(isOk); }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; bool bIn = SM.IO_GetX(m_iXadd); if (bIn) { lbState.BackColor = Color.Red; lbState.Text = "ON"; } else { lbState.BackColor = SystemColors.Control; lbState.Text = "OFF"; } tmUpdate.Enabled = true; }
bool CycleLotStart(ref TCycle _tCycle) { //Check Cycle Time Out. string sTemp; if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000)) { SM.ER_SetNeedShowErr(false); sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep); SM.ER_SetErr(ei.VSN_ComErr, sTemp); SM.IO_SetY(yi.VISN_Change, false); _tCycle.iStep = 0; return(true); } if (_tCycle.iStep != _tCycle.iPreStep) { sTemp = string.Format("Step={0:00}", _tCycle.iStep); Log.Trace("Vision Communction", sTemp); } _tCycle.iPreStep = _tCycle.iStep; //Cycle. switch (_tCycle.iStep) { default: sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep); SM.ER_SetErr(ei.VSN_ComErr, sTemp); Log.Trace("Vision Communction", sTemp); SM.IO_SetY(yi.VISN_Change, false); _tCycle.iStep = 0; return(true); case 10: SM.IO_SetY(yi.VISN_LotStart, false); _tCycle.iStep++; return(false); case 11: if (SM.IO_GetX(xi.VISN_Busy)) { return(false); } SM.IO_SetY(yi.VISN_LotStart, true); _tCycle.iStep++; return(false); case 12: if (!SM.IO_GetX(xi.VISN_Busy)) { return(false); } SM.IO_SetY(yi.VISN_LotStart, false); _tCycle.iStep++; return(false); case 13: if (SM.IO_GetX(xi.VISN_Busy)) { return(false); } _tCycle.iStep = 0; return(true); } }
//One Cycle. //여기부터. bool CycleInsp(ref TCycle _tCycle) { //Check Cycle Time Out. string sTemp; if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000)) { SM.ER_SetNeedShowErr(false); sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep); SM.ER_SetErr(ei.VSN_ComErr, sTemp); _tCycle.iStep = 0; return(true); } if (_tCycle.iStep != _tCycle.iPreStep) { sTemp = string.Format("Step={0:00}", _tCycle.iStep); Log.Trace("Vision Communction", sTemp); } _tCycle.iPreStep = _tCycle.iStep; //Cycle. switch (_tCycle.iStep) { default: sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep); SM.ER_SetErr(ei.VSN_ComErr, sTemp); Log.Trace("Vision Communction", sTemp); _tCycle.iStep = 0; return(true); case 10: if (SM.IO_GetX(xi.VISN_Busy)) { return(false); } //SML.MT.OneShotTrg((int)mi.TOOL_YTool,true,1000); //SM.IO_SetY(Para.yVisn_ManInsp, true); SM.IO_SetY(yi.VISN_ManInsp, true); Log.Trace("Vision Shot", "ON"); _tCycle.tmDelay.Clear(); _tCycle.iStep++; return(false); case 11: //if(_tCycle.tmDelay.OnDelay(true, 10))return false; if (!SM.IO_GetX(xi.VISN_Busy)) { return(false); } //SM.IO_SetY(Para.yVisn_ManInsp, false); SM.IO_SetY(yi.VISN_ManInsp, false); Log.Trace("Vision Shot", "OFF"); _tCycle.tmDelay.Clear(); _tCycle.iStep++; return(false); case 12: //if(_tCycle.tmDelay.OnDelay(1000))return false; //SM.IO_SetY(Para.yVisn_ManInsp, false); _tCycle.tmDelay.Clear(); _tCycle.iStep++; return(false); case 13: //if(_tCycle.tmDelay.OnDelay(1000))return false; //if(SM.IO_GetY(Para.yVisn_ManInsp)) //{ //SM.IO_SetY(yi.VISN_ManInsp, false); Log.Trace("Vision Shot", "OFF2"); //return false; //} if (SM.IO_GetX(xi.VISN_Busy)) { return(false); } Log.Trace("Vision Shot", "END"); _tCycle.iStep = 0; return(true); } }
private void timer1_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; pnIdx.Refresh(); //pnPst.Refresh(); tbTargetCnt.Text = OM.DevOptn.iTargetCnt.ToString(); tbCrntCnt.Text = OM.EqpStat.iWorkCnt.ToString(); tbNodeCnt.Text = OM.EqpStat.iNodeCnt.ToString(); tbCttrCnt.Text = OM.EqpStat.iCttrCnt.ToString(); tbDegree.Text = OM.NodePos[SEQ.IDX.iNodeCnt].dDegree.ToString(); int iLevel = (int)FormPassword.GetLevel(); switch (iLevel) { case (int)EN_LEVEL.Operator: btOperator.Text = "OPERATOR"; break; case (int)EN_LEVEL.Engineer: btOperator.Text = "ENGINEER"; break; case (int)EN_LEVEL.Master: btOperator.Text = " ADMIN "; break; default: btOperator.Text = " ERROR "; break; } if (bPreLotOpen != LOT.GetLotOpen()) { btLotEnd.Enabled = LOT.GetLotOpen(); btStart.Enabled = LOT.GetLotOpen(); btLotOpen.Enabled = !LOT.GetLotOpen(); bPreLotOpen = LOT.GetLotOpen(); } SPC.DAY.DispDayInfo(lvDayInfo); SPC.LOT.DispLotInfo(lvLotInfo); string Str; int iPreErrCnt = 0; int iCrntErrCnt = 0; for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { iCrntErrCnt++; } } if (iPreErrCnt != iCrntErrCnt) { lbErr.Items.Clear(); int iErrNo = SML.ER.GetLastErr(); for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { Str = string.Format("[ERR{0:000}]", i); Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrMsg(i); lbErr.Items.Add(Str); } } } if (SEQ._iSeqStat != EN_SEQ_STAT.Error) { lbErr.Items.Clear(); } iPreErrCnt = iCrntErrCnt; string sCycleTimeSec; int iCycleTimeMs; //Door Sensor. 나중에 찾아보자 //bool isAllCloseDoor = SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorFt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorLt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRt) && // SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRr) ; //if (FormPassword.GetLevel() != EN_LEVEL.lvOperator && isAllCloseDoor && CMachine._bRun) //{ // //FM_SetLevel(lvOperator); //} if (!SM.MT_GetHomeDoneAll()) { btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red; } else { btAllHome.ForeColor = Color.Black; } //DM.ARAY[(int)ri.LENS ].SetMaxColRow(OM.DevInfo.iLensColCnt , OM.DevInfo.iLensRowCnt); //DM.ARAY[(int)ri.REAR ].SetMaxColRow(OM.DevInfo.iRearColCnt , OM.DevInfo.iRearRowCnt); //DM.ARAY[(int)ri.FRNT ].SetMaxColRow(OM.DevInfo.iFrntColCnt , OM.DevInfo.iFrntRowCnt); //DM.ARAY[(int)ri.PICK ].SetMaxColRow(2, 1); pnIDXDetect1.BackColor = !SM.IO_GetX(xi.IDX_Detect1) ? Color.Lime : Color.Red; pnIDXDetect2.BackColor = !SM.IO_GetX(xi.IDX_Detect2) ? Color.Lime : Color.Red; pnIDXDetect3.BackColor = !SM.IO_GetX(xi.IDX_Detect3) ? Color.Lime : Color.Red; pnIDXDetect4.BackColor = !SM.IO_GetX(xi.IDX_Detect4) ? Color.Lime : Color.Red; pnIDXDetect5.BackColor = !SM.IO_GetX(xi.IDX_Detect5) ? Color.Lime : Color.Red; pnULDDetect1.BackColor = SM.IO_GetX(xi.ULD_Detect1) ? Color.Lime : Color.Red; pnULDDetect2.BackColor = SM.IO_GetX(xi.ULD_Detect2) ? Color.Lime : Color.Red; pnULDDetect3.BackColor = SM.IO_GetX(xi.ULD_Detect3) ? Color.Lime : Color.Red; pnULDDetect4.BackColor = SM.IO_GetX(xi.ULD_Detect4) ? Color.Lime : Color.Red; pnULDDetect5.BackColor = SM.IO_GetX(xi.ULD_Detect5) ? Color.Lime : Color.Red; //Option View if (OM.CmnOptn.bUsedLine1) { pnOption1.BackColor = Color.Lime; lbOption1.Text = "ON"; } else { pnOption1.BackColor = Color.Red; lbOption1.Text = "OFF"; } if (OM.CmnOptn.bUsedLine2) { pnOption2.BackColor = Color.Lime; lbOption2.Text = "ON"; } else { pnOption2.BackColor = Color.Red; lbOption2.Text = "OFF"; } if (OM.CmnOptn.bUsedLine3) { pnOption3.BackColor = Color.Lime; lbOption3.Text = "ON"; } else { pnOption3.BackColor = Color.Red; lbOption3.Text = "OFF"; } if (OM.CmnOptn.bUsedLine4) { pnOption4.BackColor = Color.Lime; lbOption4.Text = "ON"; } else { pnOption4.BackColor = Color.Red; lbOption4.Text = "OFF"; } if (OM.CmnOptn.bUsedLine5) { pnOption5.BackColor = Color.Lime; lbOption5.Text = "ON"; } else { pnOption5.BackColor = Color.Red; lbOption5.Text = "OFF"; } if (OM.CmnOptn.bIgnrWork) { pnOption6.BackColor = Color.Lime; lbOption6.Text = "ON"; } else { pnOption6.BackColor = Color.Red; lbOption6.Text = "OFF"; } btCyl1.Text = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ? "FWD" : "BWD"; btCyl1.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold1UpDn) != 0 ? Color.Lime : Color.Black; btCyl2.Text = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ? "FWD" : "BWD"; btCyl2.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutLtFwBw) != 0 ? Color.Lime : Color.Black; btCyl3.Text = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ? "FWD" : "BWD"; btCyl3.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutRtFwBw) != 0 ? Color.Lime : Color.Black; btCyl4.Text = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ? "FWD" : "BWD"; btCyl4.ForeColor = SML.CL.GetCmd((int)ci.IDX_TwstLtDnUp) != 0 ? Color.Lime : Color.Black; //btCyl5 .Text = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ? "FWD" : "BWD" ; //btCyl5 .ForeColor = SM.CL.GetCmd((int)ai.IDX_TwstRtDnUp) != 0 ? Color.Lime : Color.Black; btCyl6.Text = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ? "FWD" : "BWD"; btCyl6.ForeColor = SML.CL.GetCmd((int)ci.IDX_Hold2UpDn) != 0 ? Color.Lime : Color.Black; btCyl7.Text = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ? "FWD" : "BWD"; btCyl7.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutBaseUpDn) != 0 ? Color.Lime : Color.Black; //btCyl7 .Text = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ? "FWD" : "BWD" ; //btCyl7 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftFwBw ) != 0 ? Color.Lime : Color.Black; //btCyl8 .Text = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ? "FWD" : "BWD" ; //btCyl8 .ForeColor = SM.CL.GetCmd((int)ai.IDX_ShiftUpDn ) != 0 ? Color.Lime : Color.Black; btCyl8.Text = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ? "FWD" : "BWD"; btCyl8.ForeColor = SML.CL.GetCmd((int)ci.IDX_OutDnUp) != 0 ? Color.Lime : Color.Black; btCyl9.Text = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ? "FWD" : "BWD"; btCyl9.ForeColor = SML.CL.GetCmd((int)ci.IDX_CutterDnUp) != 0 ? Color.Lime : Color.Black; //if (CMachine._iSeqStat == EN_SEQ_STAT.ssWorkEnd || CMachine._iSeqStat == EN_SEQ_STAT.ssStop) //{ // CMachine.Reset(); // if (bRepeat) CMachine._bBtnStart = true; //} tmUpdate.Enabled = true; }
private void timer1_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; //로그인/로그아웃 방식 if (SML.FrmLogOn.GetLevel() == (int)EN_LEVEL.LogOff) { btOperator.Text = "LOG IN"; pnDataMap.Enabled = false; //pnDayInfo .Enabled = false; pnLotInfo.Enabled = false; pnError.Enabled = false; pnOperMan.Enabled = false; //pnWorkInfo.Enabled = false; pnLotOpen.Enabled = false; //btStart .Enabled = LOT.LotList.Count == 0 || !LOT.LotOpened; btStart.Enabled = false; btStop.Enabled = false; btReset.Enabled = false; btLightOnOff.Enabled = false; btOperator.Enabled = true; } else { btOperator.Text = SML.FrmLogOn.GetLevel().ToString(); pnDataMap.Enabled = true; //pnDayInfo .Enabled = true; pnLotInfo.Enabled = true; pnError.Enabled = true; pnOperMan.Enabled = true; //pnWorkInfo.Enabled = true; pnLotOpen.Enabled = true; //btStart .Enabled = LOT.LotList.Count != 0 || LOT.LotOpened; btStart.Enabled = true; btStop.Enabled = true; btReset.Enabled = true; btLightOnOff.Enabled = true; } btLotOpen.Enabled = !LOT.GetLotOpen(); lbDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); TimeSpan Span; try{ Span = TimeSpan.FromMilliseconds(SPC.LOT.Data.RunTime); } catch (Exception ex) { Span = TimeSpan.FromMilliseconds(0); } //label11.Text = OM.EqpStat.iLDRSplyCnt.ToString() ; string Str; int iPreErrCnt = 0; int iCrntErrCnt = 0; for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { iCrntErrCnt++; } } if (iPreErrCnt != iCrntErrCnt) { lbErr.Items.Clear(); int iErrNo = SM.ER_GetLastErr(); for (int i = 0; i < SML.ER._iMaxErrCnt; i++) { if (SML.ER.GetErr(i)) { Str = string.Format("[ERR{0:000}]", i); Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrSubMsg(i); lbErr.Items.Add(Str); } } } if (SEQ._iSeqStat != EN_SEQ_STAT.Error) { lbErr.Items.Clear(); } iPreErrCnt = iCrntErrCnt; if (!SM.MT_GetHomeDoneAll()) { btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red; } else { btAllHome.ForeColor = Color.Black; } SPC.LOT.DispLotInfo(lvLotInfo); btInputTrayF.Enabled = !SEQ._bRun; btInputTrayG.Enabled = !SEQ._bRun; btAllEmptyTray.Enabled = !SEQ._bRun; btBarCodeReTry.Enabled = !SEQ._bRun; if (SM.IO_GetX(xi.BARZ_PckrVac)) { lbBarVac.BackColor = Color.Lime; } else { lbBarVac.BackColor = Color.Red; } //JS //Manual Button Text. if (SM.CL_GetCmd(ci.LODR_ClampClOp) == fb.Bwd) { btCylinder1.Text = "Loader Clamp OPEN"; } else { btCylinder1.Text = "Loader Clamp CLOSE"; } btCylinder1.ForeColor = SM.CL_Complete(ci.LODR_ClampClOp) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.LODR_SperatorUpDn) == fb.Bwd) { btCylinder2.Text = "Loader Sperator DOWN"; } else { btCylinder2.Text = "Loader Sperator Up"; } btCylinder2.ForeColor = SM.CL_Complete(ci.LODR_SperatorUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.IDXR_ClampClOp) == fb.Bwd) { btCylinder4.Text = "Index Rear Clamp OPEN"; } else { btCylinder4.Text = "Index Rear Clamp CLOSE"; } btCylinder4.ForeColor = SM.CL_Complete(ci.IDXR_ClampClOp) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Bwd) { btCylinder5.Text = "Index Rear Clamp DOWN"; } else { btCylinder5.Text = "Index Rear Clamp UP"; } btCylinder5.ForeColor = SM.CL_Complete(ci.IDXR_ClampUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.IDXF_ClampClOp) == fb.Bwd) { btCylinder6.Text = "Index Front Clamp OPEN"; } else { btCylinder6.Text = "Index Front Clamp CLOSE"; } btCylinder6.ForeColor = SM.CL_Complete(ci.IDXF_ClampClOp) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Bwd) { btCylinder3.Text = "Index Front Clamp DOWN"; } else { btCylinder3.Text = "Index Front Clamp UP"; } btCylinder3.ForeColor = SM.CL_Complete(ci.IDXF_ClampUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.STCK_RailClOp) == fb.Bwd) { btCylinder7.Text = "Tray Rail OPEN"; } else { btCylinder7.Text = "Tray Rail CLOSE"; } btCylinder7.ForeColor = SM.CL_Complete(ci.STCK_RailClOp) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.STCK_RailTrayUpDn) == fb.Bwd) { btCylinder8.Text = "Stacker Rail Tray DOWN"; } else { btCylinder8.Text = "Stacker Rail Tray UP"; } btCylinder8.ForeColor = SM.CL_Complete(ci.STCK_RailTrayUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.STCK_StackStprUpDn) == fb.Bwd) { btCylinder9.Text = "Stacker Stopper DOWN"; } else { btCylinder9.Text = "Stacker Stopper UP"; } btCylinder9.ForeColor = SM.CL_Complete(ci.STCK_StackStprUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.STCK_StackOpCl) == fb.Bwd) { btCylinder10.Text = "Stacker Rail CLOSE"; } else { btCylinder10.Text = "Stacker Rail OPEN"; } btCylinder10.ForeColor = SM.CL_Complete(ci.STCK_StackOpCl) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.BARZ_BrcdStprUpDn) == fb.Bwd) { btCylinder11.Text = "Barcode Stopper DOWN"; } else { btCylinder11.Text = "Barcode Stopper UP"; } btCylinder11.ForeColor = SM.CL_Complete(ci.BARZ_BrcdStprUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.BARZ_BrcdTrayUpDn) == fb.Bwd) { btCylinder12.Text = "Barcode Tray DOWN"; } else { btCylinder12.Text = "Barcode Tray UP"; } btCylinder12.ForeColor = SM.CL_Complete(ci.BARZ_BrcdTrayUpDn) ? Color.Black : Color.Lime; if (SM.CL_GetCmd(ci.BARZ_YPckrFwBw) == fb.Bwd) { btCylinder13.Text = "Barcode Picker BWD"; } else { btCylinder13.Text = "Barcode Picker FWD"; } btCylinder13.ForeColor = SM.CL_Complete(ci.BARZ_YPckrFwBw) ? Color.Black : Color.Lime; btManual1.ForeColor = (MM.GetManNo() == mc.LODR_Home) ? Color.Lime : Color.Black; btManual2.ForeColor = (MM.GetManNo() == mc.TOOL_Home) ? Color.Lime : Color.Black; btManual3.ForeColor = (MM.GetManNo() == mc.BARZ_Home) ? Color.Lime : Color.Black; btManual4.ForeColor = (MM.GetManNo() == mc.IDXR_Home) ? Color.Lime : Color.Black; btManual5.ForeColor = (MM.GetManNo() == mc.IDXF_Home) ? Color.Lime : Color.Black; btManual6.ForeColor = (MM.GetManNo() == mc.STCK_Home) ? Color.Lime : Color.Black; Refresh(); tmUpdate.Enabled = true; }
private void btLotOpen_Click(object sender, EventArgs e) { if (tbLotNo.Text == "") { Log.ShowMessage("Error", "Lot No is Empty"); return;// tbLotId.Text = DateTime.Now.ToString("HHmmss"); } if (tbMaterialNo.Text == "") { Log.ShowMessage("Error", "Material No is Empty"); return;// tbLotId.Text = DateTime.Now.ToString("HHmmss"); } if (tbLotAlias.Text == "") { Log.ShowMessage("Error", "Lot Alias is Empty"); return;// tbLotId.Text = DateTime.Now.ToString("HHmmss"); } if (tbEmployeeID.Text == "") { Log.ShowMessage("Error", "EmployeeID is Empty"); return;// tbLotId.Text = DateTime.Now.ToString("HHmmss"); } if (!SM.IO_GetX(xi.VISN_Ready)) { Log.ShowMessage("Vision", SM.IO_GetXName(xi.VISN_Ready) + "Vision Ready IO is not On"); return; } OM.EqpStat.bWrapingEnd = false; Log.Trace("LotOpen", "Try"); string LotNo = tbLotNo.Text.Trim(); string Device = tbSelDevice.Text.Trim(); CDelayTimer TimeOut = new CDelayTimer(); TimeOut.Clear(); SEQ.Visn.SendLotStart(LotNo); while (!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.LotStart)) { Thread.Sleep(1); if (TimeOut.OnDelay(5000)) { Log.ShowMessage("Vision", "Lot Start TimeOut"); return; } } OM.EqpStat.iWorkBundle = 0; LOT.TLot Lot; Lot.sEmployeeID = tbEmployeeID.Text.Trim(); Lot.sLotNo = tbLotNo.Text.Trim(); Lot.sMaterialNo = tbMaterialNo.Text.Trim(); Lot.sLotAlias = tbLotAlias.Text.Trim(); LOT.LotOpen(Lot); OM.EqpStat.sLotSttTime = DateTime.Now.ToString("HH:mm:ss"); if (!OM.CmnOptn.bOracleNotUse && !OM.CmnOptn.bIdleRun) { if (SEQ.Oracle.ProcessLotOpen(Lot.sLotNo, Lot.sMaterialNo, Lot.sLotAlias)) { if (!DeviceChange(SEQ.Oracle.Stat.sVisionRecipe_RecipeName)) { Log.ShowMessage("Device", "'" + SEQ.Oracle.Stat.sVisionRecipe_RecipeName + "'" + "dosn't exist!"); } } else { Log.ShowMessage("Oracle", SEQ.Oracle.GetLastMsg()); return; } //유닛아이디 리스트 만들기 시간 오래 걸려서 //별도 스레드 만듬. SEQ.Oracle.ThreadMakeUnitIDDMC1List(); } else { //Device Change에서 함. DM.ARAY[ri.SPLR].SetStat(cs.None); DM.ARAY[ri.IDXR].SetStat(cs.None); DM.ARAY[ri.IDXF].SetStat(cs.None); DM.ARAY[ri.PCKR].SetStat(cs.None); DM.ARAY[ri.TRYF].SetStat(cs.None); DM.ARAY[ri.TRYG].SetStat(cs.Good); DM.ARAY[ri.OUTZ].SetStat(cs.None); DM.ARAY[ri.STCK].SetStat(cs.Empty); DM.ARAY[ri.BARZ].SetStat(cs.None); DM.ARAY[ri.INSP].SetStat(cs.Good); DM.ARAY[ri.PSTC].SetStat(cs.None); Close(); } //if (Log.ShowMessageModal("Confirm", "Do you want to All Homming?") != DialogResult.Yes) ; //20180305 오스람 요청... 랏오픈시에 올홈. MM.SetManCycle(mc.AllHome); }
public void Update(/*string _sCrntLotNo,*/ EN_SEQ_STAT Stat) { //string sLotId ; double dCrntTime = DateTime.Now.ToOADate(); double dCycleTime = dCrntTime - dPreTime; //Time Info. switch (Stat) { case EN_SEQ_STAT.Init: m_tData.dStopTime += dCycleTime; break; case EN_SEQ_STAT.Warning: m_tData.dStopTime += dCycleTime; break; case EN_SEQ_STAT.Error: m_tData.dErrTime += dCycleTime; break; case EN_SEQ_STAT.Running: m_tData.dWorkTime += dCycleTime; break; case EN_SEQ_STAT.Stop: m_tData.dStopTime += dCycleTime; break; case EN_SEQ_STAT.Maint: m_tData.dStopTime += dCycleTime; break; case EN_SEQ_STAT.RunWarn: m_tData.dWorkTime += dCycleTime; break; case EN_SEQ_STAT.WorkEnd: m_tData.dStopTime += dCycleTime; break; } m_tData.dTotalTime += dCycleTime; //Day Log 랏 데이터는 저장 할때 랏오픈된 날짜에 저장 하지만 Day는 Lot하고 상관 없는 개념이라 그냥 바로바로 Day에 저장 한다. //Lot과 데이터 연동 하고 싶으면 랏업데이트에 있는 저장 패턴 복사해서 쓴다. bool bDateChanged = ((int)dCrntTime) != ((int)dPreTime); //소수점 이하는 시간 데이터. if (bDateChanged) { //날자 바뀜. ClearData(); } dPreTime = dCrntTime; //string sPreLotNo = _sCrntLotNo ; //if(sPreLotNo != _sCrntLotNo /*&& Stat !=ssStop*/) { //앗 랏이 바뀌었네!!!! // m_tData.iLotCnt++; //} //sPreLotNo = _sCrntLotNo ; //m_tData.dErrTime = dCrntTime; //m_tData.dWorkTime = ; //m_tData.dStopTime; //m_tData.dTotalTime; //m_tData.dUPH; //m_tData.iWorkCnt; m_tData.dUPEH = m_tData.dTotalTime == 0 ? 0.0 : m_tData.iWorkCnt / (m_tData.dTotalTime * 24); m_tData.dUPH = m_tData.dWorkTime == 0 ? 0.0 : m_tData.iWorkCnt / (m_tData.dWorkTime * 24); //잡파일 체인지 할때 어레이 동적 할당 다시 하기때문에 돌려줘야 한다. //이장비는 툴만 보기 때문에 상관 없지만 그냥 이렇게 내둔다. if (Stat == EN_SEQ_STAT.Stop) { return; } ///////////////////////매우 중요............. int iWorkCnt; if (SEQ._bRun) { iWorkCnt = DM.ARAY[(int)ri.IDX].GetCntStat(cs.Work); if (iPreWorkCnt != iWorkCnt && iWorkCnt != 0) { if (!SM.IO_GetX(xi.IDX_Detect1)) { m_tData.iWorkCnt += 1; } if (!SM.IO_GetX(xi.IDX_Detect2)) { m_tData.iWorkCnt += 1; } if (!SM.IO_GetX(xi.IDX_Detect3)) { m_tData.iWorkCnt += 1; } if (!SM.IO_GetX(xi.IDX_Detect4)) { m_tData.iWorkCnt += 1; } if (!SM.IO_GetX(xi.IDX_Detect5)) { m_tData.iWorkCnt += 1; } //m_tData.iWorkCnt += 1; } iPreWorkCnt = iWorkCnt; } }
public static bool InspectDoor() { //JS //Local Var. isOk = true; bNeedToLock = m_bRun || m_iSeqStat == EN_SEQ_STAT.Init || m_iSeqStat == EN_SEQ_STAT.Manual; if (SM.IO_GetX(xi.ETC_MstrSw) && bNeedToLock) { if (!SM.IO_GetX(xi.ETC_FtDoor)) { SM.ER_SetErr(ei.ETC_Door, "Front Door Open"); isOk = false; } if (!SM.IO_GetX(xi.ETC_FtDoorSd)) { SM.ER_SetErr(ei.ETC_Door, "Front Side Door Open"); isOk = false; } if (!SM.IO_GetX(xi.ETC_LtDoorsd)) { SM.ER_SetErr(ei.ETC_Door, "Left Side Door Open"); isOk = false; } if (!SM.IO_GetX(xi.ETC_RrDoorLt)) { SM.ER_SetErr(ei.ETC_Door, "Rear Left Door Open"); isOk = false; } if (!SM.IO_GetX(xi.ETC_RrDoorRt)) { SM.ER_SetErr(ei.ETC_Door, "Rear Right Door Open"); isOk = false; } if (!SM.IO_GetX(xi.ETC_RtDoorSd)) { SM.ER_SetErr(ei.ETC_Door, "Right Side Door Open"); isOk = false; } if (isOk) { SM.IO_SetY(yi.ETC_DoorLockLtFt, true); SM.IO_SetY(yi.ETC_DoorLockLtLt, true); SM.IO_SetY(yi.ETC_DoorLockLtRr, true); SM.IO_SetY(yi.ETC_DoorLockLtRt, true); SM.IO_SetY(yi.ETC_DoorLockRtFt, true); SM.IO_SetY(yi.ETC_DoorLockRtLt, true); SM.IO_SetY(yi.ETC_DoorLockRtRr, true); SM.IO_SetY(yi.ETC_DoorLockRtRt, true); } } else { SM.IO_SetY(yi.ETC_DoorLockLtFt, false); SM.IO_SetY(yi.ETC_DoorLockLtLt, false); SM.IO_SetY(yi.ETC_DoorLockLtRr, false); SM.IO_SetY(yi.ETC_DoorLockLtRt, false); SM.IO_SetY(yi.ETC_DoorLockRtFt, false); SM.IO_SetY(yi.ETC_DoorLockRtLt, false); SM.IO_SetY(yi.ETC_DoorLockRtRr, false); SM.IO_SetY(yi.ETC_DoorLockRtRt, false); } ////if(!OM.CmnOptn.bIgnrDoor && m_iStep == EN_SEQ_STEP.Run){ //if(m_bRun || m_iSeqStat == EN_SEQ_STAT.Init || m_iSeqStat == EN_SEQ_STAT.Manual){ //키가 ON // if (SM.IO_GetX(xi.ETC_MstrSw)){ // if (!SM.IO_GetX(xi.ETC_FtDoor )){SM.ER_SetErr(ei.ETC_Door, "Front Door Open" );isOk= false;} // if (!SM.IO_GetX(xi.ETC_FtDoorSd)){SM.ER_SetErr(ei.ETC_Door, "Front Side Door Open");isOk= false;} // if (!SM.IO_GetX(xi.ETC_LtDoorsd)){SM.ER_SetErr(ei.ETC_Door, "Left Side Door Open" );isOk= false;} // if (!SM.IO_GetX(xi.ETC_RrDoorLt)){SM.ER_SetErr(ei.ETC_Door, "Rear Left Door Open" );isOk= false;} // if (!SM.IO_GetX(xi.ETC_RrDoorRt)){SM.ER_SetErr(ei.ETC_Door, "Rear Right Door Open");isOk= false;} // if (!SM.IO_GetX(xi.ETC_RtDoorSd)){SM.ER_SetErr(ei.ETC_Door, "Right Side Door Open");isOk= false;} // if (isOk) { // SM.IO_SetY(yi.ETC_DoorLockLtFt, true); // SM.IO_SetY(yi.ETC_DoorLockLtLt, true); // SM.IO_SetY(yi.ETC_DoorLockLtRr, true); // SM.IO_SetY(yi.ETC_DoorLockLtRt, true); // SM.IO_SetY(yi.ETC_DoorLockRtFt, true); // SM.IO_SetY(yi.ETC_DoorLockRtLt, true); // SM.IO_SetY(yi.ETC_DoorLockRtRr, true); // SM.IO_SetY(yi.ETC_DoorLockRtRt, true); // } // } //} //else //{ // SM.IO_SetY(yi.ETC_DoorLockLtFt, false); // SM.IO_SetY(yi.ETC_DoorLockLtLt, false); // SM.IO_SetY(yi.ETC_DoorLockLtRr, false); // SM.IO_SetY(yi.ETC_DoorLockLtRt, false); // SM.IO_SetY(yi.ETC_DoorLockRtFt, false); // SM.IO_SetY(yi.ETC_DoorLockRtLt, false); // SM.IO_SetY(yi.ETC_DoorLockRtRr, false); // SM.IO_SetY(yi.ETC_DoorLockRtRt, false); //} //Ok. return(isOk); }
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; } }
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; } }