
[Description]
Reads the absolute position data of the controlled axis of CNC.
This absolute position data is identical to that in the absolute
coordinate system displayed on the current position display screen of
the CNC.
This function is used for displaying the absolute 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 absolute position data is stored in "buf.data" with signed binary
format. (The negative value is represented as 2's complement.)
The absolute position data of specified axis is stored in
"buf.data[0]" in case of reading one axis's data.
The unit of the absolute 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
1: 120005
2: -50119
3: 80
while the absolute position data for each axes are
The 1st axis 120.005
The 2nd axis -50.119
The 3rd axis 0.080
in 3-axis system.
(in case of "mm input" and "IS-B".)
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct iodbaxis buf ;
cnc_absolute( -1, 4+4*3, &buf ) ;
printf( "1:%8ld¥n2:%8ld¥n3:%8ld¥n", buf.data[0], buf.data[1],
buf.data[2] ) ;
}