Chapter 7
Contoured Moves
©
National Instruments Corporation
7-9
CheckError;
}
}
//
Check the move complete status
err =
flex_check_move_complete_status
(boardID,
vectorSpace, 0, &moveComplete);
CheckError;
if
(moveComplete)
break
;
//
Check for axis off status/following error or
modal errors
//
Read the communication status register check
the modal errors
err =
flex_read_csr_rtn
(boardID, &csr);
CheckError;
//
Check the modal errors
if
(csr & NIMC_MODAL_ERROR_MSG){
err = csr & NIMC_MODAL_ERROR_MSG;
CheckError;
}
//
Check the motor off status on all the axes or
axis
err =
flex_read_axis_status_rtn
(boardID,
NIMC_AXIS1, &status);
CheckError;
axisStatus |= status;
err =
flex_read_axis_status_rtn
(boardID,
NIMC_AXIS2, &status);
CheckError;
axisStatus |= status;
if
( (axisStatus & NIMC_FOLLOWING_ERROR_BIT) ||
(axisStatus & NIMC_AXIS_OFF_BIT) ){
break
;//
Break out of the for loop because an axis
was killed
}
}
//
Set the mode back to absolute mode to get the
motion controller out of
//
contouring mode
err =
flex_set_op_mode
(boardID, vectorSpace,
NIMC_ABSOLUTE_POSITION);
CheckError;