National Instruments NI-Motion User Manual

Page 78

Advertising
background image

Chapter 5

Straight-Line Moves

© National Instruments Corporation

5-23

NI-Motion User Manual

err = flex_stop_motion(boardID, axis,

NIMC_DECEL_STOP, 0);

CheckError;

// Reset velocity override back to 100%

err = flex_load_velocity_override(boardID, axis,

100, 0xFF);

CheckError;

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,&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

}

Advertising