Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 545 -
------------------------------------------------------------------------------
1.93 Write tool life management data (tool radius compensation number 1).
<Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_wr1radius
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_wr1radius( struct odbtool *buf ) ;
struct odbtool {
int datano ; /* Tool group number. */
int type ; /* Tool number. */
long data ; /* Cutter radius compensation number.*/
} ;
[Arguments]
buf Buffer in which the tool management data are stored.
[Return]
0 Successful.
3 Incorrect tool group number "buf.datano".
4 Incorrect tool number "buf.type".
5 The specified tool number is not registered in the specified
tool group.
6 The required option (Tool life management or Tool number
expansion for tool life management (512 sets in total, only
M Series)) is not added.
-1 Attempted to execute this function while the other low-speed
window function is being executed.
Retry after completing currently executed window's process.
[Description]
Writes the cutter radius compensation number of the specified tool
group and the tool number.
Specify the tool group number in "buf.datano", the tool number in
"buf.type", and the cutter radius compensation number (1,..,255,
inside of the amount of the tool compensation) in "buf.data" with
binary format.
This function is effective for only M Series.
[Example]
The following program alters the cutter radius compensation number of
the specified tool group and tool number.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
/* grpno/toolno are GROUP/TOOL index number to be written in. */
/* rcomp is tool radius compensation number to be written. */
int example( int grpno, int toolno, long rcomp )
{ struct odbtool buf ;
int ret ;
buf.datano = grpno ;
buf.type = toolno ;
buf.data = rcomp ;
ret = cnc_wr1radius( &buf ) ;
if ( !ret )
printf( "New tool radius compensation number %ld "
"has been written.\n", buf.data ) ;
else