<?xml version="1.0" encoding="Shift_JIS"?>
<?xml-stylesheet type="text/xsl" href="../Fmethod_xsl/fmethod_he_c.xsl"?>

<root>
  <func>

    <title>cnc_rdtofs</title>


    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdtofs(unsigned short FlibHndl, short number, short type, short length, ODBTOFS *tofs);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the tool offset value specified by "number", "type".
               The offset value is stored in "data" of "ODBTOFS" with signed binary format.
            </p>

            <p>The unit of offset value is as follows.</p>

            <ul>
                <li>Series 150</li>
                <table border="1">
                    <tr>
                        <th>6007#0<br/>(ONM)</th>
                        <th>6004#0<br/>(OUF)</th>
                        <th>6002#1<br/>(OFN)</th>
                        <th>6002#0<br/>(ORG)</th>
                        <th>Linear axis<br/>mm input<br/>[mm]</th>
                        <th>Linear axis<br/>inch input<br/>[inch]</th>
                        <th>Rotation axis<br/> <br/>[deg]</th>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0.01</td>
                        <td>0.001</td>
                        <td>0.01</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.001</td>
                        <td>0.0001</td>
                        <td>0.001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0.0001</td>
                        <td>0.00001</td>
                        <td>0.0001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.00001</td>
                        <td>0.000001</td>
                        <td>0.00001</td>
                    </tr>

                    <tr>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.000001</td>
                        <td>0.0000001</td>
                        <td>0.000001</td>
                    </tr>
                </table>
                <br/>
                <li>Series 150i</li>
                <table border="1">
                    <tr>
                        <th>6007#0<br/>(OFE)</th>
                        <th>6004#0<br/>(OFD)</th>
                        <th>6002#1<br/>(OFC)</th>
                        <th>6002#0<br/>(OFA)</th>
                        <th>Linear axis<br/>mm input<br/>[mm]</th>
                        <th>Linear axis<br/>inch input<br/>[inch]</th>
                        <th>Rotation axis<br/> <br/>[deg]</th>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0.01</td>
                        <td>0.001</td>
                        <td>0.01</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.001</td>
                        <td>0.0001</td>
                        <td>0.001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0.0001</td>
                        <td>0.00001</td>
                        <td>0.0001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.00001</td>
                        <td>0.000001</td>
                        <td>0.00001</td>
                    </tr>

                    <tr>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.000001</td>
                        <td>0.0000001</td>
                        <td>0.000001</td>
                    </tr>
                </table>
                <br/>
                <li>Series 160/180/210, 160i/180i/210i, 0i, Power Mate i</li>
                <table border="1">
                    <tr>
                        <th/>
                        <th>1004#1<br/>(ISC)</th>
                        <th>1004#0<br/>(ISA)</th>
                        <th>Linear axis<br/>mm input<br/>[mm]</th>
                        <th>Linear axis<br/>inch input<br/>[inch]</th>
                        <th>Rotation axis<br/> <br/>[deg]</th>
                    </tr>

                    <tr>
                        <td>IS-A</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0.01</td>
                        <td>0.001</td>
                        <td>0.01</td>
                    </tr>

                    <tr>
                        <td>IS-B</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.001</td>
                        <td>0.0001</td>
                        <td>0.001</td>
                    </tr>

                    <tr>
                        <td>IS-C</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0.0001</td>
                        <td>0.00001</td>
                        <td>0.0001</td>
                    </tr>
                </table>
                IS-A is effective for Power Mate i-H.<br/>
                IS-C is effective for Power Mate i-D.<br/>
                <br/>
                <li>Series 300i</li>
                <table border="1">
                    <tr>
                        <th>5042#3<br/>(OFE)</th>
                        <th>5042#2<br/>(OFD)</th>
                        <th>5042#1<br/>(OFC)</th>
                        <th>5042#0<br/>(OFA)</th>
                        <th>Linear axis<br/>mm input<br/>[mm]</th>
                        <th>Linear axis<br/>inch input<br/>[inch]</th>
                        <th>Rotation axis<br/> <br/>[deg]</th>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0.01</td>
                        <td>0.001</td>
                        <td>0.01</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.001</td>
                        <td>0.0001</td>
                        <td>0.001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0.0001</td>
                        <td>0.00001</td>
                        <td>0.0001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.00001</td>
                        <td>0.000001</td>
                        <td>0.00001</td>
                    </tr>

                    <tr>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.000001</td>
                        <td>0.0000001</td>
                        <td>0.000001</td>
                    </tr>
                </table>
            </ul>
        </cmn>


        <is>
            <p>
                Reads the tool offset value specified by "number", "type".
                The offset value is stored in "data" of "ODBTOFS" with signed binary format.
            </p>
            <ul>
                <table border="1">
                    <tr>
                        <th>5042#3<br/>(OFE)</th>
                        <th>5042#2<br/>(OFD)</th>
                        <th>5042#1<br/>(OFC)</th>
                        <th>5042#0<br/>(OFA)</th>
                        <th>Linear axis<br/>mm input<br/>[mm]</th>
                        <th>Linear axis<br/>inch input<br/>[inch]</th>
                        <th>Rotation axis<br/> <br/>[deg]</th>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0.01</td>
                        <td>0.001</td>
                        <td>0.01</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.001</td>
                        <td>0.0001</td>
                        <td>0.001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0.0001</td>
                        <td>0.00001</td>
                        <td>0.0001</td>
                    </tr>

                    <tr>
                        <td>0</td>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.00001</td>
                        <td>0.000001</td>
                        <td>0.00001</td>
                    </tr>

                    <tr>
                        <td>1</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0.000001</td>
                        <td>0.0000001</td>
                        <td>0.000001</td>
                    </tr>
                </table>
            </ul>
        </is>
    </doc>



    <argument>
        <common>
            <vc>
                <item>
                    <name>FlibHndl</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the library handle. See "<a href="handle.htm" target="_parent">Library handle</a>" for details.
                        </p>
                    </content>
                </item>
                <item>
                    <name>number</name>
                    <type>in</type>
                    <content>
                        <p>Specify the tool offset number.<br/>
                           The available number of tool offset can be got by <a href="ncdata/cnc_rdtofsinfo.htm" target="_parent">cnc_rdtofsinfo</a> function.</p>
                    </content>
                </item>
                <item>
                    <name>type</name>
                    <type>in</type>
                    <content>
                        <p>Specify the tool offset type.(see the following table)</p>
                        <ul>
                            <div class="xis"> <!-- attention -->
                            <li>Machining Center Series (M series, including Power Mate i)</li>
                            <table border="1">
                                <tr>
                                    <td/>
                                    <td>Cutter radius</td>
                                    <td>Tool length</td>
                                </tr>

                                <tr>
                                    <td>Wear</td>
                                    <td>0</td>
                                    <td>2</td>
                                </tr>

                                <tr>
                                    <td>Geometry</td>
                                    <td>1</td>
                                    <td>3</td>
                                </tr>
                            </table>
                            Specify "cutter radius" in case of no distinction of cutter radius/tool length, and "wear" in case of no distinction of wear/geometry.<br/>
                            <br/>
                            </div> <!-- class="xis" -->

                            <li>Machining Center Series (M series<span class="xis">, Series 300i</span>)</li>
                            <table border="1">
                                <tr>
                                    <td/>
                                    <td>Cutter radius</td>
                                    <td>Tool length</td>
                                    <td>Imaginary tool nose</td>
                                </tr>

                                <tr>
                                    <td>Wear</td>
                                    <td>0</td>
                                    <td>2</td>
                                    <td>6</td>
                                </tr>

                                <tr>
                                    <td>Geometry</td>
                                    <td>1</td>
                                    <td>3</td>
                                    <td>7</td>
                                </tr>
                            </table>
                            Specify "cutter radius" in case of no distinction of cutter radius/tool length, and "wear" in case of no distinction of wear/geometry.<br/>
                            <br/>
                            <li>Lathe Series (T series)</li>
                            <table border="1">
                                <tr>
                                    <td/>
                                    <td>X axis</td>
                                    <td>Z axis</td>
                                    <td>Nose R</td>
                                    <td>Imaginary tool nose</td>
                                    <td>Y axis</td>
                                </tr>

                                <tr>
                                    <td>Wear</td>
                                    <td>0</td>
                                    <td>2</td>
                                    <td>4</td>
                                    <td>6</td>
                                    <td>8</td>
                                </tr>

                                <tr>
                                    <td>Geometry</td>
                                    <td>1</td>
                                    <td>3</td>
                                    <td>5</td>
                                    <td>7</td>
                                    <td>9</td>
                                </tr>
                            </table>
                            Specify "wear" in case of no distinction of wear/geometry.<br/>
                            <br/>
                            <li>Lathe Series (T series, second geometry offset<span class="xis">, Series 300i</span>)</li>
                            <table border="1">
                                <tr>
                                    <td/>
                                    <td>X axis</td>
                                    <td>Z axis</td>
                                    <td>Y axis</td>
                                </tr>
                                <tr>
                                    <td>Geometry</td>
                                    <td>100</td>
                                    <td>101</td>
                                    <td>102</td>
                                </tr>
                            </table>
                        </ul>
                    </content>
                </item>
                <item>
                    <name>length</name>
                    <type>in</type>
                    <content>
                        <p>Specify the data block length(size of ODBTOFS structure=8).</p>
                    </content>
                </item>
                <item>
                    <name>tofs</name>
                    <type>out</type>
                    <content>
                        <p>Pointer to the ODBTOFS structure including the tool offset value.  The ODBTOFS structure is as follows.</p>
