User guide

110 運動控制功能原理介紹
// 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.
}
}
preliminary