All pastes #370843 Raw Edit

Untitled

public text v1 · immutable
#370843 ·published 2007-02-24 22:41 UTC
rendered paste body
Index: configs/stepper-xyza/stepper_xyza.hal
===================================================================
RCS file: /cvs/emc2/configs/stepper-xyza/stepper_xyza.hal,v
retrieving revision 1.7
diff -u -r1.7 stepper_xyza.hal
--- configs/stepper-xyza/stepper_xyza.hal	28 Jan 2007 22:37:27 -0000	1.7
+++ configs/stepper-xyza/stepper_xyza.hal	24 Feb 2007 22:39:11 -0000
@@ -4,7 +4,7 @@
 # kinematics
 loadrt trivkins
 # motion controller, get name and thread periods from ini file
-loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY
+loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY max_joints=[TRAJ]AXES
 # stepper module
 loadrt stepgen step_type=0,0,0,0
 
Index: src/emc/motion/motion.c
===================================================================
RCS file: /cvs/emc2/src/emc/motion/motion.c,v
retrieving revision 1.91
diff -u -r1.91 motion.c
--- src/emc/motion/motion.c	18 Feb 2007 04:54:58 -0000	1.91
+++ src/emc/motion/motion.c	24 Feb 2007 22:39:14 -0000
@@ -64,6 +64,8 @@
 RTAPI_MP_LONG(servo_period_nsec, "servo thread period (nsecs)");
 static long traj_period_nsec = 0;	/* trajectory planner period */
 RTAPI_MP_LONG(traj_period_nsec, "trajectory planner period (nsecs)");
+static int max_joints = EMCMOT_MAX_AXIS;	/* default number of joints present */
+RTAPI_MP_INT(max_joints, "number of available joints");
 #endif
 
 /***********************************************************************
@@ -487,8 +489,9 @@
     for (n = 0; n < EMCMOT_MAX_AXIS; n++) {
 	/* point to axis data */
 	axis_data = &(emcmot_hal_data->axis[n]);
-	/* export all vars */
-	retval = export_axis(n, axis_data);
+	/* export all vars, but only for the requested joints */
+	if (n < max_joints)
+	    retval = export_axis(n, axis_data);
 	if (retval != 0) {
 	    rtapi_print_msg(RTAPI_MSG_ERR,
 		"MOTION: axis %d pin/param export failed\n", n);