Description
Reads the tool offset value specified by "number", "type". The offset value is stored in "data" of "ODBTOFS" with signed binary format.
The unit of offset value is as follows.
- Series 15
- Series 15i
- Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i
- Series 0i-D/F, PMi-A
- Series 30i
| 6007#0 (ONM) | 6004#0 (OUF) | 6002#1 (OFN) | 6002#0 (ORG) | Linear axis mm input [mm] | Linear axis inch input [inch] | Rotation axis [deg] | 
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0.01 | 0.001 | 0.01 | 
| 0 | 0 | 0 | 0 | 0.001 | 0.0001 | 0.001 | 
| 0 | 0 | 1 | 0 | 0.0001 | 0.00001 | 0.0001 | 
| 0 | 1 | 0 | 0 | 0.00001 | 0.000001 | 0.00001 | 
| 1 | 0 | 0 | 0 | 0.000001 | 0.0000001 | 0.000001 | 
| 6007#0 (OFE) | 6004#0 (OFD) | 6002#1 (OFC) | 6002#0 (OFA) | Linear axis mm input [mm] | Linear axis inch input [inch] | Rotation axis [deg] | 
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0.01 | 0.001 | 0.01 | 
| 0 | 0 | 0 | 0 | 0.001 | 0.0001 | 0.001 | 
| 0 | 0 | 1 | 0 | 0.0001 | 0.00001 | 0.0001 | 
| 0 | 1 | 0 | 0 | 0.00001 | 0.000001 | 0.00001 | 
| 1 | 0 | 0 | 0 | 0.000001 | 0.0000001 | 0.000001 | 
| 1004#1 (ISC) | 1004#0 (ISA) | Linear axis mm input [mm] | Linear axis inch input [inch] | Rotation axis [deg] | |
|---|---|---|---|---|---|
| IS-A | 0 | 1 | 0.01 | 0.001 | 0.01 | 
| IS-B | 0 | 0 | 0.001 | 0.0001 | 0.001 | 
| IS-C | 1 | 0 | 0.0001 | 0.00001 | 0.0001 | 
IS-C is effective for Power Mate i-D.
| 5042#1 (OFC) | 5042#0 (OFA) | Linear axis mm input [mm] | Linear axis inch input [inch] | Rotation axis [deg] | 
|---|---|---|---|---|
| 0 | 1 | 0.01 | 0.001 | 0.01 | 
| 0 | 0 | 0.001 | 0.0001 | 0.001 | 
| 1 | 0 | 0.0001 | 0.00001 | 0.0001 | 
| 5042#3 (OFE) | 5042#2 (OFD) | 5042#1 (OFC) | 5042#0 (OFA) | Linear axis mm input [mm] | Linear axis inch input [inch] | Rotation axis [deg] | 
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0.01 | 0.001 | 0.01 | 
| 0 | 0 | 0 | 0 | 0.001 | 0.0001 | 0.001 | 
| 0 | 0 | 1 | 0 | 0.0001 | 0.00001 | 0.0001 | 
| 0 | 1 | 0 | 0 | 0.00001 | 0.000001 | 0.00001 | 
| 1 | 0 | 0 | 0 | 0.000001 | 0.0000001 | 0.000001 | 
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments
Specify the library handle. See "Library handle" for details.
Specify the tool offset number.
                           The available number of tool offset can be got by cnc_rdtofsinfo function.
