Esempio n. 1
0
        public bool CycleMove()
        {
            String sTemp;

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

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



            PreStep.iCycle = Step.iCycle;

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

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

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

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

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

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

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


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

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

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

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

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

                Step.iCycle = 0;
                return(true);
            }
        }
Esempio n. 2
0
 static public bool         MT_CmprPos(mi _eMotrNo, pv _ePos, double _dRange = 0.0)
 {
     return(SML.MT.CmprPos((int)_eMotrNo, PM.GetValue((uint)_eMotrNo, (uint)_ePos), _dRange));
 }
Esempio n. 3
0
 static public double       PM_GetValue(mi _eMotrNo, pv _iPstnValue)
 {
     return(PM.GetValue((uint)_eMotrNo, (uint)_iPstnValue));
 }
Esempio n. 4
0
 static public void         MT_GoAbsSlow(mi _eMotrNo, pv _ePos)
 {
     SML.MT.GoAbsSlow((int)_eMotrNo, PM.GetValue((uint)_eMotrNo, (uint)_ePos));
 }
Esempio n. 5
0
 static public void         MT_SetPos(mi _eMotrNo, pv _ePos)
 {
     SML.MT.SetPos((int)_eMotrNo, PM.GetValue((uint)_eMotrNo, (uint)_ePos));
 }
Esempio n. 6
0
        //폼 가져다 붙이는 함수
        public void SetWindow(int _Idx, Control _wcParent)
        {
            m_eId           = (mi)_Idx;
            lbAxisNo.Text   = "Axis " + _Idx.ToString();
            lbAxisName.Text = "[" + _Idx + "] " + ML.MT_GetName((mi)_Idx);
            PM.SetWindow(pnMotr0, _Idx);
            //ML.PM_SetGetCmdPos(m_eId);

            //switch(_iPageIdx)
            //{
            //    case 0: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 1: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 2: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 3: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 4: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 5: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 6: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 7: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 8: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 9: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;
            //}

            this.Parent = _wcParent;
            //tmUpdate.Enabled = true;
        }
Esempio n. 7
0
        //폼 가져다 붙이는 함수
        public void SetWindow(int _Idx, Control _wcParent)
        {
            m_eId           = (mi)_Idx;
            lbAxisNo.Text   = "Axis " + _Idx.ToString();
            lbAxisName.Text = "[" + _Idx + "] " + ML.MT_GetName(_Idx);
            //PM.SetWindow(pnMotr0, _Idx);
            //ML.PM_SetGetCmdPos(m_eId);

            //switch(_iPageIdx)
            //{
            //    case 0: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 1: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 2: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 3: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 4: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 5: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 6: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 7: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 8: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;

            //    case 9: m_eId = (mi)_iPageIdx;
            //            lbAxisNo.Text = "Axis " + _iPageIdx.ToString();
            //            lbAxisName.Text = "[" + _iPageIdx + "] " + ML.MT_GetName((mi)_iPageIdx);
            //            PM.SetWindow(pnMotr0, _iPageIdx); break;
            //}


            this.Parent = _wcParent;
            this.Dock   = DockStyle.Fill;

            //Scable Setting
            int _iWidth  = _wcParent.Width;
            int _iHeight = _wcParent.Height;

            const int iWidth  = 977;                       //1280;
            const int iHeight = 230;                       //863;

            float widthRatio  = _iWidth / (float)iWidth;   // this.ClientSize.Width;//1280f;
            float heightRatio = _iHeight / (float)iHeight; //.ClientSize.Height; //863f ;

            SizeF scale = new SizeF(widthRatio, heightRatio);

            //this.Scale(scale);

            foreach (Control control in this.Controls)
            {
                control.Scale(scale);
                //control.Font = new Font("Verdana", control.Font.SizeInPoints * heightRatio * widthRatio);
            }

            //this.Invalidate();
            //bSetWindow = true;
            PM.SetWindow(pnMotr0, _Idx);
            //tmUpdate.Enabled = true;
        }
