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

<root>
  <func>

    <title>cnc_newprog</title>

    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_newprog(unsigned short FlibHndl, long progno);</prottype>
      </vc>
    </declare>

    <doc>
        <cmn>
            <p>Registers a new program.</p>
        </cmn>
    </doc>

    <argument>
        <common>
            <cmn>
                <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>progno</name>
                    <type>in</type>
                    <content>
                        <p>Specify a new program number to register.<br/>
                        When you register the MDI program, specify -1.
                        </p>
                    </content>
                </item>
            </cmn>
        </common>
    </argument>

    <errcode>
        <item>
            <name>EW_BUSY</name>
            <content>
                Busy<br/>
                CNC is doing an another editing operation.
            </content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>
                Data number error<br/>
                The program number (progno) is wrong.
            </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>3</td><td>:</td><td>The registered program count is full.</td>
                    </tr>
                    <tr>
                        <td>4</td><td>:</td><td>The same program number has already been registered.</td>
                    </tr>
                </table>
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
                The extended driver/library function is necessary.
            </content>
        </item>
        <item>
            <name>EW_PROT</name>
            <content>
                Write protected<br/>
                Specified file is prohibited from writing.
            </content>
        </item>
        <item>
            <name>EW_BUFFER</name>
            <content>
                Buffer full<br/>
                Retry because the buffer is full.
            </content>
        </item>
        <item>
            <name>EW_MODE</name>
            <content>
                CNC mode error<br/>
                <ul style="margin-top:0;margin-bottom:0">
                <li>MDI program</li>
                    Set the MDI mode.
                </ul>
            </content>
        </item>
        <item>
            <name>EW_REJECT</name>
            <content>
                CNC execution rejected<br/>
                CNC is on execution.
            </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>
    </option>

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

    <mode>
        <cmn>
            This function can be used in any CNC mode.
            But the MDI program can be registered in the MDI mode only.
        </cmn>
    </mode>

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

    <example>
    </example>

    </func>
</root>
