
[Description]
Reads the relative position data of the controlled axis of CNC.
This relative position data is identical to that in the relative
coordinate system displayed on the current position display screen of
the CNC.
This function is used for displaying the relative positions 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 relative position data is stored in "buf.data" with signed binary
format. (The negative value is represented as 2's complement.)
The relative position data of specified axis is stored in
"buf.data[0]" in case of reading one axis's data.
The unit of the relative position data is as follows.
IS-B IS-C
-----------------------+---------------+---------------
Linear axis(mm input) 0.001 [mm] 0.0001 [mm]
Linear axis(inch input) 0.0001 [inch] 0.00001 [inch]
Rotation axis 0.001 [deg] 0.0001 [deg]
[Example]
The following program displays "RELATIVE 4: 900051" while the
relative position data of the 4th axis(rotation axis) is 90.0051.
(in case of "IS-C".)
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct iodbaxis buf ;
cnc_relative( 4, 4+4*1, &buf ) ;
printf( "RELATIVE 4:%8ld¥n", buf.data[0] ) ;
}