Esempio n. 8
0
        private void btDownload_Click(object sender, EventArgs e)             //HRM-930B 참고
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ti.Frm);

            if (tbFromName.Text == "")
            {
                return;
            }

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

            if (LOT.GetLotOpen())
            {
                Log.ShowMessage("Error", "자재나 메거진이 남아 있으면 잡파일을 바꿀수 없습니다.");
                //Log.ShowMessage("Error", "Cannot change the working files.");
                return;
            }

            //if(OM.DevInfo.sMrkData != "")SEQ.Com[0].SendMsg(OM.DevInfo.sMrkData);
            if (lvDevice.SelectedIndices.Count <= 0)
            {
                return;
            }
            int iDeviceSel = lvDevice.SelectedIndices[0];

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

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

            SaveDeviceLog(0, OM.GetCrntDev(), sName);
            //FrmMain.FrmDeviceSet.
            OM.LoadJobFile(sName); pbStatus.Minimum = 0;
            //SEQ.Visn.SendJobChange(sName); pbStatus.Minimum = 30;
            PM.Load(sName); pbStatus.Value = 70;
            CConfig Config = new CConfig();

            //string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            //string sDevOptnPath = sExeFolder + "JobFile\\" + sName + "\\TrayMask.ini";
            //Config.Load(sDevOptnPath, CConfig.EN_CONFIG_FILE_TYPE.ftIni);
            //DM.ARAY[ri.MASK].Load(Config, true);

            pbStatus.Value = 100;

            CDelayTimer TimeOut = new CDelayTimer();

            TimeOut.Clear();
            //while (!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.JobChange))
            //{
            //    Thread.Sleep(1);
            //    if (TimeOut.OnDelay(5000))
            //    {
            //        ML.ER_SetErr(ei.VSN_ComErr, "JobFile Change TimeOut");
            //        break;
            //    }
            //}

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

            PM.UpdatePstn(true);


            //OM.TrayMask.SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            //OM.TrayMask.SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            //OM.SaveTrayMask();

            //SEQ.VisnRB.SendJobChange(sName);
            //CDelayTimer TimeOut = new CDelayTimer();
            //TimeOut.Clear();
            //while(!SEQ.VisnRB.GetSendCycleEnd(VisnCom.vs.JobChange  )){
            //    Thread.Sleep(1);
            //    if(TimeOut.OnDelay(5000)) {
            //        SM.ER_SetErr(ei.VSN_ComErr,"잡체인지 비전 통신 타임아웃");
            //        break;
            //    }
            //}
        }
