Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 430 -
N is the amount of axis and M is the number of offset to be
read. In case that the amount of controlled axes is less than
8, no data are stored in the members corresponding with the
axes No. (amount of controlled axes + 1),..,8.
The unit of the work origin offset amount 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 reads the work origin offset amount of G54
through G59 for all axes (amount of axes = MAX) and displays them.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
#include <stdlib.h>
int example( void )
{
struct iodbzo *buf ;
int ret, idx1, idx2 ;
buf = (struct iodbzo *)malloc( 6+4*8*6 ) ;
ret = cnc_rdzofsr( 1, -1, 6, 6+4*8*6, buf ) ;
if ( !ret ) {
for ( idx1 = 0 ; idx1 < 6 ; idx1++ ) {
printf( "G%d", idx1+54 ) ;
for ( idx2 = 0 ; idx2 < MAX ; idx2++ )
printf( " %8ld", buf->data[idx1*8+idx2] ) ;
putchar( '\n' ) ;
}
}
free( buf ) ;
return ( ret ) ;
}