Relative position breakpoints, Relative position breakpoints -12 – National Instruments NI-Motion User Manual

Page 162

Advertising
background image

Chapter 12

Synchronization

NI-Motion User Manual

12-12

ni.com

}

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

}

Relative Position Breakpoints

Relative position breakpoints trigger events based on a change in position
relative to the position at which the breakpoint was enabled.

Instead of keeping track of absolute positions and the current position,
you can use relative breakpoints to specify the breakpoint relative to the
position where the breakpoint is enabled.

For example, if you are creating a motion control system to control the
two-dimensional movement of a microscope, you might use relative
position breakpoints to move the microscope a specific distance in a
direction, and then hit a breakpoint that triggers a camera snap. The relative

Advertising