Chapter 6
Arc Moves
©
National Instruments Corporation
6-11
///////////////////////////////
//
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 Spherical Arc
err =
flex_load_spherical_arc
(boardID, vectorSpace,
5000/*radius*/, 45.0/*planePitch*/,
45.0/*planeYaw*/, 0.0/*startAngle*/,
180.0/*travelAngle*/, 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;