ADLINK PCI-8134A User Manual

Page 162

Advertising
background image

Appendix A

154

Abnormal stop when using these modes

During auto homing phases, there could be a stop command from limit

switch, alarm switch or users’ stop command. When it happened, the
homing procedure will be terminated and return an error code in
_8134_motion_done(). These error codes show the reason of termination.
Notice that these codes will be cleared when users’ program read it.

Normally, the _8134_motion_done() will show the phase codes during

home searching. When it returns 0, it means homing is stopped. If there is
no homing error codes returned on this duration, it means homing is
successfully done. If there is an error code after stop, users must check the
error code and the previous code from _8134_motion_done() to judge the
reason of error and the phase of stop.

Please follow the sample program to read the return code correctly.

// Start home move
_8134_home_move(Axis);
while(1)
{

// polling motion status
Ret=_8134_motion_done(Axis)
if( Ret >= 200 ) // Abnormal Stop during homing
{

// ALM_ON = 200
// PEL_ON = 201

// MEL_ON = 202
// Stop command = 203
// EMG command = 204
// Unknow Stop =205
// Other Stop = 206

// This status will not be latched, it will be cleared after read
break;

}
else if( Ret > 100 ) // Normal case : home phase returned
{

// Keep Homing Phase for debug when abnormal stop happen

LastRet=Ret;

// Auto homing Status ( phase will change during homing )
// START = 100
// END = 101
// REVERSE = 102
// FIND ORG = 103
// ESCAPE ORG = 104
// OFFSET ORG = 105
// LEAVE ORG = 106
// First MOVE = 107

Advertising