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