User`s manual
http://www.adtechcn.com   43 
) 4. Motion parameters detection 
adt8840a_get_command_pos( ) 
Name int adt8840a_get_command_pos(int dev_num,int axis, long *pos) 
Definition  Get the logic position for each axis 
Input parameter 
dev_num: device number 
axis:  axis number (1 - 4) 
Output 
parameter 
pos: pointer of logic position value 
Return value 
0: execution OK; 1: execution failure; -1: transmission abnormity; -2: response overtime; 
-3: abnormal data received; -4: disabled device interface
Note 
With this function, the logic position of the axis can be obtained at any time. When the 
motor has not lost its step, it represents the current position of the axis. 
 adt8840a_get_actual_pos( ) 
Name int adt8840a_get_actual_pos(int dev_num,int axis, long *pos) 
Definition  Get the logic position for each axis 
Input parameter 
dev_num: device number 
axis:  axis number (1 - 4) 
Output 
parameter 
pos: pointer of actual position value 
Return value 
0: execution OK; 1: execution failure; -1: transmission abnormity; -2: response overtime; 
-3: abnormal data received; -4: disabled device interface
Note 
With this function, the actual position of the axis can be obtained at any time. Even when 
the motor lost its step, the user can know the current position of the axis. 
The axis must be connected to encoder or grating ruler. This number actually represents the 
number counted by the encoder or grating ruler. 
 adt8840a_get_speed( ) 
Name 
int 
adt8840a_
get_speed(int dev_num,int axis, long *
value
)
Definition  Get the current drive velocity of each axis 
Input parameter 
dev_num: device number 
axis:  axis number (1 - 4) 
Output 
parameter 
pos: pointer of current drive velocity 
Return value 
0: execution OK; 1: execution failure; -1: transmission abnormity; -2: response overtime; 
-3: abnormal data received; -4: disabled device interface










