Ejemplo n.º 1
0
        /// <summary>
        /// 一次获取轴的多个运动IO状态
        /// </summary>
        /// <param name="axisIndex">从0开始</param>
        /// <returns></returns>
        public int GetMotionStatus(int axis, out bool[] ret)
        {
            _CheckAxisEnable(axis, "GetMotionStatus");
            ret = new bool[9];
            HTM.AXIS_STATUS axs;
            int             opt = HTM.GetAxisStatus(axis, out axs);

            if (opt != 0)
            {
                throw new Exception("MC_Htm.GetMotionStatus failed:HTM.GetAxisStatus return error code = " + opt.ToString());
            }
            //通过背景线程获取
            ret[MSID_ALM] = axs.alm == 1;
            ret[MSID_SVO] = axs.svon == 1;
            ret[MSID_INP] = axs.inp == 1;
            //ret[MSID_EMG] = axs.alm == 1;
            ret[MSID_PL]  = axs.pel == 1;
            ret[MSID_NL]  = axs.mel == 1;
            ret[MSID_ORG] = axs.org == 1;
            //实时获取
            ret[MSID_SPL] = HTM.GetMotionIO(axis, HTM.MotionIO.SPEL) == 1;
            ret[MSID_SNL] = HTM.GetMotionIO(axis, HTM.MotionIO.SMEL) == 1;
            ret[MSID_MDN] = HTM.OnceDone(axis) == 1;

            return((int)ErrorDef.Success);
        }
Ejemplo n.º 2
0
 public bool IsMDN(int axis)
 {
     _CheckAxisEnable(axis, "IsMDN");
     return(HTM.OnceDone(axis) == 1);
 }