110 motion control theory – ADLINK PCI-8258 User Manual

Page 124

Advertising
background image

110

Motion Control Theory

// 2. Start home move

return_code = APS_home_move( axis_id );

//Start homing

if

( return_code != ERR_NoError )

{

/* Error handling */

}

// 3. Wait for home move done,

do

{

Sleep(

100

);

msts = APS_motion_status( axis_id );

// Get motion status

msts = ( msts >> MTS_NSTP ) &

1

;

// Get motion done bit

}

while

( msts ==

1

);

// 4. Check home move success or not

msts = APS_motion_status( axis_id );

// Get motion status

msts = ( msts >> MTS_ASTP ) &

1

;

// Get abnormal stop bit

if

( msts ==

1

)

{

// Error handling ...

I32 stop_code;

APS_get_stop_code( axis_id, &stop_code );

}

else

{

// Homing success.

}

}

Advertising
This manual is related to the following products: