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

<root>
  <func>


    <title>cnc_rdpmacror2</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdpmacror2( unsigned short FlibHndl, unsigned long stnum, unsigned long *num, unsigned short type, double *mcval);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the P code macro variables(variables for the macro-executor) specified by the starting number, "stnum", and number of variables, "*num".  The data is stored in "mcval" with double format. It is not influenced by setting of <a href="ncdata/cnc_setpmactype.htm" target="_parent">cnc_setpmactype</a> function.</p>

            <p>The value of an undefined variable is called "vacant", and it is expressed as follows.</p>

            <p class="dd">0xFFFFFFFFFFFFFFFF</p>

            <p>See the "PROGRAMING MANUAL" of the macro-executor for details of the P code macro variable.</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>stnum</name>
                    <type>in</type>
                    <content>
                        <p>Specify the starting P code macro variable number.<br/>
                           Please refer to the document of the <a href="ncdata/cnc_rdpmacroinfo2.htm" target="_parent">cnc_rdpmacroinfo2</a> for the range of variable.</p>
                    </content>
                </item>
                <item>
                    <name>num</name>
                    <type>in</type>
                    <content>
                        <p>Specify the number of P code macro variables to be read.<br/>
                        This function returns the total number of variables that was actually read.</p>
                    </content>
                </item>
                <item>
                    <name>type</name>
                    <type>in</type>
                    <content>
                        Specify the type of macro variables to be read from followings.
                        <table class="dd">
                            <tr><td>0</td><td>:</td><td>conversation</td></tr>
                            <tr><td>1</td><td>:</td><td>auxiliary   </td></tr>
                            <tr><td>2</td><td>:</td><td>execution   </td></tr>
                        </table>
                        * This setting is ignored in case of P code macro variables, 10000,..,89999 and the variables for High-speed cycle cutting.
                    </content>
                </item>
                <item>
                    <name>mcval</name>
                    <type>out</type>
                    <content>
                        <p>Specify the array for read P code macro variables.<br/>
                           When the variable is "vacant", the 0xFFFFFFFFFFFFFFFF is set.</p>
                    </content>
                </item>
            </cmn>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>Data block length error<br/>The number of P code macro variables(*num) is 0 or less.</content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>Data number error<br/>P code macro variable number(stnum) is wrong.</content>
        </item>
        <item>
            <name>EW_ATTRIB</name>
            <content>Data attribute error<br/>Type of P code macro variables(type) is wrong.</content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>No option<br/>This function needs the macro-executor option.</content>
        </item>
        <add></add>
    </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 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>
        <need>The macro-executor function.</need>
    </option>



    <parameter>
        <add>
            <p>But, this function is related to the compile parameter of the macro-executor. See the "PROGRAMING MANUAL" of the macro-executor for details of the compile parameter.</p>
        </add>
    </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>
        <add><b></b></add>

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



    <reference>
        <item>
            <name>cnc_rdpmacro</name>
            <file>ncdata/cnc_rdpmacro.htm</file>
        </item>
        <item>
            <name>cnc_wrpmacro</name>
            <file>ncdata/cnc_wrpmacro.htm</file>
        </item>
        <item>
            <name>cnc_rdpmacror</name>
            <file>ncdata/cnc_rdpmacror.htm</file>
        </item>
        <item>
            <name>cnc_wrpmacror</name>
            <file>ncdata/cnc_wrpmacror.htm</file>
        </item>
        <item>
            <name>cnc_wrpmacror2</name>
            <file>ncdata/cnc_wrpmacror2.htm</file>
        </item>
        <item>
            <name>cnc_rdpmacroinfo</name>
            <file>ncdata/cnc_rdpmacroinfo.htm</file>
        </item>
        <item>
            <name>cnc_rdpmacroinfo2</name>
            <file>ncdata/cnc_rdpmacroinfo2.htm</file>
        </item>
        <item>
            <name>cnc_getpmactype</name>
            <file>ncdata/cnc_getpmactype.htm</file>
        </item>
        <item>
            <name>cnc_setpmactype</name>
            <file>ncdata/cnc_setpmactype.htm</file>
        </item>
    </reference>



    <example>
<vc>
The method of judging "vacant" data.

#include "fwlib32.h"

short example( void )
{
    short       ret;
    unsigned long   s_no;
    unsigned long   num;
    unsigned short  type = 0;
    double      mcval;
    long        *rval;
    long        lval;
    long        hval;

    num = 1;
    ret = cnc_rdpmacror2( Hndl, s_no, &#38;num, type, &#38;mcval );
    rval = (long*)&#38;mcval;
    lval = (long)(*rval++);
    hval = (long)(*rval);
    if (( lval == (long)0xffffffff ) &#38;&#38; ( hval == (long)0xffffffff )) { 
        ; // "vacant"
    }

}
</vc>
    </example>


  </func>
</root>
