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

<root>
  <func>


    <title>cnc_wrtoolzone</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>
            FWLIBAPI short WINAPI cnc_wrtoolzone(unsigned short FlibHndl, short s_no, short *number, IODBTLZN *tlzone);
        </prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            Writes the tool zone data.
        </cmn>
    </doc>



    <argument>
        <common>
            <vc>
                <item>
                    <name>FlibHndl</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the library handle.<br/>
                            See "<a href="handle.htm" target="_parent">Library handle</a>" for details.
                        </p>
                    </content>
                </item>
                <item>
                    <name>s_no</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the start tool zone data number. (1,..,12)
                        </p>
                    </content>
                </item>
                <item>
                    <name>number</name>
                    <type>in/out</type>
                    <content>
                       <p>
                           Pointer to the number of tool zone data.<br/>
                           Specify the number of tool zone data to be written before function call,
                           and the number of tool zone data being written actually is stored after the function call.
                       </p>
                    </content>
                </item>
                <item>
                    <name>tlzone</name>
                    <type>in</type>
                    <content>
                        <p>
                            Pointer to the IODBTLZN structure including the tool zone data.<br/>
                            The IODBTLZN structure is as follows.
                        </p>
<pre>
typedef struct iodbtlzn {
    short   slct;       /* Flag of data selection */
    long    data[2];    /* Tool zone data */
} IODBTLZN ;
</pre>
                        <dl>
                            <dt>slct</dt>
                                <dd>Flag of data selection must be set.
                                <table class="dd">
                                    <tr><td>bit 0</td><td>:</td><td>Item X</td></tr>
                                    <tr><td>bit 1</td><td>:</td><td>Item Y</td></tr>
                                </table>
                                <table class="dd">
                                    <tr><td>bit 2,..,15</td><td>:</td><td>(not used)</td></tr>
                                </table>
                                * In order to write the data to CNC, turn on the corresponding bit on this data.
                                </dd>
                            <dt>data</dt>
                                <dd>Tool zone data.
                                <table class="dd">
                                    <tr><td>data[0]</td><td>:</td><td>Item X</td></tr>
                                    <tr><td>data[1]</td><td>:</td><td>Item Y</td></tr>
                                </table>
                                </dd>
                        </dl>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_FUNC</name>
            <content>
                Unavailable<br/>
                This function cannot be used except 160i/180i-P.
            </content>
        </item>
        <item>
            <name>EW_LENGTH</name>
            <content>
                Data block length error<br/>
                Number of data(number) is wrong.
            </content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>
                Data number error<br/>
                Start number(s_no) is wrong.
            </content>
        </item>
        <item>
            <name>EW_DATA</name>
            <content>
                Data error<br/>
                The tool zone data(data) is wrong.<br/>
                In order to get more information for this err_no(nErr_no) return value, execute
                <a href="Misc/cnc_getdtailerr.htm" target="_parent">cnc_getdtailerr</a> function.<br/>
                The following detail status will be set onto the member, err_no of ODBERR structure
                (nErr_no of ODBERR user define type.).<br/>
                <table>
                    <colgroup align="center" valign="top">
                    <colgroup align="center" valign="top">
                    <colgroup valign="top">
                    <tr><td>1</td><td>:</td><td>Error of Item X</td></tr>
                    <tr><td>2</td><td>:</td><td>Error of Item Y</td></tr>
                    </colgroup>
                    </colgroup>
                    </colgroup>
                </table>
                And the tool zone data number which an error occurred will be set onto the member,
                err_dtno( nErr_dtno ) of ODBERR.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
                The safety zone check function and the extended driver/library function are necessary.
            </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>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>
        <need>The safety zone check function is necessary.</need>
    </option>



    <parameter>
        <type>
            <li>Series 160i/180i</li>
            <div class="dd">16517,..,16532, 16551,..,16558</div><br/>
        </type>
        <add></add>
    </parameter>



    <mode>
    </mode>



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



    <reference>
        <item>
            <name>cnc_rdsafetyzone</name>
            <file>Punch/cnc_rdsafetyzone.htm</file>
        </item>
        <item>
            <name>cnc_wrsafetyzone</name>
            <file>Punch/cnc_wrsafetyzone.htm</file>
        </item>
        <item>
            <name>cnc_rdtoolzone</name>
            <file>Punch/cnc_rdtoolzone.htm</file>
        </item>
        <item>
            <name>cnc_rdacttlzone</name>
            <file>Punch/cnc_rdacttlzone.htm</file>
        </item>
        <item>
            <name>cnc_rdsetzone</name>
            <file>Punch/cnc_rdsetzone.htm</file>
        </item>
        <item>
            <name>cnc_wrsetzone</name>
            <file>Punch/cnc_wrsetzone.htm</file>
        </item>
    </reference>



    <example>
    </example>



  </func>
</root>
