public string GetCrntLotNo() { //if(DM.ARAY[riSRT].GetCntStat(csRslt1) // return ""; return(LOT.GetLotNo()); /* * if(!DM.ARAY[riSRT].CheckAllStat(csNone)) return DM.ARAY[riSRT].GetLotNo() ; * else if(!DM.ARAY[riZIG].CheckAllStat(csNone)) return DM.ARAY[riZIG].GetLotNo() ; * else if(!DM.ARAY[riSG1].CheckAllStat(csNone)) return DM.ARAY[riSG1].GetLotNo() ; * else if(!DM.ARAY[riSG2].CheckAllStat(csNone)) return DM.ARAY[riSG2].GetLotNo() ; * else if(!DM.ARAY[riSG3].CheckAllStat(csNone)) return DM.ARAY[riSG3].GetLotNo() ; * else if(!DM.ARAY[riSG4].CheckAllStat(csNone)) return DM.ARAY[riSG4].GetLotNo() ; * else if(!DM.ARAY[riPRL].CheckAllStat(csNone)) return DM.ARAY[riPRL].GetLotNo() ; * else if(!DM.ARAY[riLDR].CheckAllStat(csNone)) return DM.ARAY[riLDR].GetLotNo() ; * else if(!DM.ARAY[riPSL].CheckAllStat(csNone)) return DM.ARAY[riPSL].GetLotNo() ; * else if(!DM.ARAY[riPRU].CheckAllStat(csNone)) return DM.ARAY[riPRU].GetLotNo() ; * else if(!DM.ARAY[riULD].CheckAllStat(csNone)) return DM.ARAY[riULD].GetLotNo() ; * else if(!DM.ARAY[riPSU].CheckAllStat(csNone)) return DM.ARAY[riPSU].GetLotNo() ; * else if(!DM.ARAY[riRJ1].CheckAllStat(csNone)) return DM.ARAY[riRJ1].GetLotNo() ; * else if(!DM.ARAY[riRJ2].CheckAllStat(csNone)) return DM.ARAY[riRJ2].GetLotNo() ; * else if(!DM.ARAY[riRJ3].CheckAllStat(csNone)) return DM.ARAY[riRJ3].GetLotNo() ; * else if(!DM.ARAY[riRJ4].CheckAllStat(csNone)) return DM.ARAY[riRJ4].GetLotNo() ; * * else return ""; */ }
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 btLotEnd_Click(object sender, EventArgs e) { string sText = ((Button)sender).Text; Log.Trace(sFormText + sText + " Button Clicked", ForContext.Frm); LOT.LotEnd(); }
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; }
private void btLotEnd_Click(object sender, EventArgs e) { string sText = ((Button)sender).Text; Log.Trace(sFormText + sText + " Button Clicked", ti.Frm); LOT.LotEnd(); btStart.Enabled = false; }
public static void Close() { MainThread.Abort(); MainThread.Join(); SM.Close(); OM.Close(); LOT.Close(); SPC.Close(); }
private void btLotEnd_Click(object sender, EventArgs e) { if (Log.ShowMessageModal("Confirm", "Do you want to Lot End?") != DialogResult.Yes) { return; } SPC.Close(); LOT.LotEnd(); DM.ARAY[ri.IDX].SetStat(cs.None); }
public static void UpdateSeqState() { bool isInit = MM.GetManNo() == mc.AllHome; bool isError = SML.ER.IsErr(); bool isRunning = m_bRun; bool isRunWarn = m_bRunEnd; bool isStop = !m_bRun && !m_bRunEnd; bool isLotEnd = LOT.GetLotEnd(); //Flicking Timer. if (m_bFlick) { m_tmFlickOn.Clear(); if (m_tmFlickOff.OnDelay(m_bFlick, 500)) { m_bFlick = false; } } else { m_tmFlickOff.Clear(); if (m_tmFlickOn.OnDelay(!m_bFlick, 500)) { m_bFlick = true; } } //Set Sequence State. Tower Lamp if (isInit) { m_iSeqStat = EN_SEQ_STAT.Init; } else if (isLotEnd) { m_iSeqStat = EN_SEQ_STAT.WorkEnd; } else if (isError) { m_iSeqStat = EN_SEQ_STAT.Error; } else if (isRunning) { m_iSeqStat = EN_SEQ_STAT.Running; } else if (isStop) { m_iSeqStat = EN_SEQ_STAT.Stop; } else if (isRunWarn) { m_iSeqStat = EN_SEQ_STAT.RunWarn; Log.ShowMessage("Warning", "Work End"); } else { } }
private void btLotOpen_Click(object sender, EventArgs e) { string sText = ((Button)sender).Text; Log.Trace(sFormText + sText + " Button Clicked", ti.Frm); if (tbLotNo.Text == "") { return; // tbLotId.Text = DateTime.Now.ToString("HHmmss"); } string LotNo = tbLotNo.Text.Trim(); string Device = tbSelDevice.Text.Trim(); LOT.TLot Lot; Lot.sLotNo = tbLotNo.Text.Trim(); LOT.LotOpen(Lot); //Log.Trace("LotOpen", "Try"); //CDelayTimer TimeOut = new CDelayTimer(); //TimeOut.Clear(); //SEQ.Visn.SendLotStart(Lot.sLotNo); //while(!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.LotStart )){ // Thread.Sleep(1); // if(TimeOut.OnDelay(5000)) { // SM.ER_SetErr(ei.VSN_ComErr,"Lot Start TimeOut"); // break; // } //} DM.ARAY[ri.LODR].SetStat(cs.Unknown); DM.ARAY[ri.PLDR].SetStat(cs.None); DM.ARAY[ri.TLDR].SetStat(cs.None); DM.ARAY[ri.TVSN].SetStat(cs.None); DM.ARAY[ri.TMRK].SetStat(cs.None); DM.ARAY[ri.TULD].SetStat(cs.None); DM.ARAY[ri.TRJM].SetStat(cs.None); DM.ARAY[ri.TRJV].SetStat(cs.None); DM.ARAY[ri.PULD].SetStat(cs.None); DM.ARAY[ri.ULDR].SetStat(cs.Empty); DM.ARAY[ri.PICK].SetStat(cs.None); DM.ARAY[ri.PSHR].SetStat(cs.None); // DM.ARAY[ri.BPCK].SetStat(cs.None ); Close(); }
private void btLotEnd_Click(object sender, EventArgs e) { if (Log.ShowMessageModal("Confirm", "Do you want to Clear Lot?") != DialogResult.Yes) { return; } LOT.LotEnd(); 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.None ); 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); btStart.Enabled = false; if (Log.ShowMessageModal("Confirm", "Do you want to make VIT file and Local Report?") != DialogResult.Yes) { return; } LOT.LotEnd(); Log.Trace("SEQ", LOT.GetLotNo() + "LotEnd"); //HZ7290XH98_006_170928_143116P int iRealTrayCnt = OM.DevInfo.iTRAY_StackingCnt; iRealTrayCnt--; //Top CoverTray if (OM.DevOptn.bUseBtmCover) { iRealTrayCnt--; } int iQty = OM.DevInfo.iTRAY_PcktCntX * OM.DevInfo.iTRAY_PcktCntY * iRealTrayCnt; iQty *= OM.EqpStat.iWorkBundle; if (!OM.CmnOptn.bOracleNotWriteVITFile && OM.CmnOptn.sVITFolder != "") { SEQ.Oracle.WriteVIT(OM.CmnOptn.sVITFolder, DateTime.Now.ToString("MM\\/dd\\/yyyy"), OM.CmnOptn.sMachinID, LOT.CrntLotData.sEmployeeID, //20180125 SML.FrmLogOn.GetId() , OM.EqpStat.sLotSttTime, DateTime.Now.ToString("HH:mm:ss"), iQty.ToString()); } }
public static void Update() { double dPreTime = CTimer.GetTime_us(); double dCrntTime; while (true) { dCrntTime = CTimer.GetTime_us(); m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0; if (m_dMainThreadCycleTime > 2) { Log.Trace(m_dMainThreadCycleTime.ToString()); } dPreTime = dCrntTime; Thread.Sleep(1); //Motion Dll Update SM.Update(m_iSeqStat); //Part for (int i = 0; i < (int)pi.MAX_PART; i++) { m_Part[i].Update(); } //Inspection InspectMainAir(); InspectEmergency(); InspectActuator(); InspectMotor(); InspectCrash(); InspectTemp(); InspectLightGrid(); //Update ErrorProc. UpdateButton(); //Check Button. UpdateSeqState(); //Update Motor State (Input) MM.Update(); //SPC SPC.Update(LOT.GetLotNo(), OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint); } }
public static void Close() { MainThread.Abort(); MainThread.Join(); SM.Close(); OM.Close(); LOT.Close(); SPC.Close(); //for (int i = 1; i < (int)si.MAX_RS232; i++) //{ // Com[i].PortClose(); //} //ML.IO_SetY(yi.SSTG_HeaterOn,false); //SEQ.Oracle.CloseDB(); }
public FormMain() { //this.TopMost = true; SEQ.Init(); OM.LoadLastInfo(); //VC.Init(); InitializeComponent(); m_iActivePage = 0; FrmOperation = new FormOperation(pnBase); FrmVision = new FormVision(pnBase); FrmDevice = new FormDevice(this); FrmDeviceSet = new FormDeviceSet(pnBase); FrmSPC = new FormSPC(pnBase); FrmOption = new FormOption(pnBase); FrmMaster = new FormMaster(); FrmDevice.TopLevel = false; FrmDevice.Parent = pnBase; lbDevice.Text = OM.GetCrntDev().ToString(); lbLotNo.Text = LOT.GetLotNo(); lbName.Text = Eqp.sEqpName; //OM.EqpOptn.sModelName; ShowPage(0); //Operation. tmUpdate.Enabled = true; //SM.IO.SetY((int)yi.ETC_MainAirSol, true); //if (SM.CL.GetCmd((int)ai.IDX_Hold1UpDn) == EN_CYLINDER_POS.cpFwd) //{ // SM.CL.Move((int)ai.IDX_Hold1UpDn, EN_CYLINDER_POS.cpFwd); //} //if (SM.CL.GetCmd((int)ai.IDX_Hold2UpDn) != 0) //{ // SM.CL.Move((int)ai.IDX_Hold2UpDn, EN_CYLINDER_POS.cpFwd); //} }
public FormMain() { //this.TopMost = true; SEQ.Init(); OM.LoadLastInfo(); InitializeComponent(); m_iActivePage = 0; FrmOperation = new FormOperation(pnBase); FrmDevice = new FormDevice(this); FrmDeviceSet = new FormDeviceSet(pnBase); FrmSPC = new FormSPC(pnBase); FrmOption = new FormOption(pnBase); FrmMaster = new FormMaster(); FrmVccOption = new FormVccOption(); FrmVer = new FormVer(); FrmVer.TopLevel = true; FrmDevice.TopLevel = false; FrmDevice.Parent = pnBase; lbDevice.Text = OM.GetCrntDev().ToString(); lbLotNo.Text = LOT.GetLotNo(); lbName.Text = Eqp.sEqpName; //파일 버전 보여주는 부분 string sFileVersion = System.Windows.Forms.Application.ProductVersion; lbVer.Text = "Ver " + sFileVersion; ShowPage(0);//Operation. //MainSol //SM.IO.SetY((int)yi.ETC_MainAirSol, true); tmUpdate.Enabled = true; }
private void btLotEnd_Click(object sender, EventArgs e) { string sText = ((Button)sender).Text; Log.Trace(sFormText + sText + " Button Clicked", ti.Frm); LOT.LotEnd(); DM.ARAY[ri.LODR].SetStat(cs.Unknown); DM.ARAY[ri.PLDR].SetStat(cs.None); DM.ARAY[ri.TLDR].SetStat(cs.None); DM.ARAY[ri.TVSN].SetStat(cs.None); DM.ARAY[ri.TMRK].SetStat(cs.None); DM.ARAY[ri.TULD].SetStat(cs.None); DM.ARAY[ri.TRJM].SetStat(cs.None); DM.ARAY[ri.TRJV].SetStat(cs.None); DM.ARAY[ri.PULD].SetStat(cs.None); DM.ARAY[ri.ULDR].SetStat(cs.Empty); DM.ARAY[ri.PICK].SetStat(cs.None); DM.ARAY[ri.PSHR].SetStat(cs.None); btStart.Enabled = false; }
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(); }
public void LoadSaveLotIni(bool _bLoad) { string sPath; sPath = LOT_FOLDER + LOT.GetLotNo() + "\\LotInfo.ini"; if (_bLoad) { CIniFile IniLoadLotInfo = new CIniFile(sPath); IniLoadLotInfo.Load("Data", "sLotId ", out m_tData.sLotId); IniLoadLotInfo.Load("Data", "iWorkCnt ", out m_tData.iWorkCnt); IniLoadLotInfo.Load("Data", "dSttTime ", out m_tData.dSttTime); IniLoadLotInfo.Load("Data", "dEndTime ", out m_tData.dEndTime); IniLoadLotInfo.Load("Data", "dWorkTime ", out m_tData.dWorkTime); IniLoadLotInfo.Load("Data", "dErrTime ", out m_tData.dErrTime); IniLoadLotInfo.Load("Data", "dStopTime ", out m_tData.dStopTime); IniLoadLotInfo.Load("Data", "dTotalTime", out m_tData.dTotalTime); IniLoadLotInfo.Load("Data", "dUPEH ", out m_tData.dUPEH); IniLoadLotInfo.Load("Data", "dUPH ", out m_tData.dUPH); IniLoadLotInfo.Load("Data", "sJobFile ", out m_tData.sJobFile); } else { CIniFile IniSaveLotInfo = new CIniFile(sPath); IniSaveLotInfo.Save("Data", "sLotId ", m_tData.sLotId); IniSaveLotInfo.Save("Data", "iWorkCnt ", m_tData.iWorkCnt); IniSaveLotInfo.Save("Data", "dSttTime ", m_tData.dSttTime); IniSaveLotInfo.Save("Data", "dEndTime ", m_tData.dEndTime); IniSaveLotInfo.Save("Data", "dWorkTime ", m_tData.dWorkTime); IniSaveLotInfo.Save("Data", "dErrTime ", m_tData.dErrTime); IniSaveLotInfo.Save("Data", "dStopTime ", m_tData.dStopTime); IniSaveLotInfo.Save("Data", "dTotalTime", m_tData.dTotalTime); IniSaveLotInfo.Save("Data", "dUPEH ", m_tData.dUPEH); IniSaveLotInfo.Save("Data", "dUPH ", m_tData.dUPH); IniSaveLotInfo.Save("Data", "sJobFile ", m_tData.sJobFile); } }
//private void UpdateLotList() //{ // lvLot.Clear(); // lvLot.View = View.Details; // lvLot.LabelEdit = true; // lvLot.AllowColumnReorder = true; // lvLot.FullRowSelect = true; // lvLot.GridLines = true; // //lvLot.Sorting = SortOrder.Descending; // lvLot.Scrollable = true; // // Type type = typeof(LOT.TLot); // int iCntOfItem = type.GetProperties().Length; // FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); // // //컬럼추가 하고 이름을 넣는다. // lvLot.Columns.Add("No", 30, HorizontalAlignment.Left); // for (int c = 0; c < f.Length; c++) // { // lvLot.Columns.Add(f[c].Name, 90, HorizontalAlignment.Left); // } // // // lvLot.Items.Clear(); // string sValue = ""; // string sName = ""; // //ListViewItem[] liitem = new ListViewItem[LOT.LotList.Count]; // //for (int r = 0; r < LOT.LotList.Count; r++) // //{ // // liitem[r] = new ListViewItem(string.Format("{0}", r)); // // for (int c = 0; c < f.Length; c++) // // { // // sName = f[c].Name; // // sValue = f[c].GetValue(LOT.LotList[r]).ToString(); // // liitem[r].SubItems.Add(sValue); // // } // // liitem[r].UseItemStyleForSubItems = false; // // lvLot.Items.Add(liitem[r]); // //} // //lvLot.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); // //} private void btLotOpen_Click(object sender, EventArgs e) { if (tbLotNo.Text == "") { Log.ShowMessage("Error", "랏넘버가 공백입니다."); return; } string LotNo = tbLotNo.Text.Trim(); string Device = tbSelDevice.Text.Trim(); LOT.TLot Lot; Lot.sEmployeeID = tbEmployeeID.Text.Trim(); Lot.sLotNo = tbLotNo.Text.Trim(); LOT.LotOpen(Lot); Log.Trace("LotOpen", "Try"); Close(); }
private void btLotEnd_Click_2(object sender, EventArgs e) { if (Log.ShowMessageModal("Confirm", "Do you want to LotEnd?") != DialogResult.Yes) { return; } LOT.LotEnd(); DM.ARAY[ri.LODR].SetStat(cs.Unknown); DM.ARAY[ri.PLDR].SetStat(cs.None); DM.ARAY[ri.TLDR].SetStat(cs.None); DM.ARAY[ri.TVSN].SetStat(cs.None); DM.ARAY[ri.TMRK].SetStat(cs.None); DM.ARAY[ri.TULD].SetStat(cs.None); DM.ARAY[ri.TRJM].SetStat(cs.None); DM.ARAY[ri.TRJV].SetStat(cs.None); DM.ARAY[ri.PULD].SetStat(cs.None); DM.ARAY[ri.ULDR].SetStat(cs.Empty); DM.ARAY[ri.PICK].SetStat(cs.None); DM.ARAY[ri.PSHR].SetStat(cs.None); btStart.Enabled = false; }
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 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; } }
// CPartInterface * m_pPart[MAX_PART] ; //-------------------------------------------------------------------------------------------------------- public static void Reset() { //Check running flag. if (m_bRun) { return; } if (m_iSeqStat == EN_SEQ_STAT.Init) { return; } if (m_iStep == EN_SEQ_STEP.ToStopCon) { return; } if (m_iStep == EN_SEQ_STEP.ToStop) { return; } if (MM.GetManNo() != mc.NoneCycle) { return; } LOT.Reset(); Log.Trace("Seq", "Reset"); m_tmToStop.Clear(); m_tmToStrt.Clear(); m_tmFlickOn.Clear(); m_tmFlickOff.Clear(); m_tmTemp.Clear(); m_tmCloseDoor.Clear(); //Init. Var. m_bBtnReset = false; m_bBtnStart = false; m_bBtnStop = false; m_bRunEnd = false; m_bRun = false; m_iStep = EN_SEQ_STEP.Idle; //Error. ML.ER_Clear(); //Manual. MM.Reset(); //ML. for (int i = 0; i < (int)pi.MAX_PART; i++) { m_Part[i].Reset(); } //Cylinder Reset , Need to First Time ML.CL_Reset(); //Lot End Flag Reset. LOT.Reset(); Log.CloseForm(); m_iSeqStat = EN_SEQ_STAT.Stop; //System. ML.MT_ResetAll(); ML.MT_SetServoAll(true); //VSNZ존에서 처리함. //for(int i = 0 ; i < (int)vi.MAX_VI; i++) //{ // if(!OM.VsSkip((vi)i)) VSNZ.VisnComs[i].SendCmd(VisnCom.vc.Reset); //} }
//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(); }
public static void UpdateSeqState() { bool isInit = MM.GetManNo() == mc.AllHome; bool isError = ML.ER_IsErr(); bool isRunning = m_bRun; bool isRunWarn = m_bRunEnd; bool isManual = MM.GetManNo() > mc.AllHome; bool isStop = !m_bRun && !m_bRunEnd; bool isToStart = m_iStep == EN_SEQ_STEP.ToStartCon || m_iStep == EN_SEQ_STEP.ToStart; bool isToStop = m_iStep == EN_SEQ_STEP.ToStopCon || m_iStep == EN_SEQ_STEP.ToStop; bool isLotEnd = LOT.GetLotEnd(); //Flicking Timer. if (m_bFlick) { m_tmFlickOn.Clear(); if (m_tmFlickOff.OnDelay(m_bFlick, 500)) { m_bFlick = false; } } else { m_tmFlickOff.Clear(); if (m_tmFlickOn.OnDelay(!m_bFlick, 500)) { m_bFlick = true; } } //Set Sequence State. Tower Lamp // if (isMaint ) { m_iSeqStat = EN_SEQ_STAT.Maint ;} if (isInit) { m_iSeqStat = EN_SEQ_STAT.Init; } else if (isLotEnd) { m_iSeqStat = EN_SEQ_STAT.WorkEnd; } else if (isError) { m_iSeqStat = EN_SEQ_STAT.Error; } else if (isToStart) { m_iSeqStat = EN_SEQ_STAT.ToStart; } else if (isToStop) { m_iSeqStat = EN_SEQ_STAT.ToStop; } else if (isRunning) { m_iSeqStat = EN_SEQ_STAT.Running; } else if (isManual) { m_iSeqStat = EN_SEQ_STAT.Manual; } else if (isStop) { m_iSeqStat = EN_SEQ_STAT.Stop; } else if (isRunWarn) { m_iSeqStat = EN_SEQ_STAT.RunWarn; Log.ShowMessage("Warning", "Work End"); } else { } //Save Status Log. string sStatText, sSub; if (m_iSeqStat != iPreStat) { for (int i = 0; i < 2; i++) { if (i == 0) { sSub = " STATUS END"; iStat = iPreStat; } else { sSub = " STATUS START"; iStat = m_iSeqStat; } switch (iStat) { default: sStatText = "Program Start"; break; case EN_SEQ_STAT.Init: sStatText = "INIT" + sSub; break; case EN_SEQ_STAT.Warning: sStatText = "WARNING" + sSub; break; case EN_SEQ_STAT.Error: sStatText = "ERROR" + sSub; break; case EN_SEQ_STAT.Running: sStatText = "RUNNING" + sSub; break; case EN_SEQ_STAT.Stop: sStatText = "STOP" + sSub; break; case EN_SEQ_STAT.RunWarn: sStatText = "RUNWARN" + sSub; break; case EN_SEQ_STAT.WorkEnd: sStatText = "LOTEND" + sSub; break; case EN_SEQ_STAT.Manual: sStatText = "MANUAL" + sSub; break; case EN_SEQ_STAT.ToStart: sStatText = "TO START" + sSub; break; case EN_SEQ_STAT.ToStop: sStatText = "TO STOP" + sSub; break; } Log.Trace(sStatText, ForContext.Sts); } iPreStat = m_iSeqStat; } }
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; }
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); }
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 tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; lbMainThreadTime.Text = string.Format("{0:0.000ms}", SEQ._dMainThreadCycleTime); lbDevice.Text = OM.GetCrntDev().ToString(); lbLotNo.Text = LOT.GetLotNo(); btExit.Enabled = !SEQ._bRun; //Set Sequence State. if (!OM.MstOptn.bDebugMode) { switch (SEQ._iSeqStat) { default: break; case EN_SEQ_STAT.Init: lbStat.Text = "INIT"; lbStat.ForeColor = Color.Blue; break; case EN_SEQ_STAT.Error: lbStat.Text = "ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red; break; case EN_SEQ_STAT.Running: lbStat.Text = "RUNNING"; lbStat.ForeColor = Color.Lime; break; case EN_SEQ_STAT.Stop: lbStat.Text = "STOP"; lbStat.ForeColor = Color.Black; break; case EN_SEQ_STAT.WorkEnd: lbStat.Text = "LOTEND"; lbStat.ForeColor = Color.Gray; break; case EN_SEQ_STAT.RunWarn: lbStat.Text = "Run End"; lbStat.ForeColor = Color.Gray; break; } } else { switch (SEQ._iSeqStat) { default: break; case EN_SEQ_STAT.Init: lbStat.Text = "DEBUG INIT"; lbStat.ForeColor = Color.Blue; break; case EN_SEQ_STAT.Error: lbStat.Text = "DEBUG ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red; break; case EN_SEQ_STAT.Running: lbStat.Text = "DEBUG RUNNING"; lbStat.ForeColor = Color.Lime; break; case EN_SEQ_STAT.Stop: lbStat.Text = "DEBUG STOP"; lbStat.ForeColor = Color.Black; break; case EN_SEQ_STAT.WorkEnd: lbStat.Text = "DEBUG LOTEND"; lbStat.ForeColor = Color.Gray; break; } } //접근 레벨 Operator에서 Option/Util 버튼 비활성화 if (FormPassword.GetLevel() == EN_LEVEL.Operator) { //btSpc.Enabled = false; btUtil.Enabled = false; btOption.Enabled = false; } else { //btSpc.Enabled = true; btUtil.Enabled = true; btOption.Enabled = true; } tmUpdate.Enabled = true; }
// CPartInterface * m_pPart[MAX_PART] ; //-------------------------------------------------------------------------------------------------------- public static void Reset() { //Check running flag. if (m_bRun) { return; } if (m_iSeqStat == EN_SEQ_STAT.Init) { return; } if (m_iStep == EN_SEQ_STEP.ToStopCon) { return; } if (m_iStep == EN_SEQ_STEP.ToStop) { return; } if (MM.GetManNo() != mc.NoneCycle) { return; } LOT.Reset(); Log.Trace("Seq", "Reset"); m_tmToStop.Clear(); m_tmToStrt.Clear(); m_tmFlickOn.Clear(); m_tmFlickOff.Clear(); m_tmTemp.Clear(); m_tmCloseDoor.Clear(); //Init. Var. m_bBtnReset = false; m_bBtnStart = false; m_bBtnStop = false; m_bRunEnd = false; m_bRun = false; m_iStep = EN_SEQ_STEP.Idle; //Error. SM.ER_Clear(); //Manual. MM.Reset(); //Part. for (int i = 0; i < (int)pi.MAX_PART; i++) { m_Part[i].Reset(); } //Lot End Flag Reset. LOT.Reset(); //FM_CloseMsgOk(); m_iSeqStat = EN_SEQ_STAT.Stop; //System. //if(!EM_IsErr()) return; //20150801 선계원 홈잡을때 리셑 누르면 홈스텝이 날라가서 처박았음. //SM.MT.ResetAll(); SM.MT_ResetAll(); SM.MT_SetServoAll(true); }
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; } }