
N is number of offset to be read, i = 0,..,(N-1).
The offset amounts are stored in "buf.u.xxx[i]" with signed binary
format. (The negative value is represented as 2's complement.)
The unit of offset amount is as follows.
IS-B IS-C
-------------------------------+---------------+---------------
Linear axis (metric 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 reads and displays the tool offset amounts for all
tools on a lathe (memory B/64 sets).
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
#include <stdlib.h>
#define MAXTOOL 64
short example( void )
{
struct iodbto *buf ;
short ret, idx ;
buf = (struct iodbto *)malloc( 6+34*MAXTOOL ) ;
ret = cnc_rdtofsr( 1, -2, MAXTOOL, 6+34*MAXTOOL, buf ) ;
if ( !ret ) {
printf( "No X:wear Z:wear Y:wear X:geom "
"Z:geom Y:geom R:wear R:geom T¥n" ) ;
printf( "---+-------+-------+-------+-------+"
"-------+-------+-------+------+-¥n" ) ;
for ( idx = 0 ; idx < MAXTOOL ; idx++ ) {
printf( "%02d%8ld%8ld%8ld%8ld%8ld%8ld%8ld%8ld%2d¥n",
idx, buf->u.t_ofs_b[idx].data[4],
buf->u.t_ofs_b[idx].data[5],
buf->u.t_ofs_b[idx].data[6],
buf->u.t_ofs_b[idx].data[0],
buf->u.t_ofs_b[idx].data[1],
buf->u.t_ofs_b[idx].data[2],
buf->u.t_ofs_b[idx].data[7],
buf->u.t_ofs_b[idx].data[3],
buf->u.t_ofs_b[idx].tip ) ;
}
}
free( buf ) ;
return ( ret ) ;
}