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


    <title>cnc_rdunsolicmsg2</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdunsolicmsg2( short bill, IODBUNSOLICMSG2 *data2 );</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
<p>

Reads the unsolicited messaging data. This function is available only for Series Series 300i/310i/320i. This function cannot be used with Visual Basic. Please use Visual C++ for making your application. And this function is only for "Fast Ethernet board". This function is not supported at "Embedded Ethernet".
<p/>
This function does not have the argument, library handle "FlibHndl". 
</p>
        </cmn>
    </doc>



    <argument>
        <ethr>
            <vc>
                <item>
                    <name>bill</name>
                    <type>in</type>
                    <content>
                        <p>
Handle for the Message data reading. Specify the value acquired by the <a href="UnSolic/cnc_unsolicstart.htm" target="_parent">cnc_unsolicstart</a> or the value notified by the argument(lParam) of the message reception function.
                        </p>
                    </content>
                </item>
                <item>
                    <name>data</name>
                    <type>out</type>
                    <content>
                        <p>
Pointer to IDBUNSOLICMSG2 structure in which the unsolicited messaging data will be stored.
                        </p>
<p>The IDBUNSOLICMSG2 structure is as follows.
                        </p>
<pre>
typedef struct idbunsolicmsg2 {
    unsigned short      getnum;
    char                dummy[2];
    UNSOLICMSG_TYPE_MSG get[3];
} IDBUNSOLICMSG2 ;

