Index: src/emc/motion/control.c
===================================================================
RCS file: /cvs/emc2/src/emc/motion/control.c,v
retrieving revision 1.152
diff -U3 -r1.152 control.c
--- src/emc/motion/control.c	29 Jan 2009 13:14:38 -0000	1.152
+++ src/emc/motion/control.c	29 Jan 2009 22:16:17 -0000
@@ -1768,12 +1768,11 @@
 
     /* output machine info to HAL for scoping, etc */
     *(emcmot_hal_data->motion_enabled) = GET_MOTION_ENABLE_FLAG();
-    emcmot_hal_data->in_position = GET_MOTION_INPOS_FLAG();
-    *(emcmot_hal_data->inpos_output) = emcmot_hal_data->in_position;
-    emcmot_hal_data->coord_mode = GET_MOTION_COORD_FLAG();
-    emcmot_hal_data->teleop_mode = GET_MOTION_TELEOP_FLAG();
-    emcmot_hal_data->coord_error = GET_MOTION_ERROR_FLAG();
-    emcmot_hal_data->on_soft_limit = emcmotStatus->on_soft_limit;
+    *(emcmot_hal_data->in_position) = GET_MOTION_INPOS_FLAG();
+    *(emcmot_hal_data->coord_mode) = GET_MOTION_COORD_FLAG();
+    *(emcmot_hal_data->teleop_mode) = GET_MOTION_TELEOP_FLAG();
+    *(emcmot_hal_data->coord_error) = GET_MOTION_ERROR_FLAG();
+    *(emcmot_hal_data->on_soft_limit) = emcmotStatus->on_soft_limit;
     if(emcmotStatus->spindle.css_factor) {
 	double denom = fabs(emcmotStatus->spindle.xoffset - emcmotStatus->carte_pos_cmd.tran.x);
 	double speed;
@@ -1797,7 +1796,7 @@
     *(emcmot_hal_data->spindle_reverse) = (*emcmot_hal_data->spindle_speed_out < 0) ? 1 : 0;
     *(emcmot_hal_data->spindle_brake) = (emcmotStatus->spindle.brake != 0) ? 1 : 0;
     
-    emcmot_hal_data->program_line = emcmotStatus->id;
+    *(emcmot_hal_data->program_line) = emcmotStatus->id;
     *(emcmot_hal_data->distance_to_go) = emcmotStatus->distance_to_go;
     if(GET_MOTION_COORD_FLAG()) {
         *(emcmot_hal_data->current_vel) = emcmotStatus->current_vel;
Index: src/emc/motion/mot_priv.h
===================================================================
RCS file: /cvs/emc2/src/emc/motion/mot_priv.h,v
retrieving revision 1.77
diff -U3 -r1.77 mot_priv.h
--- src/emc/motion/mot_priv.h	29 Jan 2009 13:14:38 -0000	1.77
+++ src/emc/motion/mot_priv.h	29 Jan 2009 22:16:17 -0000
@@ -87,14 +87,14 @@
     hal_float_t *adaptive_feed;	/* RPI: adaptive feedrate, 0.0 to 1.0 */
     hal_bit_t *feed_hold;	/* RPI: set TRUE to stop motion */
     hal_bit_t *motion_enabled;	/* RPI: motion enable for all joints */
-    hal_bit_t in_position;	/* RPA: all joints are in position */
-    hal_bit_t *inpos_output;	/* WPI: all joints are in position (used to power down steppers for example) */
-    hal_bit_t coord_mode;	/* RPA: TRUE if coord, FALSE if free */
-    hal_bit_t teleop_mode;	/* RPA: TRUE if teleop mode */
-    hal_bit_t coord_error;	/* RPA: TRUE if coord mode error */
-    hal_bit_t on_soft_limit;	/* RPA: TRUE if outside a limit */
+    hal_bit_t *in_position;	/* RPI: all joints are in position */
+//    hal_bit_t *inpos_output;	/* WPI: all joints are in position (used to power down steppers for example) */
+    hal_bit_t *coord_mode;	/* RPA: TRUE if coord, FALSE if free */
+    hal_bit_t *teleop_mode;	/* RPA: TRUE if teleop mode */
+    hal_bit_t *coord_error;	/* RPA: TRUE if coord mode error */
+    hal_bit_t *on_soft_limit;	/* RPA: TRUE if outside a limit */
 
-    hal_s32_t program_line;     /* RPA: program line causing current motion */
+    hal_s32_t *program_line;    /* RPA: program line causing current motion */
     hal_float_t *current_vel;   /* RPI: velocity magnitude in machine units */
     hal_float_t *distance_to_go;/* RPI: distance to go in current move*/
 
Index: src/emc/motion/motion.c
===================================================================
RCS file: /cvs/emc2/src/emc/motion/motion.c,v
retrieving revision 1.125
diff -U3 -r1.125 motion.c
--- src/emc/motion/motion.c	29 Jan 2009 13:14:38 -0000	1.125
+++ src/emc/motion/motion.c	29 Jan 2009 22:16:18 -0000
@@ -298,7 +298,7 @@
     if ((retval = hal_pin_bit_newf(HAL_OUT, &(emcmot_hal_data->spindle_brake), mot_comp_id, "motion.spindle-brake")) != HAL_SUCCESS) goto error;
     if ((retval = hal_pin_float_newf(HAL_OUT, &(emcmot_hal_data->spindle_speed_out), mot_comp_id, "motion.spindle-speed-out")) != HAL_SUCCESS) goto error;
 
-    if ((retval = hal_pin_bit_newf(HAL_OUT, &(emcmot_hal_data->inpos_output), mot_comp_id, "motion.motion-inpos")) != HAL_SUCCESS) goto error;
+//    if ((retval = hal_pin_bit_newf(HAL_OUT, &(emcmot_hal_data->inpos_output), mot_comp_id, "motion.motion-inpos")) != HAL_SUCCESS) goto error;
     if ((retval = hal_pin_float_newf(HAL_IN, &(emcmot_hal_data->spindle_revs), mot_comp_id, "motion.spindle-revs")) != HAL_SUCCESS) goto error;
     if ((retval = hal_pin_float_newf(HAL_IN, &(emcmot_hal_data->spindle_speed_in), mot_comp_id, "motion.spindle-speed-in")) != HAL_SUCCESS) goto error;
     if ((retval = hal_pin_bit_newf(HAL_IN, &(emcmot_hal_data->spindle_is_atspeed), mot_comp_id, "motion.spindle-at-speed")) != HAL_SUCCESS) goto error;
@@ -335,35 +335,35 @@
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.in-position");
     retval =
-	hal_param_bit_new(buf, HAL_RO, &(emcmot_hal_data->in_position),
+	hal_pin_bit_new(buf, HAL_OUT, &(emcmot_hal_data->in_position),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.coord-mode");
     retval =
-	hal_param_bit_new(buf, HAL_RO, &(emcmot_hal_data->coord_mode),
+	hal_pin_bit_new(buf, HAL_OUT, &(emcmot_hal_data->coord_mode),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.teleop-mode");
     retval =
-	hal_param_bit_new(buf, HAL_RO, &(emcmot_hal_data->teleop_mode),
+	hal_pin_bit_new(buf, HAL_OUT, &(emcmot_hal_data->teleop_mode),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.coord-error");
     retval =
-	hal_param_bit_new(buf, HAL_RO, &(emcmot_hal_data->coord_error),
+	hal_pin_bit_new(buf, HAL_OUT, &(emcmot_hal_data->coord_error),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.on-soft-limit");
     retval =
-	hal_param_bit_new(buf, HAL_RO, &(emcmot_hal_data->on_soft_limit),
+	hal_pin_bit_new(buf, HAL_OUT, &(emcmot_hal_data->on_soft_limit),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
@@ -384,7 +384,7 @@
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "motion.program-line");
     retval =
-	hal_param_s32_new(buf, HAL_RO, &(emcmot_hal_data->program_line),
+	hal_pin_s32_new(buf, HAL_OUT, &(emcmot_hal_data->program_line),
 	mot_comp_id);
     if (retval != 0) {
 	return retval;
@@ -550,12 +550,11 @@
     /*! \todo FIXME - these don't really need initialized, since they are written
        with data from the emcmotStatus struct */
     *(emcmot_hal_data->motion_enabled) = 0;
-    emcmot_hal_data->in_position = 0;
-    *(emcmot_hal_data->inpos_output) = 0;
-    emcmot_hal_data->coord_mode = 0;
-    emcmot_hal_data->teleop_mode = 0;
-    emcmot_hal_data->coord_error = 0;
-    emcmot_hal_data->on_soft_limit = 0;
+    *(emcmot_hal_data->in_position) = 0;
+    *(emcmot_hal_data->coord_mode) = 0;
+    *(emcmot_hal_data->teleop_mode) = 0;
+    *(emcmot_hal_data->coord_error) = 0;
+    *(emcmot_hal_data->on_soft_limit) = 0;
 
     /* init debug parameters */
     emcmot_hal_data->debug_bit_0 = 0;
