
------------------------------------------------------------------------------
1.26 Read distance to go. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_distance
[Syntax]
#include <data.h>
#include <fwindow.h>
short cnc_distance( short axis, short length, struct iodbaxis *buf ) ;
struct iodbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[N] ; /* Amount of distance to go of */
} ; /* controlled axis. */
/* N is a maximum controlled axis number.*/
[Arguments]
axis Axis number ( =(1,..,amount of controlled axes),or -1 ).
length Data block length ( =4+4*(Number of axes for which data
is to be read) ).
buf Buffer in which the amounts of distance to go are
stored.
[Return]
EW_OK( 0) Successful.
EW_LENGTH( 2) Incorrect data block length "length".
EW_ATTRIB( 4) Incorrect axis number "axis".
Any data other than -1 or (1,..,amount of controlled
axes) has been specified.
EW_BUSY(-1) It was impossible to read data about the
distance-yet-to-go of a controlled axis because the CNC
was updating that data.
[Description]
Reads the amount of distance to go of the controlled axis of CNC.
This amount of distance to go is same as one which is displayed on
the current position screen of CNC.
This function is used for displaying the amount of distance to go of
the controlled axes of CNC by the application program, etc.
Specify one of (1,..,amount of controlled axes) for each axis or -1
for all axes as axis number in "axis".
The amount of distance to go is stored in "buf.data" with signed
binary format. (The negative value is represented as 2's complement.)
The amount of distance to go of specified axis is stored in
"buf.data[0]" in case of reading one axis's data.