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

<root>
  <func>


    <title>cnc_wrunsolicprm</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_wrunsolicprm( unsigned short FlibHndl, short number, IODBUNSOLIC *data ); </prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
Sets the parameter for unsolicited messaging to CNC. This function is available only for Series 160i/180i/210i, 0i and Power Mate i. 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" and "Ethernet board". <p/>

After calling the <a href="UnSolic/cnc_unsolicstart.htm" target="_parent">cnc_unsolicstart</a> function, the parameter set by this function becomes effective. 
        </cmn>
    </doc>



    <argument>
        <ethr>
            <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>number</name>
                    <type>in</type>
                    <content>
                        <p>
                            The parameter number for unsolicited messaging. Reserved argument, so must be set to "1".
                        </p>
                    </content>
                </item>
                <item>
                    <name>data</name>
                    <type>in</type>
                    <content>
                        <p>
                            Pointer to IODBUNSOLIC structure which sets the parameters for the unsolicited messaging.
                        </p>
The IODBUNSOLIC structure is as follows.
<pre>
typedef struct iodbunsolic {
    char            ipaddr[16] ;
    unsigned short  port ;
    short           reqaddr ;
    short           pmcno ;
    short           retry ;
    short           timeout ;
    short           alivetime;
    short           setno ;
    union {
        struct {
            short   type ;
            short   rdaddr ;
            short   rdno ;
            short   rdsize ;
        } pmc ;
        struct {
            short   type ;
            long    dummy1 ;
            short   dummy2 ;
        } dmy ;
    } rddata[3] ;
} IODBUNSOLIC ;</pre>
                        <dl>
                            <dt>ipaddr</dt>
                                <dd>IP address of destination PC.</dd>
                                <dd>ex.) "192.168.0.1"</dd>
                            <dt>port</dt>
                                <dd>TCP/UDP port number of destination PC.</dd>
                                <dd>The unsolicited messaging function uses TCP and UDP of the same port number.</dd>
                                <dd>If you set the firewall by this port number, you have to open the port for this port number.</dd>
                            <dt>reqaddr</dt>
                                <dd>PMC address type for the data transmission control. Only "R" or "E" address can be used for the transmission control, so set either "5" or "12".</dd>
                                <dd>
                                    <table class="dd">
                                        <tr><td>5</td>  <td>:</td> <td>R (Internal relay)</td></tr>
                                        <tr><td>12</td> <td>:</td> <td>E (Extended relay)</td></tr>
                                    </table>
                                </dd>
                            <dt>pmcno</dt>
                                <dd>PMC address number for the data transmission control.</dd>
                            <dt>retry</dt>
                                <dd>Number of transmission retry to observe communication board transmits data. Set the retry count that is used when there is no answer for the data transmission.</dd>
                            <dt>timeout</dt>
                                <dd>Timeout(sec) to observe communication board transmits data. Set the time(sec) of timeout until answering to the data transmission.</dd>
                            <dt>alivetime</dt>
                                <dd>The interval time(sec)of the existence signals which are transmitted while communication board operates. Set the value less than the value of the above "timeout".</dd>
                            <dt>setno</dt>
                                <dd>Number of the Message data to be transmitted. (1-3).</dd>
                            <dt>type</dt>
                                <dd>The type of the transmitted data. This is a reserved value, so set to "1".</dd>
                            <dt>rdaddr</dt>
                                <dd>PMC address which becomes the contents of the Message data.</dd>
                                <dd>
                                    <table class="dd">
                                        <tr><td align="right">0</td>  <td>:</td> <td>G (Signal to PMC->CNC)</td> </tr>
                                        <tr><td align="right">1</td>  <td>:</td> <td>F (Signal to CNC->PMC)</td> </tr>
                                        <tr><td align="right">2</td>  <td>:</td> <td>Y (Signal to PMC->machine)</td> </tr>
                                        <tr><td align="right">3</td>  <td>:</td> <td>X (Signal to machine->PMC)</td> </tr>
                                        <tr><td align="right">4</td>  <td>:</td> <td>A (Message demand)</td> </tr>
                                        <tr><td align="right">5</td>  <td>:</td> <td>R (Internal relay)</td> </tr>
                                        <tr><td align="right">6</td>  <td>:</td> <td>T (Changeable timer)</td> </tr>
                                        <tr><td align="right">7</td>  <td>:</td> <td>K (Keep relay)</td> </tr>
                                        <tr><td align="right">8</td>  <td>:</td> <td>C (Counter)</td> </tr>
                                        <tr><td align="right">9</td>  <td>:</td> <td>D (Data table)</td> </tr>
                                        <tr><td align="right">10</td> <td>:</td> <td>M (Input signal from other devices)</td> </tr>
                                        <tr><td align="right">11</td> <td>:</td> <td>N (Output signal to other devices)</td> </tr>
                                        <tr><td align="right">12</td> <td>:</td> <td>E (Extended relay)</td> </tr>
                                    </table>
                                </dd>
                            <dt>rdno</dt>
                                <dd>Start address number of PMC data which becomes the contents of the Message data.</dd>
                            <dt>rdsize</dt>
                                <dd>Size(byte) of PMC data which becomes the contents of the Message data. According to the number of the Message data to be transmitted(setno), maximum number which can be set to "rdsize" varies as follows.</dd>
                                <dd>
                                    <table class="dd">
                                        <tr><td>in case of setno = 1</td>  <td>:</td> <td>Max.1430 bytes       </td></tr>
                                        <tr><td>in case of setno = 2</td>  <td>:</td> <td>Max.1414 bytes(total)</td></tr>
                                        <tr><td>in case of setno = 3</td>  <td>:</td> <td>Max.1398 bytes(total)</td></tr>
                                    </table>
                                </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>PMC address        </td> <td>:</td> <td>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 data  </td> <td>:</td> <td>2</td></tr>
                                        <tr> <td>1st message        </td> <td>:</td> <td>R2100-2149</td></tr>
                                        <tr> <td>2nd message        </td> <td>:</td> <td>D110-149</td></tr>

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

                                        <tr><td>IODBUNSOLIC data;</td></tr>
                                        <tr><td>strcpy(data.ipaddr,"192.168.0.1");</td> <td>//</td> <td>IP address              </td> </tr>
                                        <tr><td>data.port = 8196;</td>                  <td>//</td> <td>Port number         </td> </tr>
                                        <tr><td>data.reqaddr = 5;</td>                  <td>//</td> <td>"R"                     </td> </tr>
                                        <tr><td>data.pmcno = 2000;</td>                 <td>//</td> <td>2000                    </td> </tr>
                                        <tr><td>data.retry = 3;</td>                    <td>//</td> <td>retry count             </td> </tr>
                                        <tr><td>data.timeout = 10;</td>                 <td>//</td> <td>Timeout time(sec)       </td> </tr>
                                        <tr><td>data.alivetime = 5;</td>                <td>//</td> <td>Alive signal time(sec)  </td> </tr>
                                        <tr><td>data.setno = 2;</td>                    <td>//</td> <td>Transmission data number</td> </tr>
                                        <tr><td>data.rddata[0].pmc.type = 1;</td>       <td>//</td> <td>Type of data("1")       </td> </tr>
                                        <tr><td>data.rddata[0].pmc.rdaddr = 5;</td>     <td>//</td> <td>"R"                     </td> </tr>
                                        <tr><td>data.rddata[0].pmc.rdno = 2100;</td>    <td>//</td> <td>2100                    </td> </tr>
                                        <tr><td>data.rddata[0].pmc.rdsize = 50;</td>    <td>//</td> <td>1st message data size   </td> </tr>
                                        <tr><td>data.rddata[1].pmc.type = 1;</td>       <td>//</td> <td>Type of data("1")       </td> </tr>
                                        <tr><td>data.rddata[1].pmc.rdaddr = 9;</td>     <td>//</td> <td>"D"                     </td> </tr>
                                        <tr><td>data.rddata[1].pmc.rdno = 110;</td>     <td>//</td> <td>110                     </td> </tr>
                                        <tr><td>data.rddata[1].pmc.rdsize = 40;</td>    <td>//</td> <td>2nd message data size   </td> </tr>
                                    </table>
                        </dl>
                    </content>
                </item>
            </vc>
        </ethr>
    </argument>



    <errcode>
        <item>
            <name>EW_FUNC</name>
            <content>Unavailable</content>
        </item>
        <item>
            <name>EW_NUMBER</name>
            <content>The parameter number(number) for unsolicited messaging is wrong.</content>
        </item>
        <item>
            <name>EW_DATA</name>
            <content>
              The content of the parameter for the unsolicited messaging is wrong.<br/>
