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

<root>
  <func>


    <title>cnc_rdopmsg2</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdopmsg2(unsigned short FlibHndl,short type,short length,OPMSG2 *opmsg);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the contents of the operator's message in CNC.</p> 
            <p>The operator's message is stored in "data" of "OPMSG2".</p>
            <p>This function can be used in case of four external operator messages on Series 160/180/210, 160i/180i/210i, 0i, 300.</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>type</name>
                    <type>in</type>
                    <content>
                            <p>
                                Specify the kind of operator's message.
                            </p>
                            <table class="dd">
                                <colgroup align="right">
                                    <tr><td align="right">0</td>  <td>:</td> <td>1st message</td>  </tr>
                                    <tr><td align="right">1</td>  <td>:</td> <td>2nd message</td>  </tr>
                                    <tr><td align="right">2</td>  <td>:</td> <td>3rd message</td>  </tr>
                                    <tr><td align="right">3</td>  <td>:</td> <td>4th message</td>  </tr>
                                    <tr><td align="right">-1</td> <td>:</td> <td>all messages</td> </tr>
                                </colgroup>
                            </table>
                    </content>
                </item>
                <item>
                    <name>length</name>
                    <type>in</type>
                    <content>
                            <p>
                                Specify the length of the data block(size of OPMSG2 structure)
                            </p>
                                <p class="dd"><b>single message(1st - 4th message)</b></p>
                                <p class="dd"><img src="misc/opm_2.gif"></img></p>
                                <p class="dd"><b>all messages</b></p>
                                <p class="dd"><img src="misc/opm_2_wal.gif"></img></p>
                    </content>
                </item>
                <item>
                    <name>opmsg</name>
                    <type>out</type>
                    <content>
                            <p>
                               Pointer to the OPMSG2 structure including the operator's message.
                            </p>
The OPMSG2 structure is as follows.
<pre><![CDATA[
typedef struct opmsg2 {
     short  datano ;         /* Number of operator's message */
     short  type ;           /* Kind of operator's message */
     short  char_num ;       /* Message length */
     char  data[MSG_SIZE] ;  /* Operator's message strings */
} OPMSG2 ;                   /* MSG_SIZE : Message length */
]]></pre>
                            <dl>
                                <dt>datano</dt>
                                    <dd>The number of operator's message is stored. message exists</dd>
                                    <ul>
                                    <ul>
                                        <li type="circle">
                                            message exists
                                        </li>
                                            <table class="dd">
                                                <tr> <td>number does not exist</td> <td>:</td> <td>0</td> </tr>
                                                <tr> <td>number exist</td>          <td>:</td> <td>2000 to 2099</td> </tr>
                                            </table>
                                        <li type="circle">
                                            message does not exist
                                        </li>
                                            <dl>
                                                <dd>-1</dd>
                                            </dl>
                                    </ul>
                                    </ul>
                                <dt>type</dt>
                                    <dd>Kind of operator's message is stored.</dd>
                                    <ul>
                                        <table class="dd">
                                            <colgroup align="right">
                                            <tr> <td>0 to 3</td> <td>:</td> <td>1st to 4th message</td> </tr>
                                            </colgroup>
                                        </table>
                                    </ul>
                                <dt>char_num</dt>
                                    <dd>The operator's message length is stored.</dd>
                                        <ul>
                                            <table class="dd">
                                                <colgroup align="right">
                                                <tr>
                                                    <td>1 to 64</td>
                                                    <td>:</td>
                                                    <td>operator's message</td>
                                                </tr>
                                                </colgroup>
                                            </table>
                                        </ul>
                                    <dd>The '\0' at the end of strings is included in the length.</dd>
                                    <dt>data</dt>
                                        <dd>The operator's message strings are stored. ASCII strings are set. The '\0' is set at the end of strings.</dd>
                            </dl>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>
                data block length error<br/>
                Size of OPMSG2 structure(length) is wrong.
            </content>
        </item>
        <item>
            <name>EW_ATTRIB</name>
            <content>
                data attribute error<br/>
                The specification of the kind of operator's message(type) is wrong.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                no option<br/>
                Set necessary CNC option.
            </content>
        </item>
        <item>
            <name>EW_PARAM</name>
            <content>
                CNC parameter error<br/>
                <ul style="margin-top:0;margin-bottom:0">
                    <li>except Series 300i/310i/320i</li>
                        CNC parameter '3207#0' must be 1.
                    <li>Series 300i/310i/320i</li>
                        CNC parameter '11931#0' must be 0.
                </ul>
            </content>
        </item>
    </errcode>



    <option>
        <cmn></cmn>
        <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 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>
        <need>
            external message<br/>
            external data input
        </need>
        <add></add>
    </option>



    <parameter>
        <type>
            <ul type="disc">
                <li>except Series 300i/310i/320i</li>
                    3207#0 = 1 (must be set)
                <li>Series 300i/310i/320i</li>
                    11931#0 = 0 (must be set)
            </ul></type>
        <add></add>
    </parameter>



    <mode></mode>



    <support>
        <m>
            <fs0ia>X</fs0ia>
            <fs0ib>H</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>O</fs30i>
        </m>
        <t>
            <fs0ia>X</fs0ia>
            <fs0ib>H</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>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>H</fs16ia>
            <fs18ia>H</fs18ia>
            <fs21ia>H</fs21ia>
            <fs16ib>H</fs16ib>
            <fs18ib>H</fs18ib>
            <fs21ib>H</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>H</d>
            <h>H</h>
        </pw>
        <add><b></b></add>
    </support>



    <reference></reference>



    <example></example>



  </func>
</root>