typedef struct unsolicmsg_type_msg {
    unsigned short      type;
    char                dummy1[2];
    union {
        typedef {
            unsigned short  path;
            char            dummy2[2];
            unsigned long   size;
            void            *data;
        } pmc;
        typedef {
            unsigned short  path;
            char            dummy3[2];
            unsigned long   num;
            void            *data;
        } macro;
    } msg;
} UNSOLICMSG_TYPE_MSG ;
</pre>
                        <dl>
                            <dt>getnum</dt>
                                <dd>Acquired message number</dd>
                                <dd>Number of the Message data which was acquired by the unsolicited messaging. </dd>
                                <dd>Range) 1 - 3</dd>

                            <dt>get[n].msg.type</dt>
                                <dd>Kind of the unsolicited messaging data.</dd>
                                    <table class="dd">
                                        <tr><td>1</td> <td>:</td> <td>PMC data</td></tr>
                                        <tr><td>3</td> <td>:</td> <td>Custom macro variables</td></tr>
                                        <tr><td>4</td> <td>:</td> <td>Temporary RTM variables</td></tr>
                                        <tr><td>5</td> <td>:</td> <td>Permanent RTM variables</td></tr>
                                    </table>

                            <dt>get[n].msg.pmc.path</dt>
                                <dd>Unit type number of PMC</dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.</dd>
                                <dd>Range) 1 - 3 (The range depends on an effective PMC unit type number.)</dd>

                            <dt>get[n].msg.pmc.size</dt>
                                <dd>The size of PMC data (bytes)</dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.</dd>
                                <dd>Range) (The range depends on an effective PMC area and transmission number.)</dd>

                            <dt>get[n].msg.pmc.data</dt>
                                <dd>Pointer to the buffer where PMC data is stored.</dd>
                                <dd>The size specified by "PMC size of the parameter for the transmission (byte)" of cnc_wrunsolicprm2 function is necessary for the size of this data.</dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.</dd>

                            <dt>get[n].msg.macro.path</dt>
                                <dd>Path number of CNC</dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.</dd>
                                <dd>Range) 1 - 3 (The range depends on an effective PMC unit type number.)</dd>

                            <dt>get[n].msg.macro.num</dt>
                                <dd>Number of Macro variable data</dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.</dd>
                                <dd>Range) (The range depends on an effective Macro variable data and transmission number.)</dd>

                            <dt>get[n].msg.macro.data</dt>
                                <dd>Pointer to the buffer where Macro variable data is stored.</dd>
                                <dd>The size specified by "Number of macro variables of the parameter for the transmission" of cnc_wrunsolicprm2 function is necessary for the size of this data. </dd>
                                <dd>When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.</dd>

                            <dt>Setting example)</dt>
                                    <table class="dd">
                                         <tr><td>IP address                   </td> <td>:</td> <td>192.168.0.1                          </td></tr>
                                         <tr><td>Port number                  </td> <td>:</td> <td>8196                                 </td></tr>
                                         <tr><td>Control method               </td> <td>:</td> <td>Simple method                        </td></tr>
                                         <tr><td>Conterl parameter            </td> <td>:</td> <td>PMC address"1:R2000"                 </td></tr>
                                         <tr><td>Retry number                 </td> <td>:</td> <td>3                                    </td></tr>
                                         <tr><td>Timeout                      </td> <td>:</td> <td>10 sec                               </td></tr>
                                         <tr><td>Transmission number          </td> <td>:</td> <td>3                                    </td></tr>
                                         <tr><td>Parameter for transmission[0]</td> <td>:</td> <td>PMC area"1:R2100-1:R2149"            </td></tr>
                                         <tr><td>Parameter for transmission[1]</td> <td>:</td> <td>Custom macro variables"1:3011"       </td></tr>
                                         <tr><td>Parameter for transmission[2]</td> <td>:</td> <td>Temporary RTM variables"1:0-1:4"     </td></tr>

                                        <tr><td><br/></td></tr>

                                        <tr><td>IODBUNSOLIC2 data2;<br/>
                                                char    msg1[50];             // stored buffer for msg1<br/>
                                                double  msg2[2];              // stored buffer for msg2<br/>
                                                double  msg3[5];              // stored buffer for msg3<br/></td></tr>
                                    </table>
                                    <table class="dd">
                                        <tr><td>data2.get[0].msg.pmc.data   = msg1;</td> <td>//</td> <td>Contents of 1:R2100-1:2149</td></tr>
                                        <tr><td>data2.get[1].msg.macro.data = msg2;</td> <td>//</td> <td>Contents of 1:3011        </td></tr>
                                        <tr><td>data2.get[2].msg.macro.data = msg3;</td> <td>//</td> <td>Contents of 1:0-1:4       </td></tr>
                                    </table>
                        </dl>
                    </content>
                </item>
            </vc>
        </ethr>
    </argument>



    <errcode>
        <item>
            <name>EW_FUNC</name>
            <content>Unavailable</content>
        </item>
        <item>
            <name>EW_DATA</name>
            <content>
              The message corresponding to the handle(bill) has not been transmitted.
            </content>
        </item>
    </errcode>



    <option>
        <ethr><p>The Ethernet function and the extended driver/library function are necessary.</p>
              <p>However, in case of Series 300i/310i/320i, 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>
    </option>



    <parameter>
        <fast>
          <ul>
              No.904#4=1 : Unsilocited messaging function(must be set)<br/>
              No.904#5 : If you use the DNS function, set "1".<br/>
          </ul>
        </fast>
    </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>E</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>E</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>
        <item>
            <name>cnc_wrunsolicprm</name>
            <file>Unsolic/cnc_wrunsolicprm.htm</file>
        </item>
        <item>
            <name>cnc_wrunsolicprm2</name>
            <file>Unsolic/cnc_wrunsolicprm2.htm</file>
        </item>
        <item>
            <name>cnc_rdunsolicprm</name>
            <file>Unsolic/cnc_rdunsolicprm.htm</file>
        </item>
        <item>
            <name>cnc_rdunsolicprm2</name>
            <file>Unsolic/cnc_rdunsolicprm2.htm</file>
        </item>
        <item>
            <name>cnc_unsolicstart</name>
            <file>Unsolic/cnc_unsolicstart.htm</file>
        </item>
        <item>
            <name>cnc_unsolicstop</name>
            <file>Unsolic/cnc_unsolicstop.htm</file>
        </item>
    </reference>



    <example></example>



  </func>
</root>
