Exemple #1
0
        private void btGoClick(object sender, EventArgs e)
        {
            //Button Bt = sender as Button;
            //uint uPstnNo = (uint)Bt.Tag;
            if (!ML.MT_GetStop(m_uMotrId))
            {
                ML.MT_Stop(m_uMotrId);
            }

            int  iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint uPstnNo = (uint)iBtnTag;

            bool bRet = true;

            if (Log.ShowMessageModal("Confirm", "Do you want to Part Move?") != DialogResult.Yes)
            {
                return;
            }
            //if (MessageBox.Show(new Form{TopMost = true},"Part를 이동하시겠습니까?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;

            if (CheckSafe != null)
            {
                if (!CheckSafe((mi)m_uMotrId, (pv)uPstnNo))
                {
                    bRet = false;
                }
            }
            //if(m_uMotrId == (int)mi.IDX_X) bRet = SEQ.IDX.CheckSafe((mi)m_uMotrId, uPstnNo);

            if (!bRet)
            {
                return;
            }
            ML.MT_GoAbsRun(m_uMotrId, PM.GetValue(m_uMotrId, uPstnNo), PM.GetValueSpdPer(m_uMotrId, uPstnNo));
        }
Exemple #2
0
        private void btStop_Click(object sender, EventArgs e)
        {
            string sText = ((Button)sender).Text;

            Log.Trace("FrameMotr Form_" + m_eId.ToString() + " Stop Button Clicked", ti.Frm);
            ML.MT_Stop(m_eId);
        }
Exemple #3
0
 private void btNeg_MouseUp(object sender, MouseEventArgs e)
 {
     if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
     {
         ML.MT_Stop(m_eId);
     }
 }
Exemple #4
0
        public static bool  InspectMotor()
        {
            //Local Var.
            bool isOk = true;

            for (mi i = 0; i < mi.MAX_MOTR; i++)
            {
                if (ML.MT_GetAlarmSgnl(i))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(i)); isOk = false;
                }
                if (ML.MT_GetHomeDone(i))
                {
                    if (ML.MT_GetNLimSnsr(i))
                    {
                        ML.ER_SetErr(ei.MTR_NegLim, ML.MT_GetName(i)); isOk = false;
                    }
                    if (ML.MT_GetPLimSnsr(i))
                    {
                        ML.ER_SetErr(ei.MTR_PosLim, ML.MT_GetName(i)); isOk = false;
                    }
                }
            }

            //스텝모터 체크
            bool bCheck  = false;
            bool bCheck1 = ML.MT_GetStop(mi.OUT_TRelB);
            bool bCheck2 = ML.MT_GetStop(mi.OUT_TRelT);
            bool bCheck3 = ML.MT_GetStop(mi.OUT_YGuid);

            if (!OM.CmnOptn.bRewindMode)
            {
                if (m_tmMotor1.OnDelay(!bCheck1, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_TRelB) + " 과부하 정지"); bCheck = true;
                }
                if (m_tmMotor2.OnDelay(!bCheck2, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_TRelT) + " 과부하 정지"); bCheck = true;
                }
                if (m_tmMotor3.OnDelay(!bCheck3, 10000))
                {
                    ML.ER_SetErr(ei.MTR_Alarm, ML.MT_GetName(mi.OUT_YGuid) + " 과부하 정지"); bCheck = true;
                }
            }

            if (bCheck)
            {
                ML.MT_Stop(mi.OUT_TRelB);
                ML.MT_Stop(mi.OUT_TRelT);
                ML.MT_Stop(mi.OUT_YGuid);
            }

            //Ok.
            return(isOk);
        }