Esempio n. 9
0
        public void PstnDisp()
        {
            //HEAD_XVisn
            PM.SetProp((uint)mi.HEAD_XVisn, (uint)pv.HEAD_XVisnWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.HEAD_XVisn, (uint)pv.HEAD_XVisnWorkStart, "WorkStart ", false, false, false);
            PM.SetProp((uint)mi.HEAD_XVisn, (uint)pv.HEAD_XVisnRWorkStart, "RWorkStart", false, false, false);
            //PM.SetProp((uint)mi.HEAD_XVisn   , (uint)pv.HEAD_XVisnLWorkEnd   , "LWorkEnd  ", false, false, false  );
            //HEAD_YVisn
            PM.SetProp((uint)mi.HEAD_YVisn, (uint)pv.HEAD_YVisnWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.HEAD_YVisn, (uint)pv.HEAD_YVisnWorkStart, "WorkStart ", false, false, false);
            //PSTB_XMark
            PM.SetProp((uint)mi.PSTB_XMark, (uint)pv.PSTB_XMarkWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.PSTB_XMark, (uint)pv.PSTB_XMarkWorkStart, "WorkStart ", false, false, false);
            PM.SetProp((uint)mi.PSTB_XMark, (uint)pv.PSTB_XReplace, "Replace   ", false, false, false);
            //PSTB_YMark
            PM.SetProp((uint)mi.PSTB_YMark, (uint)pv.PSTB_YMarkWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.PSTB_YMark, (uint)pv.PSTB_YMarkWorkStart, "WorkStart ", false, false, false);
            PM.SetProp((uint)mi.PSTB_YMark, (uint)pv.PSTB_YReplace, "Replace   ", false, false, false);
            //HEAD_XCvr1
            PM.SetProp((uint)mi.HEAD_XCvr1, (uint)pv.HEAD_XCvr1Wait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.HEAD_XCvr1, (uint)pv.HEAD_XCvr1Work, "Work      ", false, false, false);
            //HEAD_XCvr2
            PM.SetProp((uint)mi.HEAD_XCvr2, (uint)pv.HEAD_XCvr2Wait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.HEAD_XCvr2, (uint)pv.HEAD_XCvr2Work, "Work      ", false, false, false);
            //HEAD_XCvr3
            PM.SetProp((uint)mi.HEAD_XCvr3, (uint)pv.HEAD_XCvr3Wait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.HEAD_XCvr3, (uint)pv.HEAD_XCvr3Work, "Work      ", false, false, false);
            //LODR_YClmp
            PM.SetProp((uint)mi.LODR_YClmp, (uint)pv.LODR_YClmpWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.LODR_YClmp, (uint)pv.LODR_YClmpWork, "Work      ", false, false, false);
            PM.SetProp((uint)mi.LODR_YClmp, (uint)pv.LODR_YClmpPick, "Pick      ", false, false, false);
            PM.SetProp((uint)mi.LODR_YClmp, (uint)pv.LODR_YClmpPlace, "Place     ", false, false, false);
            //LODR_ZClmp
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpPickFwd, "PickFwd   ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpClampOn, "ClampOn   ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpPickBwd, "PickBwd   ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpWorkStart, "WorkStart ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpPlaceFwd, "PlaceFwd  ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpClampOff, "ClampOff  ", false, false, false);
            PM.SetProp((uint)mi.LODR_ZClmp, (uint)pv.LODR_ZClmpPlaceBwd, "PlaceBwd  ", false, false, false);
            //ULDR_YClmp
            PM.SetProp((uint)mi.ULDR_YClmp, (uint)pv.ULDR_YClmpWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.ULDR_YClmp, (uint)pv.ULDR_YClmpWork, "Work      ", false, false, false);
            PM.SetProp((uint)mi.ULDR_YClmp, (uint)pv.ULDR_YClmpPick, "Pick      ", false, false, false);
            PM.SetProp((uint)mi.ULDR_YClmp, (uint)pv.ULDR_YClmpPlace, "Place     ", false, false, false);
            //ULDR_ZClmp
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpWait, "Wait      ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpPickFwd, "PickFwd   ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpClampOn, "ClampOn   ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpPickBwd, "PickBwd   ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpWorkStart, "WorkStart ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpPlaceFwd, "PlaceFwd  ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpClampOff, "ClampOff  ", false, false, false);
            PM.SetProp((uint)mi.ULDR_ZClmp, (uint)pv.ULDR_ZClmpPlaceBwd, "PlaceBwd  ", false, false, false);


            PM.SetCheckSafe((uint)mi.HEAD_XVisn, SEQ.VSNZ.CheckSafe);
            PM.SetCheckSafe((uint)mi.HEAD_YVisn, SEQ.VSNZ.CheckSafe);
            PM.SetCheckSafe((uint)mi.PSTB_XMark, SEQ.PSTB.CheckSafe);
            PM.SetCheckSafe((uint)mi.PSTB_YMark, SEQ.PSTB.CheckSafe);
            PM.SetCheckSafe((uint)mi.HEAD_XCvr1, SEQ.VSNZ.CheckSafe);
            PM.SetCheckSafe((uint)mi.HEAD_XCvr2, SEQ.VSNZ.CheckSafe);
            PM.SetCheckSafe((uint)mi.HEAD_XCvr3, SEQ.VSNZ.CheckSafe);
            PM.SetCheckSafe((uint)mi.LODR_YClmp, SEQ.LODR.CheckSafe);
            PM.SetCheckSafe((uint)mi.LODR_ZClmp, SEQ.LODR.CheckSafe);
            PM.SetCheckSafe((uint)mi.ULDR_YClmp, SEQ.ULDR.CheckSafe);
            PM.SetCheckSafe((uint)mi.ULDR_ZClmp, SEQ.ULDR.CheckSafe);
        }
