Exemple #1
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            string sTemp;;

            tmUpdate.Enabled = false;

            lbStat1.ForeColor = ML.MT_GetNLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat2.ForeColor = ML.MT_GetHomeSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat3.ForeColor = ML.MT_GetPLimSnsr(m_eId) ? Color.Red : Color.Silver;
            lbStat4.ForeColor = ML.MT_GetHomeDone(m_eId) ? Color.Red : Color.Silver;
            lbStat5.ForeColor = ML.MT_GetAlarmSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat6.ForeColor = ML.MT_GetStop(m_eId) ? Color.Red : Color.Silver;
            lbStat7.ForeColor = ML.MT_GetInPosSgnl(m_eId) ? Color.Red : Color.Silver;
            lbStat8.ForeColor = ML.MT_GetServo(m_eId) ? Color.Red : Color.Silver;

            sTemp         = string.Format("{0:0.0000}", ML.MT_GetCmdPos(m_eId));
            lbCmdPos.Text = sTemp;

            if (!this.Visible)
            {
                tmUpdate.Enabled = false;
                return;
            }
            tmUpdate.Enabled = true;
        }
Exemple #2
0
        public static bool  InspectMotor()
        {
            //Local Var.
            bool isOk = true;

            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                if (ML.MT_GetAlarmSgnl(i))
                {
                    if (ML.MT_GetServo(i))
                    {
                        ML.MT_SetServo(i, false);
                    }
                    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;
                    }
                }
            }

            //Ok.
            return(isOk);
        }
Exemple #3
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            LbStat1.BackColor = ML.MT_GetNLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat2.BackColor = ML.MT_GetHomeSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat3.BackColor = ML.MT_GetPLimSnsr(m_eId) ? Color.Lime : Color.Silver;
            LbStat4.BackColor = ML.MT_GetAlarmSgnl(m_eId) ? Color.Lime : Color.Silver;
            LbStat5.BackColor = ML.MT_GetServo(m_eId) ? Color.Lime : Color.Silver;
            LbStat6.BackColor = ML.MT_GetStop(m_eId) ? Color.Lime : Color.Silver;
            LbStat7.BackColor = ML.MT_GetHomeDone(m_eId) ? Color.Lime : Color.Silver;

            LbCmdPos.Text = ML.MT_GetCmdPos(m_eId).ToString();
            LbEncPos.Text = ML.MT_GetEncPos(m_eId).ToString();

            if (SEQ._bRun)
            {
                btNeg.Enabled = false;
                btPos.Enabled = false;
            }

            else
            {
                btNeg.Enabled = true;
                btPos.Enabled = true;
            }

            if (!this.Visible)
            {
                tmUpdate.Enabled = false;
                return;
            }
            tmUpdate.Enabled = true;
        }
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);
        }