Exemple #5
0
        private void btPos_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            string sText   = ((Button)sender).Text;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;
            //if (m_iId == (int)mi.IDX_X) bRet = SEQ.IDX.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Y) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Z) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);

            if (!bRet)
            {
                return;
            }
            ML.MT_Stop(m_eId);

            sTemp = m_eId.ToString();


            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("FrameMotr Form_" + sTemp + " " + sText + " Button Clicked", ti.Frm);

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }
Exemple #6
0
        private void btPos_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            string sText   = ((Button)sender).Text;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;

            if (!OM.MstOptn.bDebugMode)
            {
                //if (m_eId == mi.PRER_X) bRet = SEQ.PRER.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Pos, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                //if (m_eId == mi.PSTR_X) bRet = SEQ.PSTR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Pos, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                //if (m_eId == mi.LDR_X ) bRet = SEQ.LDR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Pos, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                //if (m_eId == mi.RPCK_Y) bRet = SEQ.PCKR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Pos, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                //if (m_eId == mi.VSTG_X) bRet = SEQ.VSTG.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Pos, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
            }



            if (!bRet)
            {
                return;
            }
            ML.MT_Stop(m_eId);



            sTemp = m_eId.ToString();

            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("FrameMotr Form_" + sTemp + " " + sText + " Button Clicked", ForContext.Frm);

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }
Exemple #7
0
        private void btPos_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            string sText   = ((Button)sender).Text;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;
            if (m_eId == mi.LODR_YIndx)
            {
                bRet = SEQ.LODR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.LODR_XPshr)
            {
                bRet = SEQ.LODR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.TBLE_TTble)
            {
                bRet = SEQ.TTBL.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.LODR_XPckr)
            {
                bRet = SEQ.LODR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.VISN_ZGrpr)
            {
                bRet = SEQ.VISN.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.ULDR_ZPckr)
            {
                bRet = SEQ.ULDR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.ULDR_XGrpr)
            {
                bRet = SEQ.ULDR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.ULDR_YIndx)
            {
                bRet = SEQ.ULDR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.ULDR_ZNzzl)
            {
                bRet = SEQ.ULDR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }
            if (m_eId == mi.ULDR_XNzzl)
            {
                bRet = SEQ.ULDR.CheckSafe((mi)m_eId, (pv)uPstnNo);
            }


            if (!bRet)
            {
                return;
            }
            ML.MT_Stop(m_eId);



            sTemp = m_eId.ToString();

            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("FrameMotr Form_" + sTemp + " " + sText + " Button Clicked", ti.Frm);

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }
Exemple #8
0
        private void btNeg_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            string sText   = ((Button)sender).Text;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;
            if (!OM.MstOptn.bDebugMode)
            {
                if (m_eId == mi.HEAD_XVisn)
                {
                    bRet = SEQ.VSNZ.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.HEAD_YVisn)
                {
                    bRet = SEQ.VSNZ.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.PSTB_XMark)
                {
                    bRet = SEQ.PSTB.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.PSTB_YMark)
                {
                    bRet = SEQ.PSTB.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.HEAD_XCvr1)
                {
                    bRet = SEQ.VSNZ.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.HEAD_XCvr2)
                {
                    bRet = SEQ.VSNZ.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.HEAD_XCvr3)
                {
                    bRet = SEQ.VSNZ.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.LODR_YClmp)
                {
                    bRet = SEQ.LODR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.LODR_ZClmp)
                {
                    bRet = SEQ.LODR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.ULDR_YClmp)
                {
                    bRet = SEQ.ULDR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
                if (m_eId == mi.ULDR_ZClmp)
                {
                    bRet = SEQ.ULDR.JogCheckSafe((mi)m_eId, EN_JOG_DIRECTION.Neg, (EN_UNIT_TYPE)Para.iUnitType, Para.dUnit);
                }
            }



            if (!bRet)
            {
                return;
            }

            ML.MT_Stop(m_eId);

            sTemp = m_eId.ToString();

            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("FrameMotr Form_" + sTemp + " " + sText + " Button Clicked", ti.Frm);

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogN(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncMan(m_eId, -(Para.dUnit));
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncMan(m_eId, -(Para.dUnit));
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        ML.MT_JogN(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        ML.MT_GoIncSlow(m_eId, -(Para.dUnit));
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        ML.MT_GoIncSlow(m_eId, -(Para.dUnit));
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }