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

<root>
  <func>


    <title>cnc_rdparam_ext</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdparam_ext(unsigned short FlibHndl, long *prm_no, short num, IODBPRM *param);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the random number parameters. The parameter numbers are specified by the array of long type ("prm_no[]"). And the number of the array is specified by "num".</p>
            <p>The information of parameters is stored to the array of IODBPRM structure. If an invalid parameter number is specified, the <b>type</b> field of the IODBPRM structure is <b>-1</b>. In case of non-axis type parameter, the parameter value is stored to the <b>data[0]</b> of the IODBPRM structure. And, in case of axis-type parameter, the parameter value is stored to the <b>data</b> array of the structure.</p>

            <p>All parameter values are stored to long type. So your application have to cast them according to the type information.</p>

            <p>See the "PARAMETER MANUAL" of CNC for details of each parameter.</p>

            <p class="info">The spindle parameters have an axis attribute, and the data for number of spindle are valid.</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>prm_no</name>
                    <type>in</type>
                    <content>
                        <p>Specify the pointer to the array of the parameter numbers.</p>

                        <p>See the "PARAMETER MANUAL" of CNC about available parameter number.<br/>
                          It can be got by <a href="ncdata/cnc_rdparanum.htm" target="_parent">cnc_rdparanum</a> function and <a href="ncdata/cnc_rdparainfo.htm" target="_parent">cnc_rdparainfo</a> function.
                        </p>
                    </content>
                </item>
                <item>
                    <name>num</name>
                    <type>in</type>
                    <content>
                        <p>Specify the number of the parameters to be read. </p>
                    </content>
                </item>
                <item>
                    <name>param</name>
                    <type>out</type>
                    <content>
                        <p>Specify the pointer to the array of IODBPRM structure to store the parameters. The number of array must be equal to "num". The IODBPRM structure is as follows.</p>