Specify the tool offset type.(see the following table)
- Machining Center Series (M series, including Power Mate i, PMi-A)
- Machining Center Series (M series, Series 30i)
- Lathe Series (T series)
- Lathe Series (T series, second geometry offset, Series 30i)
- Machining Center Series
- Lathe Series (T series)
- Lathe Series/second geometry offset
| Cutter radius | Tool length | |
| Wear | 0 | 2 | 
| Geometry | 1 | 3 | 
| Cutter radius | Tool length | Imaginary tool nose | Corner R | |
| Wear | 0 | 2 | 6 | 10 | 
| Geometry | 1 | 3 | 7 | 11 | 
| X axis | Z axis | Nose R | Imaginary tool nose | Y axis | 4th axis | 5th axis | |
| Wear | 0 | 2 | 4 | 6 | 8 | 30 | 32 | 
| Geometry | 1 | 3 | 5 | 7 | 9 | 31 | 33 | 
| 2nd coord Ware(Series 30i) | 15 | 17 | 19 | 21 | 23 | -- | -- | 
| 2nd coord Geometry(Series 30i) | 16 | 18 | 20 | 22 | 24 | -- | -- | 
| X axis | Z axis | Y axis | |
| Geometry | 100 | 101 | 102 | 
| 2nd coord Geometry | 110 | 111 | 112 | 
When Tool offset for Milling and Turning function option is effective, specify the following type.(Series 30i)
| X axis | Tool length | Cutter radius | Imaginary tool nose | Y axis | Corner R | |
| Wear | 0 | 2 | 4 | 6 | 8 | 10 | 
| Geometry | 1 | 3 | 5 | 7 | 9 | 11 | 
| X axis | Z axis | Nose R | Imaginary tool nose | Y axis | |
| Wear | 0 | 2 | 4 | 6 | 8 | 
| Geometry | 1 | 3 | 5 | 7 | 9 | 
| X axis | Z axis | Y axis | |
| Geometry | 100 | 101 | 102 | 
Specify the data block length(size of ODBTOFS structure=8).
Pointer to the ODBTOFS structure including the tool offset value. The ODBTOFS structure is as follows.
typedef struct odbtofs {
    short   datano ; /* offset number */
    short   type ;   /* offset type */
    long    data ;   /* offset value */
} ODBTOFS ;
Return
EW_OK is returned on successful completion, otherwise any value except EW_OK is returned.
The major error codes are as follows.
| Return code | Meaning/Error handling | 
|---|---|
| (2) | Size of ODBTOFS structure(length) is wrong. | 
| (3) | Offset number(number) is wrong. | 
| (4) | Offset type(type) is wrong. | 
As for the other return codes or the details, see "Return status of Data window function"
CNC option
And this function is related to the following CNC option.
- Series 15
- Series 15i
- Series 16/18/21, 16i/18i/21i
- Series 0i-A/B/C
- Series 0i-D/F
- Series 30i
- Power Motion i
* ( ) : Basic
 
M 
Tool offset extension 
(32)/99/200/499/999 sets 
 
 Tool offset memory 
(A)/B/C 
 
 Extended tool offset value (number of offset is half of the above sets.) 
 
T 
Tool offset extension 
(32)/64/160 sets 
 
 Tool offset memory 
(A)/B 
 
 Cutter radius compensation 
 
 
 Extended tool offset value (number of offset is half of the above sets.) 
 
TT 
Tool offset extension 
(16)/32/80 sets 
 
 Tool offset memory 
(A)/B 
 
 Cutter radius compensation 
 
 
M 
Tool offset extension 
(32)/99/200/499/999 sets 
 
 Tool offset memory 
(A)/B/C 
 
M 
Tool offset extension 
(32)/64/99/200/400/499/999 sets 
 
 Tool offset memory 
(A)/B/C 
 
T 
Tool offset extension 
(16)/32/64/99 sets 
 
 Geometry/wear offset 
 
 
 Cutter radius compensation 
 
 
 Y axis offset 
 
 
M 
Tool offset extension 
32/(400) sets 
 
 Tool offset memory 
A/(C) 
 
T 
Tool offset extension 
32/(64) sets 
 
 Geometry/wear offset 
 
 
 Cutter radius compensation 
 
 
 Y axis offset 
 
 
M 
Tool offset extension 
32/(400) sets 
 
 Tool offset memory 
A/(C) 
 
T 
Tool offset extension 
32/(99) sets 
 
 Geometry/wear offset 
 
 
 Cutter radius compensation 
 
 
 Y axis offset 
 
 
M 
Tool offset extension 
(32)/64/99/200/400/499/999/2000 sets 
 
 Tool offset memory 
(A)/B/C 
 
 Cutter radius/Nose R offset 
 
 
 Tool offset for Milling and Turning function 
 
 
