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

<root>
  <func>


    <title>cnc_rdopmsg</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdopmsg(unsigned short FlibHndl, short type, short length, OPMSG *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 "OPMSG".</p>
        </cmn>
        <is>
            <cmn>
                <p>
                Reads the contents of the operator's message in CNC.<br/>
                The operator's message is stored in "data" of "OPMSG".
                </p>
            </cmn>
        </is>
    </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>
                            <li>
                                Series 150/150i
                            </li>
                            <table class="dd">
                                <colgroup align="right">
                                    <tr>
                                        <td>&#160;0</td>
                                        <td>:</td>
                                        <td>1st message</td>
                                    </tr>
                                    <tr>
                                        <td>&#160;1</td>
                                        <td>:</td>
                                        <td>2nd message</td>
                                    </tr>
                                    <tr>
                                        <td>&#160;2</td>
                                        <td>:</td>
                                        <td>3rd message</td>
                                    </tr>
                                    <tr>
                                        <td>&#160;3</td>
                                        <td>:</td>
                                        <td>4th message</td>
                                    </tr>
                                    <tr>
                                        <td>&#160;4</td>
                                        <td>:</td>
                                        <td>macro message</td>
                                    </tr>
                                    <tr>
                                        <td>-1</td>
                                        <td>:</td>
                                        <td>all messages</td>
                                    </tr>
                                    </colgroup>
                            </table>
                            <br/>
                            <li>
                                Series 160/180/210, 160i/180i/210i, 0i, 300i, Power Mate i
                            </li>
                            <table class="dd">
                                <colgroup align="right">
                                    <tr>
                                        <td>&#160;0</td>
                                        <td>:</td>
                                        <td>1st message</td>
                                    </tr>
                                </colgroup>
                            </table>
                            <br/>
                            <li>
                                Series 160i/180i-W
                            </li>
                            <table class="dd">
                                <colgroup align="right">
                                    <tr><td>&#160;0</td> <td>:</td> <td>1st message</td>    </tr>
                                    <tr><td>&#160;1</td> <td>:</td> <td>2nd message</td>    </tr>
                                    <tr><td>&#160;2</td> <td>:</td> <td>3rd message</td>    </tr>
                                    <tr><td>&#160;3</td> <td>:</td> <td>4th message</td>    </tr>
                                    <tr><td>-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 OPMSG structure)
                            </p>
                            <li>
                                Series 150/150i
                            </li>
                                <p class="dd"><b>single message (1st - 4th message)</b></p>
                                <p class="dd"><img src="misc/opm15.gif"></img></p>
                                <p class="dd"><b>macro message</b></p>
                                <p class="dd"><img src="misc/opm15m.gif"></img></p>
                                <p class="dd"><b>all messages</b></p>
                                <p class="dd"><img src="misc/opm15all.gif"></img></p>
                            <br/>
                            <li>
                                Series 160/180/210, 160i/180i/210i, 0i, 300i, Power Mate i
                            </li>
                                <p class="dd"><img src="misc/opm16.gif"></img></p>
                            <br/>
                            <li>
                                Series 160i/180i-W
                            </li>
                                <p class="dd"><b>single message(1st - 4th message)</b></p>
                                <p class="dd"><img src="misc/opm16.gif"></img></p>
                                <p class="dd"><b>all messages</b></p>
                                <p class="dd"><img src="misc/opm16wal.gif"></img></p>
                    </content>
                </item>
                <item>
                    <name>opmsg</name>
                    <type>out</type>
                    <content>
                            <p>
                                Pointer to the OPMSG structure including the operator's message.
                            </p>
