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

<root>
  <func>


    <title>cnc_rdophistry</title>



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



    <doc>
        <cmn>
            <p>Reads the operation history data.<br/>
                Please use <a href="History/cnc_rdophistry2.htm" target="_parent">cnc_rdophistry2</a> function instead of this function for Series 150i.<br/>
                Also please use <a href="History/cnc_rdophistry4.htm" target="_parent">cnc_rdophistry4</a> function for Series 300i.
            </p>
            <p>
                It is necessary to execute <a href="History/cnc_stopophis.htm" target="_parent">cnc_stopophis</a> function before this function is used.<br/>
                And it is necessary to execute <a href="History/cnc_startophis.htm" target="_parent">cnc_startophis</a> function after reading data as short as possible.
            </p>
            <p>
                The structure of the operation history data is different according to the kind of the record(rec_type).
                When the operation history data is accessed, it is necessary to use a structure corresponding to the kind.
            </p>
            <p>
                The start/end record number means the relative number uesd at reading
                the operation history data.  These record numbers are valid only at the
                period from the execution of <a href="History/cnc_stopophis.htm" target="_parent">cnc_stopophis</a> function
                until the execution of <a href="History/cnc_startophis.htm" target="_parent">cnc_startophis</a> function.
            </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.(more than 1)
                        </p>
                    </content>
                </item>
                <item>
                    <name>e_no</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the end record number.(more than 1)
                        </p>
                    </content>
                </item>
                <item>
                    <name>length</name>
                    <type>in</type>
                    <content>
                        <p>
                            Specify the data block length(size of ODBHIS structure).<br/>
                        </p>
                        <img src="History/ophis_vc.gif"></img><br/>
                        <img src="History/recalm_vc.gif"></img><br/>
                        <img src="History/recmdi_vc.gif"></img><br/>
                        <img src="History/recsig_vc.gif"></img><br/>
                        <img src="History/recdate_vc.gif"></img><br/>
                        <img src="History/rectime_vc.gif"></img>
                    </content>
                </item>
                <item>
                    <name>his</name>
                    <type>out</type>
                    <content>
                        <p>
                            Pointer to the ODBHIS structure in which the operation history data is stored.
                            The ODBHIS structure is as follows.
                        </p>
