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

<root>
  <func>


    <title>cnc_rdalmhistry3</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdalmhistry3(unsigned short FlibHndl, unsigned short s_no, unsigned short e_no, unsigned short length, ODBAHIS3 *his);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>
                Reads the alarm history data.
                The unit of one alarm history data is called a record.
            </p>
            <p></p>
            <p>
                The operation history data and the alarm history data are automatically
                recorded on the CNC.  When these data are accessed, it is necessary to
                temporarily stop sampling on the CNC.
                Therefore, it is necessary to execute "Stop logging operation history
                data"(<a href="History/cnc_stopophis.htm" target="_parent">cnc_stopophis</a>) 
                before this function is used.
            </p>
            <p></p>
            <p>
                And it is necessary to execute "Restart logging operation history data"
                (<a href="History/cnc_startophis.htm" target="_parent">cnc_startophis</a>) 
                after reading to make the sampling stop time of the
                history data as short as possible.
            </p>
            <p></p>
            <p>
                The start/end record number means the relative number uesd at reading
                the alarm history data.  These record numbers are valid only at the
                period from the execution of "Stop logging operation history data"
                until the execution of "Restart logging operation history data".
            </p>
            <p>The alarm history data is acquired in old order.</p>
        </cmn>
    </doc>



    <argument>
        <hssb>
            <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>s_no</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the start record number. (specify 1 or more.)
                        </p>
                    </content>
                </item>
                <item>
                    <name>e_no</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the end record number. (specify 1 or more.)
                        </p>
                    </content>
                </item>
                <item>
                    <name>length</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the data block length. (size of ODBAHIS3 structure)
                        </p>
                        <img src="History/almhis3_vc.gif"></img><br/>
                    </content>
                </item>
                <item>
                    <name>his</name>
                    <type>out</type>
                    <content>
                        <p>
                            Pointer to the ODBAHIS3 structure in which the alarm history data is stored.
                            The ODBAHIS3 structure is as follows.
                        </p>
<pre>
typedef struct odbahis3 {
    unsigned short s_no;        /* Start record number      */
    short          type;        /* Not used                 */
    unsigned short e_no;        /* Most recently entered    */
                                /* record number            */
    struct {
        short      dummy;       /* Not used            */
        short      alm_grp;     /* Alarm type          */
        short      alm_no;      /* Alarm number        */
        char       axis_no;     /* Axis number         */
        char       year;        /* Year                */
        char       month;       /* Month               */
        char       day;         /* Day                 */
        char       hour;        /* Hour                */
        char       minute;      /* Minute              */
        char       second;      /* Second              */
        char       dummy2;      /* Not used            */
        short      len_msg;     /* Length of alarm     */
                                /* messafe             */
        char       alm_msg[36]; /* Alarm message       */
    } alm_his[N];   /* N : Number of record */
} ODBAHIS3 ;
</pre>
                        <dl>
                            <dt>alm_grp</dt>
                                <dd>unused</dd>
                            <dt>alm_no</dt>
                                <dd>Alarm number</dd>
                            <dt>axis_no</dt>
                                <dd>
                                    Axis number (1 - maximum axis control number)
                                    It is unused for an unrelated alarm to the axis.
                                </dd>
                            <dt>year</dt>
                                <dd>Year (0,..,99)<br/></dd>
                            <dt>month</dt>
                                <dd>Month (1,..,12)<br/></dd>
                            <dt>day</dt>
                                <dd>Day (1,..,31)</dd>
                            <dt>hour</dt>
                                <dd>Hour (0,..,23)<br/></dd>
                            <dt>minute</dt>
                                <dd>Minite (0,..,59)<br/></dd>
                            <dt>second</dt>
                                <dd>Second (0,..,59)<br/></dd>
                            <dt>len_msg</dt>
                                <dd>Number of characters of alarm message (0 - 33)<br/></dd>
                            <dt>alm_msg</dt>
                                <dd>Message string<br/></dd>
                         </dl>
                    </content>
                </item>
            </vc>
        </hssb>
    </argument>



    <errcode>
        <item>
            <name>EW_FUNC</name>
            <content>
                Unavailable<br/>
                <a href="History/cnc_stopophis.htm" target="_parent">cnc_stopophis</a> function has not been executed.
            </content>
        </item>
        <item>
            <name>EW_LENGTH</name>
            <content>
                Data block length error<br/>
                Size of ODBAHIS3 structure(length) is wrong.<br/>
                (e_no-s_no+1) * sizeof(data[0]) + 6 &gt; length<br/>
            </content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>
                Data number error<br/>
                The specification of the record number (s_no, e_no) is wrong.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
            </content>
        </item>
        <add></add>
    </errcode>



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



    <parameter>
    </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>H</fs16ia>
            <fs18ia>H</fs18ia>
            <fs21ia>H</fs21ia>
            <fs16ib>H</fs16ib>
            <fs18ib>H</fs18ib>
            <fs21ib>H</fs21ib>
            <fs30i>X</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>H</fs16ia>
            <fs18ia>H</fs18ia>
            <fs21ia>H</fs21ia>
            <fs16ib>H</fs16ib>
            <fs18ib>H</fs18ib>
            <fs21ib>H</fs21ib>
            <fs30i>X</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>H</fs16i>
            <fs18i>H</fs18i>
        </p>
        <l>
            <fs16i>H</fs16i>
            <fs18i>X</fs18i>
        </l>
        <w>
            <fs16i>X</fs16i>
            <fs18i>X</fs18i>
        </w>
        <pw>
            <d>X</d>
            <h>X</h>
        </pw>
    </support>



    <reference>
    </reference>



    <example>
    </example>



  </func>
</root>