<pre>
typedef struct iodbprm {
        long datano;        /* parameter number */
        short type;         /* type information */
        short axis;         /* axis information */
        short info;         /* attribute */
        short unit;         /* unit */
        struct {
            long prm_val;   /* parameter value */
            long dec_val;   /* place of decimal point */
        } data[32];
} IODBPRM;
</pre>

                        <dl>
                            <dt>datano</dt>
                            <dd>Parameter number which was read is stored.</dd>
                            <dt>type</dt>
                            <dd>Type information of parameter which was read is stored.</dd>
                            <dd>
                                <table class="dd">
                                    <tr>
                                        <td>0</td>
                                        <td>:</td>
                                        <td>bit type</td>
                                    </tr>
                                    <tr>
                                        <td>1</td>
                                        <td>:</td>
                                        <td>byte type</td>
                                    </tr>
                                    <tr>
                                        <td>2</td>
                                        <td>:</td>
                                        <td>word type</td>
                                    </tr>
                                    <tr>
                                        <td>3</td>
                                        <td>:</td>
                                        <td>2-word type</td>
                                    </tr>
                                    <tr>
                                        <td>4</td>
                                        <td>:</td>
                                        <td>real type <span class = "xis">( Series 150i, 300i )</span></td>
                                    </tr>
                                    <tr>
                                        <td>-1</td>
                                        <td>:</td>
                                        <td>invalid parameter</td>
                                    </tr>
                                </table>
                            </dd>
                            <dt>axis</dt>
                            <dd>Axis information of parameter which was read is stored.
                                <table class="dd">
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <tr>
                                        <td>bit 0</td>
                                        <td>:</td>
                                        <td>axis attribute 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>without axis </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>with axis </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 1</td>
                                        <td>:</td>
                                        <td>spindle parameter 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>no spindle </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>spindle </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 2,..,15</td>
                                        <td>:</td>
                                        <td>(reserve)</td>
                                    </tr>
                                </table>
                            </dd>
                            <dt>info</dt>
                            <dd>Attribute of parameter which was read is stored.
                                <table class="dd">
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <tr>
                                        <td>bit 0</td>
                                        <td>:</td>
                                        <td>sign 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>with sign </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>without sign </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 1</td>
                                        <td>:</td>
                                        <td>settings input 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>disable </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>enable </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 2</td>
                                        <td>:</td>
                                        <td>write protection 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>enable </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>disable </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 3</td>
                                        <td>:</td>
                                        <td>power must be off after writing 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>not necessary </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>necessary </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 4</td>
                                        <td>:</td>
                                        <td>read protection 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>enable </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>disable </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 5,..,15</td>
                                        <td>:</td>
                                        <td>(reserve)</td>
                                    </tr>
                                </table>
                            </dd>
                            <dt>unit</dt>
                            <dd>Unit of real type parameter which was read is stored.
                                <table class="dd">
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <tr>
                                        <td>bit 0, 1</td>
                                        <td>:</td>
                                        <td>attribute 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>no real type </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>input unit </td>
                                                </tr>
                                                <tr>
                                                    <td>2</td>
                                                    <td>:</td>
                                                    <td>output unit </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 2,..,4</td>
                                        <td>:</td>
                                        <td>unit 
                                            <table class="dd">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>without unit </td>
                                                </tr>
                                                <tr>
                                                    <td>1</td>
                                                    <td>:</td>
                                                    <td>unit of length </td>
                                                </tr>
                                                <tr>
                                                    <td>2</td>
                                                    <td>:</td>
                                                    <td>unit of angle </td>
                                                </tr>
                                                <tr>
                                                    <td>3</td>
                                                    <td>:</td>
                                                    <td>unit of length + angle </td>
                                                </tr>
                                                <tr>
                                                    <td>4</td>
                                                    <td>:</td>
                                                    <td>unit of velocity </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>bit 5,..,15</td>
                                        <td>:</td>
                                        <td>(reserve)</td>
                                    </tr>
                                </table>
                            </dd>
                            <dt>data</dt>
                            <dd>Value of parameter which was read is stored.
                                <table class="dd">
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <colgroup valign="top"/>
                                    <tr>
                                        <td>prm_val</td>
                                        <td>:</td>
                                        <td>Value of parameter </td>
                                    </tr>
                                    <tr>
                                        <td>dec_val</td>
                                        <td>:</td>
                                        <td>Place of decimal point (only available for real type)</td>
                                    </tr>
                                </table>
                            </dd>
                        </dl>

                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>
                Data block length error<br/>The number of parameters (num) is 0 or less.
            </content>
        </item>
        <item class="xis">
            <name>EW_PASSWD</name>
            <content>Specified parameter cannot be read because the data is protected.<br/>( Series 160i/180i/210i, 0i )</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>
    </parameter>



    <mode>
    </mode>



    <support>
        <m>
              <fs0ia>X</fs0ia>
            <fs0ib>E</fs0ib>
            <fs15>X</fs15>
            <fs15i>E</fs15i>
            <fs16>X</fs16>
            <fs18>X</fs18>
            <fs21>X</fs21>
            <fs16ia>E</fs16ia>
            <fs18ia>E</fs18ia>
            <fs21ia>E</fs21ia>
            <fs16ib>E</fs16ib>
            <fs18ib>E</fs18ib>
            <fs21ib>E</fs21ib>
            <fs30i>O</fs30i>
        </m>
        <t>
              <fs0ia>X</fs0ia>
            <fs0ib>E</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>X</fs16>
            <fs18>X</fs18>
            <fs21>X</fs21>
            <fs16ia>E</fs16ia>
            <fs18ia>E</fs18ia>
            <fs21ia>E</fs21ia>
            <fs16ib>E</fs16ib>
            <fs18ib>E</fs18ib>
            <fs21ib>E</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>E</fs16i>
            <fs18i>E</fs18i>
        </p>
        <l>
            <fs16i>E</fs16i>
            <fs18i>X</fs18i>
        </l>
        <w>
            <fs16i>E</fs16i>
            <fs18i>E</fs18i>
        </w>
        <pw>
            <d>E</d>
            <h>E</h>
        </pw>
        <add><b></b></add>

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



    <reference>
        <item>
            <name>cnc_rdparam</name>
            <file>ncdata/cnc_rdparam.htm</file>
        </item>
        <item>
            <name>cnc_wrparam</name>
            <file>ncdata/cnc_wrparam.htm</file>
        </item>
        <item>
            <name>cnc_rdparar</name>
            <file>ncdata/cnc_rdparar.htm</file>
        </item>
        <item>
            <name>cnc_wrparas</name>
            <file>ncdata/cnc_wrparas.htm</file>
        </item>
        <item>
            <name>cnc_rdparainfo</name>
            <file>ncdata/cnc_rdparainfo.htm</file>
        </item>
        <item>
            <name>cnc_rdparanum</name>
            <file>ncdata/cnc_rdparanum.htm</file>
        </item>
    </reference>



    <example>
<vc>
The following program reads the parameter No.20 and No.1020, and displays them.

#include "fwlib32.h"

void example()
{
        IODBPRM prm[2];
        long prmno[2];

        prmno[0] = 20;
        prmno[1] = 1020;
        ret = cnc_rdparam_ext( h, prmno, 2, prm ) ;
        if ( !ret ) {
                printf( "No.20: = %d\n", prm[0].data[0].prm_val );

                printf( "No.1020:\n" );
                printf( "  1st axis = %d\n", prm[1].data[0].prm_val );
                printf( "  2nd axis = %d\n", prm[1].data[1].prm_val );
                printf( "  3rd axis = %d\n", prm[1].data[2].prm_val );
        }
}
</vc>
    </example>



  </func>
</root>
