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

<root>
  <func>


    <title>cnc_rdalmhistry4</title>



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



    <doc>
        <cmn>
            <p>
                Reads the alarm history data.
            </p>
            <p>
                Please use this function instead of <a href="History/cnc_rdalmhistry.htm" target="_parent">cnc_rdalmhistry</a>
                for Series 300i.
            </p>
            <p>The unit of one alarm history data is called a record.</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>
                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>
                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>
        <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>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 ODBAHIS4 structure)
                        </p>
                        <img src="History/rdalmhistry4.gif"></img><br/>
                    </content>
                </item>
                <item>
                    <name>his</name>
                    <type>out</type>
                    <content>
                        <p>
                            Pointer to the ODBAHIS4 structure in which the alarm history data is stored.
                            The ODBAHIS4 structure is as follows.
                        </p>
<pre>
typedef struct odbahis4 {
    unsigned short  s_no;       /* Start record number     */
    unsigned short  e_no;       /* Most recently entered   */
    struct {
        short   alm_grp;        /* Alarm type              */
        short   alm_no;         /* Alarm number            */
        short   axis_no;        /* Axis number             */
        short   year;           /* Year                    */
        short   month;          /* Month                   */
        short   day;            /* Day                     */
        short   hour;           /* Hour                    */
        short   minute;         /* Minute                  */
        short   second;         /* Second                  */
        short   len_msg;        /* Length of alarm message */
        short   pth_no;         /* path number             */
        short   dummy;
        char    alm_msg[64];    /* alarm message           */
    } alm_his[N];               /* N : number of alarm history data to be read */
} ODBAHIS4 ;
</pre>
                        <dl>
                            <dt>alm_grp</dt>
                            <dd>Alarm type</dd>
                            <dd><table border="0" class="dd">
                                <tr><td>0 </td> <td>:</td> <td>Parameter switch on</td>        <td>(SW)</td> </tr>
                                <tr><td>1 </td> <td>:</td> <td>Power off parameter set</td>    <td>(PW)</td> </tr>
                                <tr><td>2 </td> <td>:</td> <td>I/O error</td>                  <td>(IO)</td> </tr>
                                <tr><td>3 </td> <td>:</td> <td>Foreground P/S</td>             <td>(PS)</td> </tr>
                                <tr><td>4 </td> <td>:</td> <td>Overtravel,External data</td>   <td>(OT)</td> </tr>
                                <tr><td>5 </td> <td>:</td> <td>Overheat alarm</td>             <td>(OH)</td> </tr>
                                <tr><td>6 </td> <td>:</td> <td>Servo alarm</td>                <td>(SV)</td> </tr>
                                <tr><td>7 </td> <td>:</td> <td>Data I/O error</td>             <td>(SR)</td> </tr>
                                <tr><td>8 </td> <td>:</td> <td>Macro alarm</td>                <td>(MC)</td> </tr>
                                <tr><td>9 </td> <td>:</td> <td>Spindle alarm</td>              <td>(SP)</td> </tr>
                                <tr><td>10</td> <td>:</td> <td>Other alarm(DS)</td>            <td>(DS)</td> </tr>
                                <tr><td>11</td> <td>:</td> <td>Alarm concerning Malfunction prevent functions</td> <td>(IE)</td> </tr>
                                <tr><td>12</td> <td>:</td> <td>Background P/S</td>             <td>(BG)</td> </tr>
                                <tr><td>13</td> <td>:</td> <td>Syncronized error</td>          <td>(SN)</td> </tr>
                                <tr><td>14</td> <td>:</td> <td>(reserved)</td>                 <td></td>     </tr>
                                <tr><td>15</td> <td>:</td> <td>External alarm message</td>     <td>(EX)</td> </tr>
                                <tr><td>16</td> <td>:</td> <td>(reserved)</td>                 <td></td>     </tr>
                                <tr><td>17</td> <td>:</td> <td>(reserved)</td>                 <td></td>     </tr>
                                <tr><td>18</td> <td>:</td> <td>(reserved)</td>                 <td></td>     </tr>
                                <tr><td>19</td> <td>:</td> <td>PMC error</td>                  <td>(PC)</td> </tr>
                            </table>
                            <table class="dd">
                                <tr><td>20 to 31</td> <td>:</td> <td>(Not used)</td> </tr>
                            </table>
                            </dd>
                            <dt>alm_no</dt>
                            <dd>Alarm number</dd>
                            <dt>axis_no</dt>
                            <dd>
                                Axis number(from 1 to maximum controlled axis)
                                or Spindle number(from 1 to maximum spindle number)<br/>
                                <b>0</b> is stored for an unrelated alarm to the axis and the spindle.
                            </dd>
                            <dt>year</dt>
                            <dd>Year   (1995,..,2094)</dd>
                            <dt>month</dt>
                            <dd>Month  (1,..,12)</dd>
                            <dt>day</dt>
                            <dd>Day   (1,..,31)</dd>
                            <dt>hour</dt>   
                            <dd>Hour   (0,..,23)</dd>
                            <dt>minute</dt> 
                            <dd>Minute (0,..,59)</dd>
                            <dt>second</dt> 
                            <dd>Second (0,..,59))</dd>
                            <dt>len_msg</dt>
                            <dd>Length of alarm message (0,..,64)</dd>
                            <dt>pth_no</dt>
                            <dd>path number(0,..,9)</dd>
                            <dt>alm_msg</dt>
                            <dd>Alarm message</dd>
                        </dl>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_FUNC</name>
            <content>
                <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 ODBAHIS4 structure(length) is wrong.<br/>
                    (e_no-s_no+1) * sizeof(data[0]) + 4 > length    
            </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/>
                The extended driver/library function is necessary.
            </content>
        </item>
    </errcode>



    <option>
        <hssb>
            This function needs the extended driver/library function.
        </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>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>
    </support>



    <reference>
    </reference>



    <example>
    </example>



  </func>
</root>
