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

<root>
  <func>
    <title>cnc_rdsvmeter</title>


    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdsvmeter(unsigned short FlibHndl, short *data_num, ODBSVLOAD *loadmeter);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the servo load meter data from 1st axis to the specified axis number.</p>
            <p>In case that "*data_num" is bigger than the servo axis number, this function sets the actual read axis number (the servo axis number) to "*data_num" variable after execution. And in case that "*data_num" is smaller than the servo axis number, this function reads data for the specified axis number which is specified by "*data_num".</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>data_num</name>
                    <type>in / out</type>
                    <content>
                        <p>
                            Specify the pointer to the number of data to be read. This function returns the number of data which was read actually.
                        </p>
                    </content>
                </item>
                <item>
                    <name>loadmeter</name>
                    <type>out</type>
                    <content>
                        <p>Specify the pointer to the array of ODBSVLOAD structure to store the servo load meter data. The number of array must be equal to "*data_num". The ODBSVLOAD structure is as follows.</p>
<pre>
typedef struct odbsvload {
    LOADELM     svload;     /* servo load meter data */
} ODBSVLOAD ;
</pre>
                        <dl>
                            <dt>svload</dt>
                            <dd>The LOADELM structure for servo load meter data</dd>
                        </dl>
                        <p>And the LOADELM structure is as follows.</p>
<pre>
typedef struct loadelm {
    long    data;    /* load meter data */
    short   dec;     /* place of decimal point */
    short   unit;    /* unit */
    char    name;    /* axis name */
    char    suff1;   /* subscript of axis name 1 */
    char    suff2;   /* subscript of axis name 2 */
    char    reserve; /* */
} LOADELM;
</pre>
                        <dl>
                            <dt>data</dt>
                            <dd>Load meter data </dd>
                            <dt>dec</dt>
                            <dd>Place of decimal point </dd>
                            <dt>unit</dt>
                            <dd>Unit <br/>Always 0 (=%)</dd>
                            <dt>name</dt>
                            <dd>Axis name (ASCII)</dd>
                            <dt>suff1</dt>
                            <dd>Subscript of axis name(ASCII)</dd>
                            <dt>suff2</dt>
                            <dd>Not used </dd>
                        </dl>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>
                Data block length error<br/>
                The axis number (*data_num) is 0 or less.
            </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 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>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</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>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</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>X</fs16i>
            <fs18i>X</fs18i>
        </w>
        <pw>
            <d>E</d>
            <h>E</h>
        </pw>
        <add><b></b></add>
    </support>



    <reference>
    </reference>



    <example>
        <vc>
<pre>
The following program reads all servo load meter data, and displays them.

#include "fwlib32.h"

void example( void )
{
        ODBSVLOAD sv[MAX_AXIS];
        short num = MAX_AXIS;
        short ret = cnc_rdsvmeter(h, &#38;num, sv);
        if(!ret) {
                int i;
                for(i = 0 ; i &#60; num ; i++) {
                        printf("%c = %d\n", sv[i].svload.name, sv[i].svload.data);
                }
        }
}
</pre>
        </vc>
    </example>



  </func>
</root>
