Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 422 -
[Description]
Alters the tool offset amount stored in the CNC within the specified
range.
Specify the start offset number in "buf.datano_s" and the end one in
"buf.datano_e". Specify the kind of offset amount to be read in
"type". The combinations of the value specified in "type", the data
block length "length", the kind of offset amount to be read and the
member where the result is stored in are same as "Read tool offset
amount(range specified)(cnc_rdtofsr)". Refer description of it.
Store the offset amount 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(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 stores all tool offset amounts of
Machining-Series(Memory A/64 sets).
#include <data.h>
#include <fwindow.h>
#include <stdlib.h>
#include <string.h>
#define MAXTOOL 64
/* offset is array of new offset value. */
int example( long *offset )
{
struct iodbto *buf ;
int ret ;
buf = (struct iodbto *)malloc( 6+4*MAXTOOL ) ;
buf->datano_s = 1 ;
buf->datano_e = MAXTOOL ;
buf->type = -1 ;
memcpy( &(buf->u.m_ofs_a[0]), offset, 4*MAXTOOL ) ;
ret = cnc_wrtofsr( 6+4*MAXTOOL, buf ) ;
free( buf ) ;
return ( ret ) ;
}