In order to get more information for this err_no return value, execute <a href="misc/cnc_getdtailerr.htm" target="_parent">cnc_getdtailerr</a> function. The following details status will be set onto the member, err_no of OBDERR structure.

<table>
        <tr><td valign="top" align="right">0</td>  <td valign="top">:</td> <td>error except EW_DATA</td></tr>
        <tr><td valign="top" align="right">1</td>  <td valign="top">:</td> <td>IP address(ipaddr) of destination PC is wrong.</td></tr>
        <tr><td valign="top" align="right">2</td>  <td valign="top">:</td> <td>Port number(port) of destination PC is wrong.</td></tr>
        <tr><td valign="top" align="right">3</td>  <td valign="top">:</td> <td>PMC address type(reqaddr) for the data transmission control is wrong.</td></tr>
        <tr><td valign="top" align="right">4</td>  <td valign="top">:</td> <td>PMC address number(pmcno) for the data transmission control is wrong.</td></tr>
        <tr><td valign="top" align="right">5</td>  <td valign="top">:</td> <td>Number(retry) of transmission retry to observe communication board transmits data is wrong.</td></tr>
        <tr><td valign="top" align="right">6</td>  <td valign="top">:</td> <td>Timeout time(timeout) to observe communication board transmits data is wrong.</td></tr>
        <tr><td valign="top" align="right">7</td>  <td valign="top">:</td> <td>The interval time(alivetime)of the existence signals which are transmitted while communication board operates is wrong.</td></tr>
        <tr><td valign="top" align="right">8</td>  <td valign="top">:</td> <td>Number(setno) of the Message data to be transmitted is wrong.</td></tr>
        <tr><td valign="top" align="right">9</td>  <td valign="top">:</td> <td>The type(type) of the transmitted data is wrong.</td></tr>
        <tr><td valign="top" align="right">10</td> <td valign="top">:</td> <td>PMC address(rdaddr) which becomes the contents of the Message data is wrong.</td></tr>
        <tr><td valign="top" align="right">11</td> <td valign="top">:</td> <td>Start number(rdno) of PMC data which becomes the contents of the Message data is wrong.</td></tr>
        <tr><td valign="top" align="right">12</td> <td valign="top">:</td> <td>Size(rdsize) of PMC data which becomes the contents of the Message data is wrong.</td></tr>
</table>
            </content>
        </item>
        <item>
            <name>EW_BUSY</name>
            <content>The unsolicited message is being transmitted.</content>
        </item>
        <item>
            <name>EW_REJECT</name>
            <content>The message transmission is being executed with other destination PC.</content>
        </item>
    </errcode>



    <option>
        <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>
    </option>



    <parameter>
        <fast>
          <ul>
            <li>Series 160i/180i/210i, 0i, Power Mate i<br/>
                No.904#4=1 (must be set) <br/>
            </li>
          </ul>
        </fast>
    </parameter>



    <mode></mode>



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



    <reference>
        <item>
            <name>cnc_rdunsolicprm</name>
            <file>Unsolic/cnc_rdunsolicprm.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>
        <item>
            <name>cnc_rdunsolicmsg</name>
            <file>Unsolic/cnc_rdunsolicmsg.htm</file>
        </item>
    </reference>



    <example></example>



  </func>
</root>
