Exemplo n.º 1
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

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

            LbCmdPos.Text = string.Format("{0:0.0000}", SM.MT_GetCmdPos(m_eId));
            LbEncPos.Text = string.Format("{0:0.0000}", SM.MT_GetEncPos(m_eId));

            if (SEQ._bRun || MM.GetManNo() != mc.NoneCycle)
            {
                btNeg.Enabled = false;
                btPos.Enabled = false;
            }

            else
            {
                btNeg.Enabled = true;
                btPos.Enabled = true;
            }
            tmUpdate.Enabled = true;
        }
Exemplo n.º 2
0
        public static bool  InspectMotor()
        {
            //Local Var.
            bool isOk = true;

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

            //Ok.
            return(isOk);
        }
Exemplo n.º 3
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            string sTemp;;

            tmUpdate.Enabled = false;

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

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

            if (SM.MT_GetHoming(m_eId))
            {
                btHome.ForeColor = SEQ._bFlick ? Color.Lime : Color.Black;
            }
            else
            {
                btHome.ForeColor = Color.Black;
            }
            tmUpdate.Enabled = true;
        }
Exemplo n.º 4
0
        public static bool  InspectHomeDone()
        {
            //Local Var.
            bool isOk = true;

            //Inspect.
            for (mi i = 0; i < mi.MAX_MOTR; i++)
            {
                if (!SM.MT_GetHomeDone(i))
                {
                    SM.ER_SetErr(ei.MTR_HomeEnd, SM.MT_GetName(i)); isOk = false;
                }
            }

            //Ok.
            return(isOk);
        }