Branching Onboard Programs - National Instruments NI-Motion User Manual

Motion control
Table of Contents

Advertisement

Branching Onboard Programs

© National Instruments Corporation
//////////////////////
// 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,&commandI
D,&resourceID, &errorCode);
nimcDisplayError(errorCode,commandID,res
ourceID);
//Read the communication status register
flex_read_csr_rtn(boardID,&csr);
}while(csr & NIMC_MODAL_ERROR_MSG);
}
else// Display regular error
nimcDisplayError(err,0,0);
return;// Exit the Application
}
To create loops, or conditional if statements, insert labels in the program
you are storing and use the Jump to Label function to jump to that label
based on the condition.
14-19
Chapter 14
Onboard Programs
NI-Motion User Manual

Advertisement

Table of Contents
loading

Table of Contents