National Instruments NI-Motion User Manual page 94

Motion control
Table of Contents

Advertisement

Chapter 6
Arc Moves
NI-Motion User Manual
// Set the board ID
boardID = 1;
// Set the vector space number
vectorSpace = NIMC_VECTOR_SPACE1;
////////////////////////////////
// Configure a 3D vector space comprising of axes 1,
2 and 3
err = flex_config_vect_spc(boardID, vectorSpace,
NIMC_AXIS1, NIMC_AXIS2, NIMC_AXIS3);
CheckError;
// Set the velocity for the move (in counts/sec)
err = flex_load_velocity(boardID, vectorSpace,
10000, 0xFF);
CheckError;
// Set the acceleration for the move (in
counts/sec^2)
err = flex_load_acceleration(boardID, vectorSpace,
NIMC_ACCELERATION, 100000, 0xFF);
CheckError;
// Set the deceleration for the move (in
counts/sec^2)
err = flex_load_acceleration(boardID, vectorSpace,
NIMC_DECELERATION, 100000, 0xFF);
CheckError;
// Load Helical Arc
err = flex_load_helical_arc (boardID, vectorSpace,
5000/*radius*/, 0.0/*startAngle*/,
720.0/*travelAngle*/, 5000 /*linear travel*/, 0xFF);
CheckError;
//Start the move
err = flex_start(boardID, vectorSpace, 0);
CheckError;
do
{
axisStatus = 0;
//Check the move complete status
err = flex_check_move_complete_status(boardID,
vectorSpace, 0, &moveComplete);
CheckError;
// Check the following error/axis off status for
axis 1
6-16
ni.com

Advertisement

Table of Contents
loading

Table of Contents