National Instruments NI-Motion Home Safety Product User Manual


 
Chapter 12 Synchronization
NI-Motion User Manual 12-26 ni.com
err = flex_enable_breakpoint(boardID, axis,
NIMC_TRUE);
CheckError;
do
{
// Check the move complete
status/following error/axis off //status
err = flex_read_axis_status_rtn(boardID,
axis, &axisStatus);
CheckError;
// 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;
}
Sleep (10); //Check every 10 ms
}while (!(axisStatus & NIMC_POS_BREAKPOINT_BIT));
// Wait for breakpoint to be triggered
}
return;// Exit the Application
//////////////////////
// Error Handling
nimcHandleError; //NIMCCATCHTHIS:
// Check to see if there were any Modal Errors
if (csr & NIMC_MODAL_ERROR_MSG){
do{
//Get the command ID, resource ID, and the error
code of the modal //error from the error stack on
the device
flex_read_error_msg_rtn(boardID,&commandID,&reso
urceID, &errorCode);
nimcDisplayError(errorCode,commandID,resourceID)
;
//Read the communication status register
flex_read_csr_rtn(boardID,&csr);
}while(csr & NIMC_MODAL_ERROR_MSG);
else// Display regular error