<pre><![CDATA[
typedef struct msg {
     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 */
} OPMSG ;                    /* MSG_SIZE : Message length */
]]></pre>
                            <dl>
                                <dt>datano</dt>
                                    <dd>The number of operator's message is stored.</dd>
                                    <ul>
                                    <ul>
                                        <li type="circle">
                                            message exists
                                        </li>
                                            <dl>
                                                <dt><li>Series 150/150i</li></dt>
                                                <dd>0 to 999</dd>
                                                <dt><li>Series 160/180/210, 160i/180i/210i, 0i, 300i, Power Mate i</li></dt>
                                                <dd>number does not exist : 0</dd>
                                                <dd>number exist : 2000 to 2099</dd>
                                            </dl>
                                        <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>
                                        <dd><li type="disc">Series 150/150i</li></dd>
                                        <ul>
                                            <table class="dd">
                                                <colgroup align="right">
                                                <tr>
                                                    <td>0 to 3</td>
                                                    <td>:</td>
                                                    <td>1st to 4th message</td>
                                                </tr>
                                                <tr>
                                                    <td>4</td>
                                                    <td>:</td>
                                                    <td>macro message</td>
                                                </tr>
                                                </colgroup>
                                            </table>
                                        </ul>
                                        <dd><li type="disc">Series 160/180/210, 160i/180i/210i, 0i, 300i, Power Mate i</li></dd>
                                        <ul>
                                            <table class="dd">
                                                <colgroup align="right">
                                                <tr>
                                                    <td>0</td>
                                                    <td>:</td>
                                                    <td>1st message</td>
                                                </tr>
                                                </colgroup>
                                            </table>
                                        </ul>
                                        <dd><li type="disc">Series 160i/180i-W</li></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>
                                    </ul>
                                <dt>char_num</dt>
                                    <dd>The operator's message length is stored.</dd>
                                        <ul>
                                            <dd><li type="disc">Series 150/150i</li></dd>
                                            <ul>
                                                <table class="dd">
                                                    <colgroup align="right">
                                                    <tr>
                                                        <td>1 to 129</td>
                                                        <td>:</td>
                                                        <td>1st to 4th message</td>
                                                    </tr>
                                                    <tr>
                                                        <td>1 to 27</td>
                                                        <td>:</td>
                                                        <td>macro message</td>
                                                    </tr>
                                                    </colgroup>
                                                </table>
                                            </ul>
                                    <dd><li type="disc">Series 160/180/210, 160i/180i/210i, 0i, 300i, Power Mate i</li></dd>
                                            <ul>
                                                <table class="dd">
                                                    <colgroup align="right">
                                                    <tr>
                                                        <td>1 to 256</td>
                                                        <td>:</td>
                                                        <td>operator's message</td>
                                                    </tr>
                                                    </colgroup>
                                                </table>
                                            </ul>
                                        </ul>
                                    <dt>data</dt>
                                        <dd>The operator's message strings are stored. ASCII strings are set. '\0' is set at the end of strings.</dd>
                            </dl>
                    </content>
                </item>
            </vc>
        </common>

        <!-- is Argument Start -->
        <is>
            <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>type</name>
                        <type>in</type>
                        <content>
                            <div class="dd">
                                <p>
                                    Specify the kind of operator's message.
                                </p>
                                <table class="dd">
                                    <colgroup align="right">
                                        <tr>
                                            <td>&#160;0</td>
                                            <td>:</td>
                                            <td>1st message</td>
                                        </tr>
                                    </colgroup>
                                </table>
                                <br/>
                            </div>
                        </content>
                    </item>
                    <item>
                        <name>length</name>
                        <type>in</type>
                        <content>
                            <div class="dd">
                                <p>
                                    Specify the length of the data block(size of OPMSG structure)
                                </p>
                                    <p class="dd"><img src="misc/opm16.gif"></img></p>
                                <br/>
                            </div>
                        </content>
                    </item>
                    <item>
                        <name>opmsg</name>
                        <type>out</type>
                        <content>
                            <div class="dd">
                                <p>
                                    Pointer to the OPMSG structure including the operator's message.
                                </p>
<pre><![CDATA[
typedef struct msg {
     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 */
} OPMSG ;                    /* MSG_SIZE : Message length */
]]></pre>
                                <dl>
                                    <dt>datano</dt>
                                        <dd>The number of operator's message is stored.</dd>
                                        <ul>
                                        <ul>
                                            <li type="circle">
                                                message exists
                                            </li>
                                                <dl>
                                                    <dd>number does not exist : 0</dd>
                                                    <dd>number exist : 2000 to 2099</dd>
                                                </dl>
                                            <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>
                                            <ul>
                                                <table class="dd">
                                                    <colgroup align="right">
                                                    <tr>
                                                        <td>0</td>
                                                        <td>:</td>
                                                        <td>1st message</td>
                                                    </tr>
                                                    </colgroup>
                                                </table>
                                            </ul>
                                        </ul>
                                    <dt>char_num</dt>
                                        <dd>The operator's message length is stored.</dd>
                                            <ul>
                                                <ul>
                                                    <table class="dd">
                                                        <colgroup align="right">
                                                        <tr>
                                                            <td>1 to 256</td>
                                                            <td>:</td>
                                                            <td>operator's message</td>
                                                        </tr>
                                                        </colgroup>
                                                    </table>
                                                </ul>
                                            </ul>
                                        <dt>data</dt>
                                            <dd>The operator's message strings are stored. ASCII strings are set. '\0' is set at the end of strings.</dd>
                                </dl>
                            </div>
                        </content>
                    </item>
                </vc>
            </hssb>
        </is>
        <!-- is Argument End -->
    </argument>



    <errcode>
        <item>
            <name>EW_LENGTH</name>
            <content>
                Data block length error<br/>
                Size of OPMSG structure(length) is wrong.<br/>
            </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>Series 300i/310i/320i</li>
                        CNC parameter '11931#0' must be 0.
                </ul>
            </content>
        </item>
        <add></add>
        <is>
            <item>
                <name>EW_LENGTH</name>
                <content>
                    Data block length error<br/>
                    Size of OPMSG 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>
            <add></add>
        </is>
    </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 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>
        <need>
            <li>Series 150/150i</li>
                The external data I/O function<br/>
            <li>Series 160/180/210, 160i/180i/210i, 0i, 300i</li>
                External message<br/>
                External data input
        </need>
        <is>
            <hssb>The extended driver/library function is necessary.</hssb>
            <need>
                External message<br/>
                External data input
            </need>
        </is>
    </option>



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



    <mode></mode>



    <support>
        <m>
            <fs0ia>H</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>H</fs15>
            <fs15i>O</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>O</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>O</fs30i>
        </t>
        <lc>
            <fs0ia>X</fs0ia>
            <fs0ib>X</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</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>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>
        <add><b></b></add>
        <is>
            <!-- M -->
            <m>
                <fs30is>O</fs30is>
            </m>
            <!-- T -->
            <t>
                <fs30is>O</fs30is>
            </t>
        </is>
    </support>



    <reference></reference>



    <example>
        <vc><![CDATA[
The following program reads the operator's message and displays it.

#include "fwlib32.h"

void example( void )
{
        OPMSG buf ;
        cnc_rdopmsg( h, 0, 6+256, &buf ) ;
        if ( buf.datano != -1 ) 
                printf( "#04d %s\n", buf.datano. buf.data ) ;
        else
                printf( "No operator message.\n" ) ;
}]]></vc>
    </example>



  </func>
</root>
