Example #1
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);
        }
Example #2
0
        //폼 가져다 붙이는 함수
        public void SetWindow(int _iPageIdx, Control _wcParent)
        {
            switch (_iPageIdx)
            {
            case 0: m_eId       = (mi)_iPageIdx;
                lbAxisNo.Text   = "Axis " + _iPageIdx.ToString();
                lbAxisName.Text = "[" + _iPageIdx + "] " + SM.MT_GetName((mi)_iPageIdx);
                PM.SetWindow(pnMotr0, _iPageIdx); break;

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

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

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

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

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

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

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

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

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

            this.Parent      = _wcParent;
            tmUpdate.Enabled = true;
        }
Example #3
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);
        }