Chapter 15
Scanning
©
National Instruments Corporation
15-19
if
(backlog >= 300){
downloadData =
malloc(sizeof(
i32
)*backlog);
dataCopied = 0;
for
(i=0;i<backlog;i++){
if
(currentDataPoint >
numPoints) break;
downloadData[i] =
points[currentDataPoint];
currentDa+;
dat+;
}
err =
flex_write_buffer
(boardID, 1
/*buffer number*/, dataCopied, 0,
downloadData, 0xFF);
free(downloadData);
downloadData = NULL;
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
any modal
//
errors
//
Read the communication status register and
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
err =
flex_read_axis_status_rtn
(boardID,
NIMC_AXIS1, &status);
CheckError;
axisStatus |= status;