Beispiel #1
0
 /// <summary>
 /// 轴回零运动
 /// </summary>
 public static void GCode_axisReturnToZero(MotionParameters mp)
 {
     LTSMC.smc_set_home_pin_logic(_ConnectNo, 0, 0, 0);                                                        //设置轴原点低电平有效
     LTSMC.smc_set_homemode(_ConnectNo, mp.axis, 0, 1, 1, 0);                                                  //设置轴回零模式
     LTSMC.smc_set_home_profile_unit(_ConnectNo, mp.axis, 5000, mp.returnToZeroSpeed, mp.accTime, mp.decTime); //设置X轴起始速度、起始速度、运行速度、加速时间、减速时间
     LTSMC.smc_home_move(_ConnectNo, mp.axis);                                                                 //启动回零
 }
Beispiel #2
0
        /// <summary>
        /// 轴当前位置计数器值
        /// </summary>
        /// <param name="mp"></param>
        /// <returns></returns>
        public static double GCode_axisLocation(MotionParameters mp)
        {
            double location = 0;

            LTSMC.smc_get_position_unit(_ConnectNo, mp.axis, ref location);
            return(location);
        }
Beispiel #3
0
        /// <summary>
        /// 读取回零状态
        /// </summary>
        /// <returns></returns>
        public static ushort GCode_returnToZeroState(MotionParameters mp)
        {
            ushort returnToZeroState = 0;

            LTSMC.smc_get_home_result(_ConnectNo, mp.axis, ref returnToZeroState);

            return(returnToZeroState);
        }
Beispiel #4
0
 /// <summary>
 /// 手动运行
 /// </summary>
 public static void GCode_manualRunning(MotionParameters mp)
 {
     LTSMC.smc_set_profile_unit(_ConnectNo, mp.axis, 0, mp.runningSpeed, mp.accTime, mp.decTime, 0); //设置起始速度、运行速度、停止速度、加速时间、减速时间
     LTSMC.smc_vmove(_ConnectNo, mp.axis, mp.direction);                                             //连续运动
 }
Beispiel #5
0
 /// <summary>
 /// 指定轴停止运动
 /// </summary>
 /// <param name="mp"></param>
 public static void GCode_stop(MotionParameters mp)
 {
     LTSMC.smc_stop(_ConnectNo, mp.axis, 1);          //指定轴停止运动
 }
Beispiel #6
0
 /// <summary>
 /// 定长运动
 /// </summary>
 /// <param name="mp"></param>
 public static void GCode_fixedLength(MotionParameters mp)
 {
     LTSMC.smc_set_profile_unit(_ConnectNo, mp.axis, 0, mp.runningSpeed, mp.accTime, mp.decTime, 0); //设置起始速度、运行速度、停止速度、加速时间、减速时间
     LTSMC.smc_pmove_unit(_ConnectNo, mp.axis, mp.movementDistance, 1);                              //定长运动
 }
Beispiel #7
0
 /// <summary>
 /// 读取轴状态
 /// </summary>
 /// <param name="mp"></param>
 /// <returns></returns>
 public static short GCode_axisState(MotionParameters mp)
 {
     return(LTSMC.smc_check_done(_ConnectNo, mp.axis));
 }