T 
Tool offset extension 
(32)/64/99/200/400/499/999/2000 sets 
 
 Geometry/wear offset 
 
 
 Cutter radius/Nose R offset 
 
 
 Y axis offset 
 
 
 Second geometry offset 
 
 
 4th/5th Axis Offset Function 
 
 
 The changing active offset 
 
 
 Tool offset for Milling and Turning function 
 
 
 
Tool offset extension 
(32)/99/200 sets 
 
For HSSB connection,
For Ethernet connection,
The Ethernet function and the extended driver/library function are necessary. However, in case of Series 16i/18i/21i-B, 0i-B/C/D/F, Series 30i and PMi-A, the required CNC option is as follows. When Embedded Ethernet is used,above two optional functions are not required.
When Ethernet board is used,
- only Ethernet function is required.
CNC parameter
This function is related to the following CNC parameter.
      See the manual of CNC parameter for details.
                            5009#5(M series)
                            5024
                            5009#5(M series)
                            5024
                            8132#1=1 (must be set)
                            5009#5(M series)
                            5024
                            1004#1(In case of Power Mate i-D)
 
CNC mode
This function can be used in any CNC mode.
Available CNC
| 0i-A | 0i-B/C(Note) | 0i-D | 0i-F | 15 | 15i | 16 | 18 | 21 | 16i-A | 18i-A | 21i-A | 16i-B | 18i-B | 21i-B | 30i-A | 30i-B | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| M (Machining) | |||||||||||||||||
| T (Turning) | - | ||||||||||||||||
| LC (Loader) | - | - | - | - | - | - | - | - | 
| 0i-D | 0i-F | 16i | 18i | 30i-A | 30i-B | |
|---|---|---|---|---|---|---|
| P (Punch press) | - | |||||
| L (Laser) | - | - | - | - | ||
| W (Wire) | - | - | 
| Power Mate i-D | |
| Power Mate i-H | |
| Power Motion i-A | O | 
| "O" | : | Both Ethernet and HSSB | |
| "E" | : | Ethernet | |
| "H" | : | HSSB | |
| "X" | : | Cannot be used | |
| "-" | : | None | 
Note) 0i-C does not support the HSSB function.
See Also
cnc_wrtofs cnc_rdtofsr cnc_wrtofsr cnc_rdtofsinfo
Example(C Language)
 
The following program reads the wear offset value of specified tool number for
each axes and displays them. (for T series)
#include "fwlib32.h"
/* tidx is tool index. */
void example( short tidx )
{
    ODBTOFS tofs ;
    short ret ;
    ret = cnc_rdtofs( h, tidx, 0, 8, &tofs ) ;
    if ( !ret ) printf( "X(%d) = %ld\n", tidx, tofs.data ) ;
    ret = cnc_rdtofs( h, tidx, 2, 8, &tofs ) ;
    if ( !ret ) printf( "Z(%d) = %ld\n", tidx, tofs.data ) ;
    ret = cnc_rdtofs( h, tidx, 8, 8, &tofs ) ;
    if ( !ret ) printf( "Y(%d) = %ld\n", tidx, tofs.data ) ;
}
 Example(C#)
The following program reads the wear offset value of specified tool number for
each axes and displays them. (for T series)
class example
{
    /* tidx is tool index. */
    public void sample(short tidx)
    {
        Focas1.ODBTOFS tofs = new Focas1.ODBTOFS();
        short ret;
        ret = Focas1.cnc_rdtofs(h, tidx, 0, 8, tofs);
        if (ret == Focas1.EW_OK) Console.WriteLine("X({0}) = {1}", tidx, tofs.data);
        ret = Focas1.cnc_rdtofs(h, tidx, 2, 8, tofs);
        if (ret == Focas1.EW_OK) Console.WriteLine("Z({0}) = {1}", tidx, tofs.data);
        ret = Focas1.cnc_rdtofs(h, tidx, 8, 8, tofs);
        if (ret == Focas1.EW_OK) Console.WriteLine("Y({0}) = {1}", tidx, tofs.data);
    }
}