National Instruments NI-Motion User Manual

Page 262

Advertising
background image

Chapter 15

Scanning

© National Instruments Corporation

15-11

NI-Motion User Manual

// Set the deceleration for the move (in

counts/sec^2)

err = flex_load_acceleration(boardID, vectorSpace,

NIMC_DECELERATION, 100000, 0xFF);

CheckError;

// Set the jerk or s-curve in sample periods

err = flex_load_scurve_time(boardID, vectorSpace,

100, 0xFF);

CheckError;

// Load the blending factor

err = flex_load_blend_fact(boardID, vectorSpace, -1,

0xFF);

CheckError;

// Set the operation mode to absolute position

err = flex_set_op_mode(boardID, vectorSpace,

NIMC_ABSOLUTE_POSITION);

CheckError;

// Load the straight-line segments one by one

for

(i=0; i<d_numberOfSegments; i++){

//Load Target Position

err = flex_load_vs_pos(boardID, vectorSpace,

xPosition[i], yPosition[i], 0, 0xFF);

CheckError;

if

(i==0){

// Start the move

err = flex_start(boardID, vectorSpace,

0);

CheckError;

}else{

// Blend the move

err = flex_blend(boardID, vectorSpace,

0);

CheckError;

}

do

{

axisStatus = 0;

if

(i==d_numberOfSegments-1){

// Check the move complete status

err =

flex_check_move_complete_status

(bo

ardID, vectorSpace, 0, &complete);

Advertising