Esempio n. 10
0
        public static void Init()
        {
            SML.TPara Para;
            Para.sParaFolderPath = Directory.GetCurrentDirectory() + "\\Util\\";
            Para.iWidth          = 1280;
            Para.iHeight         = 863;
            Para.bTabHides       = new bool[6];

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

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


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


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

            Visn.Init(ref VisnPara);

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

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

            m_cyTrayWorktime = new CCycleTimer();

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

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

            //Run End Buzzer.
            m_bRunEnd = false;

            m_Part[(int)pi.LODR] = LODR;
            m_Part[(int)pi.IDXR] = IDXR;
            m_Part[(int)pi.IDXF] = IDXF;
            m_Part[(int)pi.TOOL] = TOOL;
            m_Part[(int)pi.STCK] = STCK;
            m_Part[(int)pi.BARZ] = BARZ;

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

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

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

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

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

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

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

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

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

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

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

            PM.UpdatePstn(true);

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


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



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

            //            DM.ARAY[(int)ri.SLD].SetStat(cs.None);
            DM.LoadMap();
        }
Esempio n. 12
0
        public bool CycleHome()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iHome != 0 && Step.iHome == PreStep.iHome && CheckStop() /*&&!OM.MstOptn.bDebugMode*/, 30000))
            {
                sTemp = string.Format("Home Step.iHome={0:00}", Step.iHome);
                sTemp = m_sPartName + sTemp;
                ER_SetErr(ei.ETC_AllHomeTO, sTemp);
                Log.Trace(m_sPartName, sTemp);
                //Step.iHome = 0 ;
                return(true);
            }

            if (Step.iHome != PreStep.iHome)
            {
                sTemp = string.Format("Home Step.iHome={0:00}", Step.iHome);
                sTemp = m_sPartName + sTemp;
                Log.Trace(m_sPartName, sTemp);
            }

            PreStep.iHome = Step.iHome;

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

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

            case 10:
                CL_Move(ci.IDXF_ClampClOp, fb.Bwd);

                Step.iHome++;
                return(false);

            case 11:
                if (!CL_Complete(ci.IDXF_ClampClOp, fb.Bwd))
                {
                    return(false);
                }
                CL_Move(ci.IDXF_ClampUpDn, fb.Bwd);

                Step.iHome++;
                return(false);

            case 12:
                if (!CL_Complete(ci.IDXF_ClampUpDn, fb.Bwd))
                {
                    return(false);
                }
                MT_GoHome(mi.IDXF_XFrnt);

                Step.iHome++;
                return(false);

            case 13:
                if (!MT_GetHomeDone(mi.IDXF_XFrnt))
                {
                    return(false);
                }
                if (DM.ARAY[ri.IDXF].CheckAllStat(cs.None))    //자제 없으면 웨이트로 감.
                {
                    Step.iHome = 50;
                    return(false);
                }
                Step.iHome++;
                return(false);

            case 14:
                MT_GoAbsSlow(mi.IDXF_XFrnt, OM.EqpStat.dLastIDXFPos);
                Step.iHome++;
                return(false);

            case 15:
                if (!MT_GetStop(mi.IDXF_XFrnt))
                {
                    return(false);
                }

                CL_Move(ci.IDXF_ClampUpDn, fb.Fwd);
                Step.iHome++;
                return(false);

            case 16:
                if (!CL_Complete(ci.IDXF_ClampUpDn, fb.Fwd))
                {
                    return(false);
                }
                CL_Move(ci.IDXF_ClampClOp, fb.Fwd);
                Step.iHome++;
                return(false);

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

                Step.iHome = 0;
                return(true);

            //위에서 씀.
            case 50:
                MT_GoAbsRun(mi.IDXF_XFrnt, PM.GetValue(mi.IDXF_XFrnt, pv.IDXF_XFrntWait));
                Step.iHome++;
                return(false);

            case 51:
                if (!MT_GetStopInpos(mi.IDXF_XFrnt))
                {
                    return(false);
                }
                Step.iHome = 0;
                return(true);
            }
        }
Esempio n. 13
0
 static public void         PM_SetGetCmdPos(mi _eMotrNo)
 {
     PM.SetGetCmdPos((uint)_eMotrNo, SML.MT.GetCmdPos);
 }
