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

<root>
  <func>


    <title>cnc_wrpdf_line</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_wrpdf_line(unsigned short FlibHndl, char *prog_name, unsigned long line_no,
                  char *prog_data, unsigned long data_len);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Writes the NC program by line basis.</p>
            <p>
               You cannot change a program file name in the top of the program.<br/>
               If you try to change it, you get EW_DATA ad the return code.
            </p>
            <p>The conditions of the function about CNC mode and the kind of program are as follows.<br/>
                <table border="1" class="dd">
                    <tr><td></td><td>EDIT mode</td><td>MDI mode</td><td>Other mode</td></tr>
                    <tr><td>MDI program</td>            <td>&#215;</td><td>O</td><td>&#215;</td></tr>
                    <tr><td>Selected program</td>       <td>O</td><td>&#215;</td><td>&#215;</td></tr>
                    <tr><td>Not selected program</td>   <td>O</td><td>O</td><td>O</td></tr>
                </table>
               <span class="dd">O: Available / &#215;: Not available (The return code is EW_MODE)</span>
            </p>
            <p>If you have the playback option, TJOG/THND mode is the same as EDIT.</p>
            <p>This function works normally if OP signal is 1 but STL signal is 0
               (for example, feed hold stopping, single block stopping, etc).
            </p>
            <p>When you use this function for the MDI program or the selected program in the following situations, the execution pointer goes to the top of line specified by line_no.<br/>
                <ul>
                <li>MDI program in MDI mode.</li>
                <li>Selected program in EDIT mode.</li>
                <li>Selected program in TJOG/THND mode with the playback option.</li>
                </ul>
            </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>prog_name</name>
                    <type>in</type>
                    <content>
                        <p>
                            Program path makes of the &quot;drive name&quot;,&quot;path name&quot; and &quot;file name&quot;. <br/>
                            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 file name.<br/>
                            If the value of &quot;prog_name&quot; is NULL, the previous progaram name is specifed.<br/>
                            When you use this function for the MDI program , you have to be specifed the &quot;MDI&quot;. 
                        </p>
                    </content>
                </item>
                <item>
                    <name>line_no</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the line number to write.<br/>
                            When you write to the first line of a program, you have to specify 0.
                        </p>
                    </content>
                </item>
                <item>
                    <name>prog_data</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the pointer to the buffer holding the program text.<br/>
                            According to the following attentions, full the buffer with ASCII codes before writing.
                            <ul style="margin-top:0;margin-bottom:0">
                                <li>Do not use except the meaning code for CNC.</li>
                                <li>Do not use the small letter of alphabets.</li>
                                <li>Do not use '%' (EOR).</li>
                            </ul>
                            Although there are several EOB('\n') in the buffer, you can only replace the one line. In other words, you can replace one line with several lines using several EOB in the program text to write.
                        </p>
                    </content>
                </item>
                <item>
                    <name>data_len</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the size of character to write.<br/>
                            This function checks the free area in CNC memory beforewriting.
                            If there is no more than (this character size + 100) in this area, 
                            this function returns EW_OVRFLOW as the return code without writing.<br/>
                            The character number you can write at the once is up to 200.
                        </p>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_BUSY</name>
            <content>
                Busy<br/>
                CNC is searching the program text right now.
            </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.<br/>
                <table>
                    <tr><td>1</td><td>:</td><td>The program name(prog_name) error</td></tr>
                    <tr><td>2</td><td>:</td><td>The line number(line_no) error</td></tr>
                    <tr><td>3</td><td>:</td><td>The character size(data_len) error</td></tr>
                    <tr><td>4</td><td>:</td><td>O number would be changed</td></tr>
                    <tr><td>5</td><td>:</td><td>The first character of string is illegal</td></tr>
                    <tr><td>6</td><td>:</td><td>Error happens when deleting line</td></tr>
                    <tr><td>7</td><td>:</td><td>Error happens when writing program</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 protection in CNC side<br/>
                CNC parameter is a state of write-protection(O8000-/O9000- protection, encoding). 
            </content>
        </item>
        <item>
            <name>EW_OVRFLOW</name>
            <content>
                Memory overflow<br/>
                It is lack of free area in CNC memory.<br/>
                Make enough free area in CNC memory. 
            </content>
        </item>
        <item>
            <name>EW_MODE</name>
            <content>
                CNC mode error<br/>
            </content>
        </item>
        <item>
            <name>EW_REJECT</name>
            <content>
                CNC execution denied<br/>
                MDI edit or Background edit processing in CNC side.
            </content>
        </item>
    </errcode>



    <option>
        <hssb>The extended driver/library function is necessary.</hssb>
    </option>



    <parameter></parameter>



    <mode>
        <cmn>
            See the above description.
        </cmn>
    </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>H</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>H</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>
                <fs30is>O</fs30is>
            </m>
            <t>
                <fs30is>O</fs30is>
            </t>
        </is>
    </support>



    <reference>
        <item>
            <name>cnc_rdpdf_line</name>
            <file>Program/cnc_rdpdf_line.htm</file>
        </item>
        <item>
            <name>cnc_del_pdfline</name>
            <file>Program/cnc_pdf_delline.htm</file>
        </item>
        <item>
            <name>cnc_pdf_searchword</name>
            <file>Program/cnc_pdf_searchword.htm</file>
        </item>
        <item>
            <name>cnc_pdf_searchresult</name>
            <file>Program/cnc_pdf_searchresult.htm</file>
        </item>
    </reference>



    <example></example>



  </func>
</root>