<pre>
typedef struct odbtofs {
    short   datano ; /* offset number */
    short   type ;   /* offset type */
    long    data ;   /* offset value */
} ODBTOFS ;
</pre>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>Data block length error<br/>Size of ODBTOFS structure(length) is wrong.</content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>Data number error<br/>Offset number(number) is wrong.</content>
        </item>
        <item>
            <name>EW_ATTRIB</name>
            <content>Data attribute error<br/>Offset type(type) is wrong.</content>
        </item>
    </errcode>



    <option>
        <hssb>The extended driver/library function is necessary.</hssb>
        <ethr><p>The Ethernet function and the extended driver/library function are necessary.</p>
              <p>However, in case of Series 160i/180i/210i/0i MODEL B and 300i, the required CNC option is as follows.</p>
              <p>When Embedded Ethernet is used,</p>
              <p><ul>above two optional functions are not required.</ul></p>
              <p>When Ethernet board is used,</p>
              <p><ul>only Ethernet function is required.</ul></p>
        </ethr>
        <type>
            <li>Series 150</li>
            <table>
                <colgroup valign="top" width="30"/>
                <colgroup valign="top" width="150"/>
                <colgroup valign="top"/>
                <tr>
                    <td>M</td>
                    <td>Tool offset extension</td>
                    <td>(32)/99/200/499/999 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B/C</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="2">Extended tool offset value (number of offset is half of the above sets.)</td>
                </tr>
                <tr>
                    <td>T</td>
                    <td>Tool offset extension</td>
                    <td>(32)/64/160 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Cutter radius compensation</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="2">Extended tool offset value (number of offset is half of the above sets.)</td>
                </tr>
                <tr>
                    <td>TT</td>
                    <td>Tool offset extension</td>
                    <td>(16)/32/80 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Cutter radius compensation</td>
                    <td></td>
                </tr>
            </table>
            <br/>
            <li>Series 150i</li>
            <table>
                <colgroup valign="top" width="30"/>
                <colgroup valign="top" width="150"/>
                <colgroup valign="top"/>
                <tr>
                    <td>M</td>
                    <td>Tool offset extension</td>
                    <td>(32)/99/200/499/999 sets</td>
                </tr>

                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B/C</td>
                </tr>
            </table>
            <br/>
            <li>Series 160/180/210, 160i/180i/210i, 0i</li>
            <table>
                <colgroup valign="top" width="30"/>
                <colgroup valign="top" width="150"/>
                <colgroup valign="top"/>
                <tr>
                    <td>M</td>
                    <td>Tool offset extension</td>
                    <td>(32)/64/99/200/400/499/999 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B/C</td>
                </tr>
                <tr>
                    <td>T</td>
                    <td>Tool offset extension</td>
                    <td>(16)/32/64/99 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Geometry/wear offset</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Cutter radius compensation</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Y axis offset</td>
                    <td></td>
                </tr>
            </table>
            <br/>
            <li>Series 300i</li>
            <table>
                <colgroup valign="top" width="30"/>
                <colgroup valign="top" width="150"/>
                <colgroup valign="top"/>
                <tr>
                    <td>M</td>
                    <td>Tool offset extension</td>
                    <td>(16)/32/64/99/200/400/499/999/2000 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tool offset memory</td>
                    <td>(A)/B/C</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Cutter radius/Nose R offset</td>
                    <td></td>
                </tr>

                <tr>
                    <td>T</td>
                    <td>Tool offset extension</td>
                    <td>(16)/32/64/99/200/400/499/999/2000 sets</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Geometry/wear offset</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Cutter radius/Nose R offset</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Y axis offset</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Second geometry offset</td>
                    <td></td>
                </tr>
            </table>
            <br/>
            <p>* ( ) : Basic</p>
        </type>
        <add></add>

        <is>
            <hssb>The extended driver/library function is necessary.</hssb>
            <type>
                <table>
                    <colgroup valign="top" width="30"/>
                    <colgroup valign="top" width="200"/>
                    <colgroup valign="top"/>
                    <tr>
                        <td>M</td>
                        <td>Tool offset extension</td>
                        <td>(16)/32/64/99/200/400/499/999/2000 sets</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Tool offset memory</td>
                        <td>(A)/B/C</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Cutter radius/Nose R offset</td>
                        <td></td>
                    </tr>

                    <tr>
                        <td>T</td>
                        <td>Tool offset extension</td>
                        <td>(16)/32/64/99/200/400/499/999/2000 sets</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Geometry/wear offset</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Cutter radius/Nose R offset</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Y axis offset</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Second geometry offset</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                        <td><p>* ( ) : Basic</p></td>
                    </tr>
                </table>
            </type>
        </is>
    </option>



    <parameter>
        <type>
            <li>Series 150, 150i</li>
            <div class="dd">6002#0,#1, 6004#0, 6007#0</div><br/>
            <li>Series 160/180/210, 160i/180i/210i, 0i</li>
            <div class="dd">1004#0,#1</div><br/>
            <li>Series 300i</li>
            <div class="dd">5042#3,#2,#1,#0<br/>
                            5009#5(M series)<br/>
                            5024</div><br/>
            <li>Power Mate i</li>
            <div class="dd">1004#0(In case of Power Mate i-H)<br/>
                            1004#1(In case of Power Mate i-D)</div><br/>
        </type>
        <add></add>
    </parameter>



    <is_parameter>
        <type>
            <div class="dd">5042#3,#2,#1,#0<br/>
                            5009#5(M series)<br/>
                            5024</div><br/>
        </type>
    </is_parameter>



    <mode>
    </mode>



    <support>
        <m>
              <fs0ia>H</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>H</fs15>
            <fs15i>O</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</fs21ib>
            <fs30i>O</fs30i>
        </m>
        <t>
              <fs0ia>H</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>H</fs15>
            <fs15i>X</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</fs21ib>
            <fs30i>O</fs30i>
        </t>
        <lc>
              <fs0ia>X</fs0ia>
            <fs0ib>X</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>H</fs16ia>
            <fs18ia>H</fs18ia>
            <fs21ia>H</fs21ia>
            <fs16ib>H</fs16ib>
            <fs18ib>H</fs18ib>
            <fs21ib>H</fs21ib>
            <fs30i>X</fs30i>
        </lc>
        <p>
            <fs16i>O</fs16i>
            <fs18i>O</fs18i>
        </p>
        <l>
            <fs16i>O</fs16i>
            <fs18i>X</fs18i>
        </l>
        <w>
            <fs16i>E</fs16i>
            <fs18i>E</fs18i>
        </w>
        <pw>
            <d>O</d>
            <h>O</h>
        </pw>
        <add><b></b></add>

        <is>
            <m>
                <fs30is>O</fs30is>
            </m>
            <t>
                <fs30is>O</fs30is>
            </t>
        </is>
    </support>



    <reference>
        <item>
            <name>cnc_wrtofs</name>
            <file>ncdata/cnc_wrtofs.htm</file>
        </item>
        <item>
            <name>cnc_rdtofsr</name>
            <file>ncdata/cnc_rdtofsr.htm</file>
        </item>
        <item>
            <name>cnc_wrtofsr</name>
            <file>ncdata/cnc_wrtofsr.htm</file>
        </item>
        <item>
            <name>cnc_rdtofsinfo</name>
            <file>ncdata/cnc_rdtofsinfo.htm</file>
        </item>
    </reference>



    <example>
        <vc>
<pre>
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, &#38;tofs ) ;
    if ( !ret ) printf( "X(%d) = %ld\n", tidx, tofs.data ) ;
    ret = cnc_rdtofs( h, tidx, 2, 8, &#38;tofs ) ;
    if ( !ret ) printf( "Z(%d) = %ld\n", tidx, tofs.data ) ;
    ret = cnc_rdtofs( h, tidx, 8, 8, &#38;tofs ) ;
    if ( !ret ) printf( "Y(%d) = %ld\n", tidx, tofs.data ) ;
}
</pre>
        </vc>
    </example>



  </func>
</root>
