Beispiel #1
0
        public int SetSNLimit(int axis, bool enable, double pos)
        {
            _CheckAxisEnable(axis, "SetSNLimit");
            HTM.AXIS_INFO axi;
            int           nRet = HTM.GetAxisInfo(axis, out axi);

            if (nRet != 0)
            {
                throw new Exception("MDD_Htm.SetSNLimit failed: HTM.GetAxisInfo return errorCode = " + nRet);
            }

            if (enable)
            {
                axi.enableSEL = (byte)(axi.enableSEL | 0x01);
                axi.sMELPos   = pos;
            }
            else
            {
                axi.enableSEL = (byte)(axi.enableSEL & 0x02);
            }
            int opt = HTM.SetAxisInfo(axis, ref axi);

            if (0 != opt)
            {
                return((int)ErrorDef.InvokeFailed);
            }
            return((int)ErrorDef.Success);
        }
Beispiel #2
0
        public int SetHomeParam(int axis, JFHomeParam hp)
        {
            _CheckAxisEnable(axis, "SetHomeParam");
            HTM.AXIS_INFO axInfo;
            int           opt = HTM.GetAxisInfo(axis, out axInfo);

            if (opt != 0)
            {
                throw new Exception("SetHomeParam() Failed By: HTM.GetAxisInfo() return errorCode = " + opt);
            }

            axInfo.homeMode  = (sbyte)hp.mode;
            axInfo.homeDir   = (byte)(hp.dir ? 1 : 0);
            axInfo.homeEZA   = (byte)(hp.eza ? 1 : 0);
            axInfo.homeAcc   = hp.acc;
            axInfo.homeVm    = hp.vm;
            axInfo.homeVo    = hp.vo;
            axInfo.homeShift = hp.shift;
            opt = HTM.SetAxisInfo(axis, ref axInfo);
            if (0 != opt)
            {
                return((int)ErrorDef.InvokeFailed);
            }
            return((int)ErrorDef.Success);
        }
Beispiel #3
0
        public int SetPulseFactor(int axis, double plsFactor)
        {
            _CheckAxisEnable(axis, "SetPulseFactor");
            HTM.AXIS_INFO ai;
            int           opt = HTM.GetAxisInfo(axis, out ai);

            if (0 != opt)
            {
                throw new Exception("MDD_Htm.SetPulseFactor failed: HTM.GetAxisInfo return errorCode = " + opt);
            }
            ai.pulseFactor = plsFactor;
            opt            = HTM.SetAxisInfo(axis, ref ai);
            if (0 != opt)
            {
                return((int)ErrorDef.InvokeFailed);
            }
            return((int)ErrorDef.Success);
        }