Chapter 15
Scanning
©
National Instruments Corporation
15-5
//
Set the deceleration for the move (in
counts/sec^2)
err =
flex_load_acceleration
(boardID, vectorSpace,
NIMC_DECELERATION, 100000, 0xFF);
CheckError;
//
Set the jerk or s-curve in sample periods
err =
flex_load_scurve_time
(boardID, vectorSpace,
100, 0xFF);
CheckError;
//
Set the operation mode to absolute position
err =
flex_set_op_mode
(boardID, vectorSpace,
NIMC_ABSOLUTE_POSITION);
CheckError;
//
Load the straight-line segments one by one
for
(i=0; i<d_numberOfSegments; i++){
//
Load Target Position
err =
flex_load_vs_pos
(boardID, vectorSpace,
xPosition[i], yPosition[i], 0, 0xFF);
CheckError;
//
Start the move
err =
flex_start
(boardID, vectorSpace, 0);
CheckError;
do
{
axisStatus = 0;
//
Check the move complete status
err =
flex_check_move_complete_status
(boardID, vectorSpace, 0, &moveComplete);
CheckError;
//
Check the following error/axis off
status for axis
1
err =
flex_read_axis_status_rtn
(boardID,
NIMC_AXIS1, &status);
CheckError;
axisStatus |= status;
//
Check the following error/axis off
status for axis 2
err =
flex_read_axis_status_rtn
(boardID,
NIMC_AXIS2, &status);
CheckError;
axisStatus |= status;