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

<root>
  <func>
    <title>cnc_upstart4</title>


    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_upstart4(unsigned short FlibHndl, short type, char* file_name);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>
                Notifies the start of uploading NC data (NC program, tool offset, etc.) to the internal logic of the
                Data window library.<br/>
                (This function must be executed before <a href="Program/cnc_upload4.htm" target="_parent">cnc_upload4</a>.)
            </p>
            <p>
                In case of upload for NC programs, a source file or a destination folder can be specified.
            </p>
            <p>
                <a href="Program/cnc_upload4.htm" target="_parent">cnc_upload4</a> function and
                <a href="Program/cnc_upend4.htm" target="_parent">cnc_upend4</a> function will return EW_FUNC
                in case that cnc_upstart4 function is not executed.
            </p>
            <p>A basic procedure for upload is shown below.</p>
            <p><img src="Program/upload4.gif"/></p>
        </cmn>
    </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>type</name>
                    <type>in</type>
                    <content>
                        <p>Specify the kind of the data.</p>
                            <table class="dd">
                                <tr><td>0</td><td>:</td><td>NC program</td></tr>
                                <tr><td>1</td><td>:</td><td>Tool offset data</td></tr>
                                <tr><td>2</td><td>:</td><td>Parameter</td></tr>
                                <tr><td>3</td><td>:</td><td>Pitch error compensation data</td></tr>
                                <tr><td>4</td><td>:</td><td>Custom macro variables</td></tr>
                                <tr><td>5</td><td>:</td><td>Work zero offset data</td></tr>
                                <tr><td>7</td><td>:</td><td>Operation history data</td></tr>
                            </table>
                    </content>
                </item>
                <item>
                    <name>file_name</name>
                    <type>in</type>
                    <content>
                        <p>Specify a source file name or a source folder name for upload. (The maximum length of the character string is 241 and the string should be included by NULL('\0') terminate character.)</p>
                        <p>In case of a file name only, not a full path name, the file in a current folder is read. In case of a folder name, all programs in the folder are read, In case of NULL, all programs in a current folder are read.
                        <blockquote>
                        Example :
                        <table class="dd">
                        <tr><td>File name only</td>     <td>:</td>  <td>&quot;O1234&quot;</td></tr>
                        <tr><td>Folder name</td>        <td>:</td>  <td>&quot;//CNC_MEM/USER/PATH1/&quot;</td></tr>
                        <tr><td>Path + file name</td>   <td>:</td>  <td>&quot;//CNC_MEM/USER/PATH1/O1234&quot;</td></tr>                        </table>
                        </blockquote>
                        It is available when type = 0.
                        </p>
                        Please refer to <a href="general.htm#DriveName" target="_parent">&quot;General Description (Specifying the folder and file name for FS30i.)&quot;</a> for details of the folder and file name.
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_BUSY</name>
            <content>
                Busy
                <ul style="margin-top:0;margin-bottom:0">
                    <li>cnc_upstart4 function has been executed.</li>
                        Terminate a uploading by using <a href="Program/cnc_upend4.htm" target="_parent">cnc_upend4</a>
                        function.
                </ul>
            </content>
        </item>
        <item>
            <name>EW_DATA</name>
            <content>
                Data error<br/>
                In order to get more information for this err_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.
                <table>
                    <colgroup align="center" valign="top">
                    <colgroup align="center" valign="top">
                    <colgroup valign="top">
                    <tr>
                        <td>1</td><td>:</td><td>Program number (s_number, e_number) is illegal.</td>
                    </tr>
                    </colgroup>
                    </colgroup>
                    </colgroup>
                </table>
            </content>
        </item>
        <item>
            <name>EW_ATTRIB</name>
            <content>
                Data attribute error<br/>
                Data type (type) is illegal.
            </content>
        </item>
        <item>
            <name>EW_DATA</name>
            <content>
                Data error<br/>
                In order to get more information for this err_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.
                <table>
                    <colgroup align="center" valign="top"></colgroup>
                    <colgroup align="center" valign="top"></colgroup>
                    <colgroup valign="top"></colgroup>
                    <tr>
                        <td>1</td><td>:</td><td>Program file name or folder name is wromg.</td>
                    </tr>
                </table>
                See <a href="#disc">Description</a> about the timing of error.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
                In case of custom macro variables, work zero offset or pitch error compensation data,
                this function needs the option for the target data.
            </content>
        </item>
<!--
        <item>
            <name>EW_REJECT</name>
            <content>
                CNC execution denied
                <ul style="margin-top:0;margin-bottom:0">
                    <li>CNC is machining</li>
                        Cannot upload while automatic operation is being executed on CNC.
                </ul>
            </content>
        </item>
        <item>
            <name>EW_ALARM</name>
            <content>
                Alarm state
                <ul style="margin-top:0;margin-bottom:0">
                    <li>Alarm (PW000) on CNC side</li>
                        Reset the alarm on CNC.
                </ul>
            </content>
        </item>
-->
    </errcode>



    <option>
        <hssb>The extended driver/library function is necessary.</hssb>
        <type>
            Pitch error compensation<br/>
            Custom macro<br/>
            Work zero offset
        </type>
    </option>



    <parameter>
        <type>
            <ul>
                0100#3<br/>
                3202#0,#4,#6<br/>
                3204#3,#4<br/>
                3210,3211
            </ul>
        </type>
    </parameter>



    <mode>
    </mode>



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



    <reference>
        <item>
            <name>cnc_upload4</name>
            <file>Program/cnc_upload4.htm</file>
        </item>
        <item>
            <name>cnc_upend4</name>
            <file>Program/cnc_upend4.htm</file>
        </item>
    </reference>



    <example>
        <common>
            See the example of <a href="Program/cnc_upload4.htm#sample" target="_parent">cnc_upload4</a>.
        </common>
    </example>



  </func>
</root>
