Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 424 -
[Description]
Reads the work origin offset amount stored in the CNC.
The work origin offset amounts are provided for all controlled axes
(the 1st axis,..,the 8th axis) of the CNC. It is possible to read
one offset amount for each axis or the whole for all axes at the same
time. However, in case of no controlled axes expansion option, the
work origin offset amounts for the additional axes can't be read.
This function is used for maintenance of CNC as follows, etc.
Saves work origin offset amounts stored in CNC to the
application's memory, Clears CNC's memory, Restores them.
Specify one of (1,..,amount of controlled axes) for each axis or -1
for all axes as axis number in "axis".
Specify one of following value as offset number in "number".
number Kind of work origin offset amount
------------+-----------------------------------------------
0 External work origin offset amount
1,..,6 Work origin offset amount of G54 through G59
7,..,306 Work origin offset amount of G54.1P1 through
G54.1P300
The work origin offset amount is stored in "buf.data" with signed
binary format. (The negative value is represented as 2's complement.)
The work origin offset amount of specified axis is stored in
"buf.data[0]" in case of reading one axis's data.
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 displays the work origin offset amounts of the
specified number for all axes (amount of axes = MAX).
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
/* ofs is offset number to be displayed. */
void example( int ofs )
{
struct iodbaxis buf ;
unsigned int idx ;
cnc_rdzofs( ofs, -1, 4+4*MAX, &buf ) ;
for ( idx = 0 ; idx < MAX ; idx++ )
printf( "%u:%8ld\n", idx, buf.data[idx] ) ;
}