National Instruments NI-Motion User Manual

Page 83

Advertising
background image

Chapter 6

Arc Moves

© National Instruments Corporation

6-5

NI-Motion User Manual

u16

commandID;// The commandID of the function

u16

resourceID;// The resource ID

i32

errorCode;// Error code

///////////////////////////////

// Set the board ID

boardID = 1;

// Set the vector space number

vectorSpace = NIMC_VECTOR_SPACE1;

////////////////////////////////

// Configure a 2D vector space comprising of axes 1

and 2

err = flex_config_vect_spc(boardID, vectorSpace,

NIMC_AXIS1, NIMC_AXIS2, 0);

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_circular_arc (boardID, vectorSpace,

5000/*radius*/, 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

Advertising