<pre>
typedef struct odbhis {
    unsigned   s_no;                /* Start record number      */
    short      type;                /* Not used                 */
    unsigned   e_no;                /* Most recently entered    */
                                    /* record number            */
    union {
        struct {
            short      rec_type;    /* Record type            */
            short      alm_grp;     /* Alarm type             */
            short      alm_no;      /* Alarm number           */
            char       axis_no;     /* Axis number            */
            char       dummy;       /* Not used               */
        } rec_alm;                  /* Structure of alarm     */
                                    /* record                 */
        struct {
            short      rec_type;    /* Record type            */
            char       key_code;    /* Key code               */
            char       pw_flag;     /* Power-on flag          */
            char       dummy[4];    /* Not used               */
        } rec_mdi;                  /* Structure of           */
                                    /* MDI key record         */
        struct {
            short      rec_type;    /* Record type            */
            char       sig_name;    /* Signal name            */
            char       sig_old;     /* Bit pattern before a   */
                                    /* transition             */
            char       sig_new;     /* Bit pattern after a    */
                                    /* transition             */
            char       dummy;       /* Not used               */
            short      sig_no;      /* Signal number          */
        } rec_sgn;                  /* Structure of signal    */
                                    /* record                 */
        struct {
            short      rec_type;    /* Record type            */
            char       year;        /* Year                   */
            char       month;       /* Month                  */
            char       day;         /* Day                    */
            char       pw_flag;     /* Power-on flag          */
            char       dummy[2];    /* Not used               */
        } rec_date;                 /* Structure of date      */
                                    /* record                 */
        struct {
            short      rec_type;    /* record type            */
            char       hour;        /* Hour                   */
            char       minute;      /* Minute                 */
            char       second;      /* Second                 */
            char       pw_flag;     /* Power-on flag          */
            char       dummy[2];    /* Not used               */
        } rec_time;                 /* Structure of Time      */
                                    /* record                 */
    } data[N];                      /* N : Number of record */
} ODBHIS ;
</pre>
                        <dl>
                        <dt>rec_type</dt>
                    <dd>Record type</dd>
                        <table class="dd">
                                <tr>
                                    <td>0</td>
                                    <td>:</td>
                                    <td>MDI key history</td>
                                </tr>
                                <tr>
                                    <td>1</td>
                                    <td>:</td>
                                    <td>Signal history</td>
                                </tr>
                                <tr>
                                    <td>2</td>
                                    <td>:</td>
                                    <td>Alarm history</td>
                                </tr>
                                <tr>
                                    <td>3</td>
                                    <td>:</td>
                                    <td>Date history</td>
                                </tr>
                                <tr>
                                    <td>4</td>
                                    <td>:</td>
                                    <td>Time history</td>
                                </tr>
                                <tr>
                                    <td>5</td>
                                    <td>:</td>
                                    <td>MDI key history for SUB  (only Series 160/180/210, Power Mate i)</td>
                                </tr>
                                <tr>
                                    <td>6</td>
                                    <td>:</td>
                                    <td>Signal history for SUB  (only Series 160/180/210, Power Mate i)</td>
                                </tr>
                                <tr>
                                    <td>7</td>
                                    <td>:</td>
                                    <td>Alarm history for SUB  (only Series 160/180/210, Power Mate i)</td>
                                </tr>
                                <tr>
                                    <td>10</td>
                                    <td>:</td>
                                    <td>MDI key history for 3rd Path  (only Series 160i)</td>
                                </tr>
                                <tr>
                                    <td>11</td>
                                    <td>:</td>
                                    <td>Signal history for 3rd Path  (only Series 160i)</td>
                                </tr>
                                <tr>
                                    <td>12</td>
                                    <td>:</td>
                                    <td>Alarm history for 3rd Path  (only Series 160i)</td>
                                </tr>
                            </table>
                            <dt>alm_grp</dt>
                    <dd>Alarm type</dd>
                <ul type="disc"><li>Series 150 (HSSB only)</li></ul>
                    <table class="dd">
                <tr>
                        <td>bit 0</td>
                        <td>:</td>
                                    <td>Background P/S</td>
                                    <td>(BG)</td>
                                </tr>
                <tr>
                        <td>bit 1</td>
                        <td>:</td>
                                    <td>Foreground P/S</td>
                                    <td>(PS)</td>
                                </tr>
                <tr>
                        <td>bit 2</td>
                        <td>:</td>
                                    <td>Over heat alarm</td>
                                    <td>(OH)</td>
                                </tr>
                <tr>
                        <td>bit 3</td>
                        <td>:</td>
                                    <td>Sub-CPU error</td>
                                    <td>(SB)</td>
                                </tr>
                <tr>
                        <td>bit 4</td>
                        <td>:</td>
                                    <td>Syncronized error</td>
                                    <td>(SN)</td>
                                </tr>
                <tr>
                        <td>bit 5</td>
                        <td>:</td>
                                    <td>Parameter switch on</td>
                                    <td>(SW)</td>
                                </tr>
                <tr>
                        <td>bit 6</td>
                        <td>:</td>
                                    <td>Over travel, external data</td>
                                    <td>(OT)</td>
                                </tr>
                <tr>
                        <td>bit 7</td>
                        <td>:</td>
                                    <td>PMC error</td>
                                    <td>(PC)</td>
                                </tr>
                <tr>
                        <td>bit 8</td>
                        <td>:</td>
                                    <td>External alarm message</td>
                                    <td>(EX)</td>
                                </tr>
                <tr>
                        <td>bit 9</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 10</td>
                        <td>:</td>
                                    <td>Serious P/S</td>
                                    <td>(SR)</td>
                                </tr>
                <tr>
                        <td>bit 11</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 12</td>
                        <td>:</td>
                                    <td>Servo alarm</td>
                                    <td>(SV)</td>
                                </tr>
                <tr>
                        <td>bit 13</td>
                        <td>:</td>
                                    <td>I/O error</td>
                                    <td>(IO)</td>
                                </tr>
                <tr>
                        <td>bit 14</td>
                        <td>:</td>
                                    <td>Power off parameter set</td>
                                    <td>(PW)</td>   
                                </tr>
                <tr>
                        <td>bit 15</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                            </table>
                            <p></p>
                            <ul type="disc">
                                <li>Series 160/180/210, 160i/180i/210i, 0i, Power Mate i</li>
                            </ul>
                <table class="dd">
                                <tr>
                        <td>bit 0</td>
                        <td>:</td>
                                    <td>P/S 100</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 1</td>
                        <td>:</td>
                                    <td>P/S 000</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 2</td>
                        <td>:</td>
                                    <td>P/S 101</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 3</td>
                        <td>:</td>
                                    <td>P/S others</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 4</td>
                        <td>:</td>
                                    <td>Over travel</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 5</td>
                        <td>:</td>
                                    <td>Over heat</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 6</td>
                        <td>:</td>
                                    <td>Servo alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 7</td>
                        <td>:</td>
                                    <td>System alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 8</td>
                        <td>:</td>
                                    <td>APC alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 9</td>
                        <td>:</td>
                                    <td>Spindle alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 10</td>
                        <td>:</td>
                                    <td>P/S 5000,.., Punch press alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 11</td>
                        <td>:</td>
                                    <td>Laser alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 12</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 13</td>
                        <td>:</td>
                                    <td>Rigid tap alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 14</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 15</td>
                        <td>:</td>
                                    <td>External alarm message</td>
                                    <td></td>
                                </tr>
                            </table>
                            <p></p>
                            <ul type="disc">
                                <li>Series 160i/180i-W</li>
                            </ul>
                <table class="dd">
                                <tr>
                        <td>bit 0</td>
                        <td>:</td>
                                    <td>P/S alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 1</td>
                        <td>:</td>
                                    <td>Overtravel alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 2</td>
                        <td>:</td>
                                    <td>Servo alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 3</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 4</td>
                        <td>:</td>
                                    <td>Overheat alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 5</td>
                        <td>:</td>
                                    <td>Stroke limit - 1</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 6</td>
                        <td>:</td>
                                    <td>Stroke limit - 2</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 7</td>
                        <td>:</td>
                                    <td>Edit alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 8</td>
                        <td>:</td>
                                    <td>APC alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 9</td>
                        <td>:</td>
                                    <td>System alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 10</td>
                        <td>:</td>
                                    <td>P/S 5000 ... alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 11</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 12</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 13</td>
                        <td>:</td>
                                    <td>(Not used)</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 14</td>
                        <td>:</td>
                                    <td>External alarm</td>
                                    <td></td>
                                </tr>
                <tr>
                        <td>bit 15</td>
                        <td>:</td>
                                    <td>Reverse control alarm</td>
                                    <td></td>
                                </tr>
                            </table>
                        <dt>alm_no</dt>
                            <dd>Alarm number</dd>
                        <dt>axis_no</dt>
                            <dd>Axis number(only Series 150)<br/>
                                <b>0</b> is stored for an unrelated alarm to the axis.
                            </dd>
                        <dt>key_code</dt>
                            <dd>Key code</dd>
                        <dt>pw_flag</dt>
                            <dd>Power-on flag<br/>
                                <ul> 1 : For power on<br/>
                                     0 : Usually, <b>0</b> is stored<br/>
                                </ul>
                            </dd>
                        <dt>sig_name</dt>
                            <dd>Signal name<br/>
                                <ul> 1 : X<br/>
                                     2 : G<br/>
                                     3 : Y<br/>
                                     4 : F<br/>
                                </ul>
                            </dd>
                        <dt>sig_old</dt>
                            <dd>Bit pattern before transition</dd>
                        <dt>sig_new</dt>
                            <dd>Bit pattern after transition</dd>
                        <dt>sig_no</dt>
                            <dd>Signal number<br/>
                                <ul> X : 0~127 or 1000~1063<br/>
                                     G : 0~255 or 1000~1255 or 2000~2255<br/>
                                     Y : 0~127 or 1000~1063<br/>
                                     F : 0~255 or 1000~1255 or 2000~2255<br/>
                                </ul>
                                In Series 160i/180i/210i MODEL B, when the extended operation history function exists:<br/>
                                <ul> X : 0~127 or 200~327 or 1000~1063<br/>
                                     G : 0~511 or 1000~1511 or 2000~2511<br/>
                                     Y : 0~127 or 200~327 or 1000~1063<br/>
                                     F : 0~511 or 1000~1511 or 2000~2511<br/>
                                </ul>                            </dd>
                        <dt>year</dt>
                            <dd>Year   (0~99)<br/></dd>
                        <dt>month</dt>
                            <dd>Month  (1~12)<br/></dd>
                        <dt>day</dt>
                            <dd>Date   (1~31)<br/></dd>
                        <dt>hour</dt>
                            <dd>Hour   (0~23)<br/></dd>
                        <dt>minute</dt>
                            <dd>Minute (0~59)<br/></dd>
                        <dt>second</dt>
                            <dd>Second (0~59)<br/></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.<br/>
            </content>
        </item>
        <item>
            <name>EW_LENGTH</name>
            <content>
                    Data block length error<br/>
                    Size of ODBHIS structure(length) is wrong.<br/>
                    (e_no-s_no+1) * sizeof(data[0]) + 6 &lt; 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/>
                The extended driver/library function is necessary.
            </content>
        </item>
        <add></add>
    </errcode>



    <option>
        <hssb>
            This function needs the extended driver/library function.
        </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, 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>
        <add><p>In case of Series 160i/180i/210i MODEL B, the extended operation history function is concerned.</p></add>
    </option>



    <parameter>
        <type>
            <ul>
                <li>Series 150</li>
                    0015#3=1
                <li>Series 160/180/210, 160i/180i/210i, 0i, Power Mate i</li>
                    3112#5=0 (must be set)
                <li>Series 160i/180i-W</li>
                    3112#5=1 (must be set)
            </ul>
        </type>
    </parameter>



    <mode>
    </mode>



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



    <reference>
        <item>
            <name>cnc_stopophis</name>
            <file>History/cnc_stopophis.htm</file>
        </item>
        <item>
            <name>cnc_startophis</name>
            <file>History/cnc_startophis.htm</file>
        </item>
        <item>
            <name>cnc_rdophisno</name>
            <file>History/cnc_rdophisno.htm</file>
        </item>
        <item>
            <name>cnc_rdophistry2</name>
            <file>History/cnc_rdophistry2.htm</file>
        </item>
        <item>
            <name>cnc_rdophistry4</name>
            <file>History/cnc_rdophistry4.htm</file>
        </item>
        <item>
            <name>cnc_clearophis</name>
            <file>History/cnc_clearophis.htm</file>
        </item>
    </reference>



    <example>
    </example>



  </func>
</root>