Esempio n. 14
0
        private void btDownload_Click(object sender, EventArgs e)             //HRM-930B 참고
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ti.Frm);

            if (tbFromName.Text == "")
            {
                return;
            }

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

            if (LOT.GetLotOpen())
            {
                //Log.ShowMessage("Error", "자재나 메거진이 남아 있으면 잡파일을 바꿀수 없습니다.");
                Log.ShowMessage("Error", "Please check the status of the Lot(Need to Lot End).");
                return;
            }

            //if(OM.DevInfo.sMrkData != "")SEQ.Com[0].SendMsg(OM.DevInfo.sMrkData);
            if (lvDevice.SelectedIndices.Count <= 0)
            {
                return;
            }
            int iDeviceSel = lvDevice.SelectedIndices[0];

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

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

            SaveDeviceLog(0, OM.GetCrntDev(), sName);
            //FrmMain.FrmDeviceSet.
            OM.LoadJobFile(sName); pbStatus.Minimum = 0;
            //SEQ.Visn.SendJobChange(sName); pbStatus.Minimum = 30;
            PM.Load(sName); pbStatus.Value = 70;
            CConfig Config = new CConfig();

            //string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            //string sDevOptnPath = sExeFolder + "JobFile\\" + sName + "\\TrayMask.ini";
            //Config.Load(sDevOptnPath, CConfig.EN_CONFIG_FILE_TYPE.ftIni);

            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);
            }

            pbStatus.Value = 100;

            CDelayTimer TimeOut = new CDelayTimer();

            TimeOut.Clear();
            //while (!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.JobChange))
            //{
            //    Thread.Sleep(1);
            //    if (TimeOut.OnDelay(5000))
            //    {
            //        ML.ER_SetErr(ei.VSN_ComErr, "JobFile Change TimeOut");
            //        break;
            //    }
            //}

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

            PM.UpdatePstn(true);

            //Loader.
            DM.ARAY[ri.LODR].SetMaxColRow(1, OM.DevInfo.iMgzSlotCnt);

            //Prebuffer
            DM.ARAY[ri.PREB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision1
            DM.ARAY[ri.VSN1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision2
            DM.ARAY[ri.VSN2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision3
            DM.ARAY[ri.VSN3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //PostBuffer
            DM.ARAY[ri.PSTB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Unloader
            DM.ARAY[ri.ULDR].SetMaxColRow(1, OM.DevInfo.iMgzSlotCnt);

            SEQ.VSNZ.JobChange();
            //SEQ.VisnRB.SendJobChange(sName);

            //CDelayTimer TimeOut = new CDelayTimer();
            //TimeOut.Clear();
            //while(!SEQ.VisnRB.GetSendCycleEnd(VisnCom.vs.JobChange  )){
            //    Thread.Sleep(1);
            //    if(TimeOut.OnDelay(5000)) {
            //        SM.ER_SetErr(ei.VSN_ComErr,"잡체인지 비전 통신 타임아웃");
            //        break;
            //    }
            //}

            //프로그램 강제 종료할때 셋팅 안되서 강제 종료 후 다시 켰을때 종료 이전에 다운로드한 디바이스로
            //다시 로딩되서 집어 넣음. 진섭
            OM.SaveLastInfo();
        }
Esempio n. 15
0
        public bool CycleHome()
        {
            String sTemp;

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

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

            PreStep.iHome = Step.iHome;

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

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

            case 10:
                CL_Move(ci.LODR_GuideOpCl, fb.Bwd);
                Step.iHome++;
                return(false);

            case 11:
                if (!CL_Complete(ci.LODR_GuideOpCl, fb.Bwd))
                {
                    return(false);
                }
                CL_Move(ci.LODR_RngJigFwBw, fb.Bwd);
                CL_Move(ci.LODR_PckrFwBw, fb.Bwd);
                Step.iHome++;
                return(false);

            case 12:
                if (!CL_Complete(ci.LODR_RngJigFwBw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.LODR_PckrFwBw, fb.Bwd))
                {
                    return(false);
                }
                CL_Move(ci.LODR_PckrRtrCwCCw, fb.Bwd);
                CL_Move(ci.LODR_GrpRtrCwCCw, fb.Bwd);
                //CL_Move(ci.LODR_PshrRtrCwCCw, fb.Fwd);
                CL_Move(ci.LODR_RngGrpFwBw, fb.Bwd);
                Step.iHome++;
                return(false);

            case 13:
                if (!CL_Complete(ci.LODR_PckrRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                if (!CL_Complete(ci.LODR_GrpRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                //if (!CL_Complete(ci.LODR_PshrRtrCwCCw, fb.Bwd)) return false;
                if (!CL_Complete(ci.LODR_RngGrpFwBw, fb.Bwd))
                {
                    return(false);
                }
                MT_GoHome(mi.LODR_XPshr);

                Step.iHome++;
                return(false);

            case 14:
                if (!MT_GetHomeDone(mi.LODR_XPshr))
                {
                    return(false);
                }
                MT_GoAbsRun(mi.LODR_XPshr, PM.GetValue(mi.LODR_XPshr, pv.LODR_XPshrWait));
                MT_GoHome(mi.LODR_XPckr);
                MT_GoHome(mi.LODR_YIndx);
                Step.iHome++;
                return(false);

            case 15:
                if (!MT_GetStopInpos(mi.LODR_XPshr))
                {
                    return(false);
                }
                if (!MT_GetHomeDone(mi.LODR_XPckr))
                {
                    return(false);
                }
                if (!MT_GetHomeDone(mi.LODR_YIndx))
                {
                    return(false);
                }
                MT_GoAbsRun(mi.LODR_XPckr, PM.GetValue(mi.LODR_XPckr, pv.LODR_XPckrWait));
                MT_GoAbsRun(mi.LODR_YIndx, PM.GetValue(mi.LODR_YIndx, pv.LODR_YIndxWait));
                Step.iHome++;
                return(false);

            case 16:
                if (!MT_GetStopInpos(mi.LODR_XPckr))
                {
                    return(false);
                }
                if (!MT_GetStopInpos(mi.LODR_YIndx))
                {
                    return(false);
                }
                Step.iHome = 0;
                return(true);
            }
        }
Esempio n. 16
0
        public FormDeviceSet(Panel _pnBase)
        {
            InitializeComponent();
            this.Width  = 1272;
            this.Height = 866;

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

            tbUserUnit.Text = 0.01.ToString();
            PstnDisp();

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

            PM.UpdatePstn(true);
            UpdateDevInfo(true);

            //모터 축 수에 맞춰 FrameMotr 생성
            FraMotr = new FraMotr[(int)mi.MAX_MOTR];
            for (int m = 0; m < (int)mi.MAX_MOTR; m++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrJog" + m.ToString(), true);

                MOTION_DIR eDir = ML.MT_GetDirType((mi)m);
                FraMotr[m] = new FraMotr();
                FraMotr[m].SetIdType((mi)m, eDir);
                FraMotr[m].TopLevel = false;
                FraMotr[m].Parent   = Ctrl[0];
                FraMotr[m].Show();
                FraMotr[m].SetUnit(EN_UNIT_TYPE.utJog, 0);
            }

            FraCylAPT = new FrameCylinderAPT[(int)ci.MAX_ACTR];
            for (int i = 0; i < (int)ci.MAX_ACTR; i++)
            {
                Control[] CtrlAP = tcDeviceSet.Controls.Find("C" + i.ToString(), true);

                //int iCylCtrl = Convert.ToInt32(CtrlAP[0].Tag);
                int iCylCtrl = Convert.ToInt32(i);
                FraCylAPT[i]          = new FrameCylinderAPT();
                FraCylAPT[i].TopLevel = false;
                FraCylAPT[i].SetConfig((ci)iCylCtrl, ML.CL_GetName(iCylCtrl).ToString(), ML.CL_GetDirType((ci)iCylCtrl), CtrlAP[0]);
                FraCylAPT[i].Show();
            }

            //모터 포지션 AP텍꺼
            FraMotrPosAPT = new FrameMotrPosAPT[(int)mi.MAX_MOTR];
            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrPos" + i.ToString(), true);

                FraMotrPosAPT[i]          = new FrameMotrPosAPT();
                FraMotrPosAPT[i].TopLevel = false;
                FraMotrPosAPT[i].SetWindow(i, Ctrl[0]);
                FraMotrPosAPT[i].Show();
            }

            //Input Status 생성 AP텍꺼
            const int iInputBtnCnt = 17;

            FraInputAPT = new FrameInputAPT[iInputBtnCnt];
            for (int i = 0; i < iInputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("X" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraInputAPT[i]          = new FrameInputAPT();
                FraInputAPT[i].TopLevel = false;
                FraInputAPT[i].SetConfig((xi)iIOCtrl, ML.IO_GetXName((xi)iIOCtrl), Ctrl[0]);
                FraInputAPT[i].Show();
            }

            //Output Status 생성 AP텍꺼
            const int iOutputBtnCnt = 8;

            FraOutputAPT = new FrameOutputAPT[iOutputBtnCnt];
            for (int i = 0; i < iOutputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("Y" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraOutputAPT[i]          = new FrameOutputAPT();
                FraOutputAPT[i].TopLevel = false;
                FraOutputAPT[i].SetConfig((yi)iIOCtrl, ML.IO_GetYName((yi)iIOCtrl), Ctrl[0]);
                FraOutputAPT[i].Show();

                // FraOutputAPT[i].Show();
            }
        }
Esempio n. 17
0
        public bool CycleWork()
        {
            String sTemp;

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

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

            PreStep.iCycle = Step.iCycle;

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

            int r, c = -1;

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

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

                Step.iCycle++;
                return(false);

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

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

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

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

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

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

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

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

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

            case 20:
                if (!CL_Complete(ci.LODR_PckrRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                DM.ShiftData(ri.PLDR, ri.TLDR);
                Step.iCycle = 0;
                return(true);
            }
        }
Esempio n. 18
0
        //CPstnMan PstnCnt;

        public FormDeviceSet(Panel _pnBase)
        {
            InitializeComponent();

            InitNodePosView(pnLvBase);

            this.Width  = 1272;
            this.Height = 866;

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

            tbUserUnit.Text = 0.01.ToString();
            PstnDisp();



            //모터 축에 대한 포지션 디스플레이
            PM.SetWindow(pnMotrPos0, (int)mi.IDX_XCUT);
            PM.SetWindow(pnMotrPos1, (int)mi.IDX_XOUT);
            PM.SetWindow(pnMotrPos2, (int)mi.IDX_TTRN);


            PM.SetGetCmdPos((int)mi.IDX_XCUT, SML.MT.GetCmdPos);
            PM.SetGetCmdPos((int)mi.IDX_XOUT, SML.MT.GetCmdPos);
            PM.SetGetCmdPos((int)mi.IDX_TTRN, SML.MT.GetCmdPos);


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

            PM.UpdatePstn(true);
            UpdateDevInfo(true);
            UpdateDevOptn(true);

            FraMotr     = new FraMotr    [(int)mi.MAX_MOTR];
            FraCylinder = new FraCylOneBt[(int)ci.MAX_ACTR];
            //FraOutput   = new FraOutput  [SM.IO._iMaxOut     ];

            //모터 축 수에 맞춰 FrameMotr 생성

            for (int m = 0; m < (int)mi.MAX_MOTR; m++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrJog" + m.ToString(), true);

                MOTION_DIR eDir = SM.MT_GetDirType((mi)m);
                FraMotr[m] = new FraMotr();
                FraMotr[m].SetIdType((mi)m, eDir);
                FraMotr[m].TopLevel = false;
                FraMotr[m].Parent   = Ctrl[0];
                FraMotr[m].Show();
                FraMotr[m].SetUnit(EN_UNIT_TYPE.utJog, 0);
            }

            //실린더 수에 맞춰 FrameCylinder 생성
            for (int i = 0; i < (int)ci.MAX_ACTR; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnAtcr" + i.ToString(), true);

                FraCylinder[i]          = new FraCylOneBt();
                FraCylinder[i].TopLevel = false;

                switch (i)
                {
                default:                                                                                               break;

                case (int)ci.IDX_Hold1UpDn: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_CutLtFwBw: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_CutRtFwBw: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_TwstLtDnUp: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_TwstRtDnUp: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_Hold2UpDn: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_CutBaseUpDn: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_OutDnUp: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;

                case (int)ci.IDX_CutterDnUp: FraCylinder[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), Ctrl[0]); break;
                }
                FraCylinder[i].Show();
            }

            //Output 버튼 생성
            const int iOutputBtnCnt = 3;

            FraOutput = new FraOutput[iOutputBtnCnt];
            for (int i = 0; i < iOutputBtnCnt; i++)
            {
                FraOutput[i]          = new FraOutput();
                FraOutput[i].TopLevel = false;

                switch (i)
                {
                default: break;
//                    case (int)yi.ySLD_Soldering    : FraOutput[i].SetConfig(yi.ySLD_Soldering    , SM.IO.GetYName((int)yi.ySLD_Soldering    )  , pnIO0); break;
//                    case (int)yi.ySLD_AirCleanOnOff: FraOutput[i].SetConfig(yi.ySLD_AirCleanOnOff, SM.IO.GetYName((int)yi.ySLD_AirCleanOnOff), pnIO1); break;
                }

                FraOutput[i].Show();
            }
            UpdateNodePos(true);

            pbLine.Refresh();
        }
Esempio n. 19
0
        public bool CycleHome()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iHome != 0 && Step.iHome == PreStep.iHome && CheckStop() /*&&!OM.MstOptn.bDebugMode*/, 25000))
            {
                sTemp = string.Format("Home Step.iHome={0:00}", Step.iHome);
                sTemp = m_sPartName + sTemp;
                ER_SetErr(ei.ETC_AllHomeTO, sTemp);
                Trace(sTemp);
                //Step.iHome = 0 ;
                return(true);
            }

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

            PreStep.iHome = Step.iHome;

            if (Stat.bReqStop)
            {
                //Step.iHome = 0;
                //return true ;
            }

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

            case 10:
                iRepeatCnt = 0;
                //CL_Move(ci.VISN_FixRtrCwCCw , fb.Bwd);
                //CL_Move(ci.VISN_GrpRtrCwCCw , fb.Bwd);
                //CL_Move(ci.VISN_TurnGrpFwBw , fb.Bwd);
                //CL_Move(ci.VISN_TurnRtrCwCCw, fb.Bwd);
                Step.iHome++;
                return(false);

            case 11:
                //if (!CL_Complete(ci.VISN_FixRtrCwCCw , fb.Bwd)) return false;
                //if (!CL_Complete(ci.VISN_GrpRtrCwCCw , fb.Bwd)) return false;
                //if (!CL_Complete(ci.VISN_TurnGrpFwBw , fb.Bwd)) return false;
                //if (!CL_Complete(ci.VISN_TurnRtrCwCCw, fb.Bwd)) return false;
                MT_GoHome(mi.VISN_ZGrpr);

                Step.iHome++;
                return(false);

            case 12:
                if (!MT_GetHomeDone(mi.VISN_ZGrpr))
                {
                    return(false);
                }
                MT_GoAbsRun(mi.VISN_ZGrpr, PM.GetValue(mi.VISN_ZGrpr, pv.VISN_ZGrprWait));
                Step.iHome++;
                return(false);

            case 13:
                if (!MT_GetStopInpos(mi.VISN_ZGrpr))
                {
                    return(false);
                }
                MoveCyl(ci.VISN_TurnRtrCwCCw, fb.Bwd);
                Step.iHome++;
                return(false);

            case 14:
                if (!CL_Complete(ci.VISN_TurnRtrCwCCw, fb.Bwd))
                {
                    return(false);
                }
                MoveCyl(ci.VISN_TurnRtrCwCCw, fb.Fwd);
                Step.iHome++;
                return(false);

            case 15:
                if (!CL_Complete(ci.VISN_TurnRtrCwCCw, fb.Fwd))
                {
                    return(false);
                }
                if (iRepeatCnt < 3)
                {
                    iRepeatCnt++;
                    Step.iHome = 13;
                    return(false);
                }
                Step.iHome = 0;
                return(true);
            }
        }
Esempio n. 20
0
 private void FrameMotrPosAPT_Load(object sender, EventArgs e)
 {
     PM.SetWindow(pnMotr0, (int)m_eId);
 }