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

<root>
  <func>


    <title>pmc_prfwrbusprm</title>



    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI pmc_prfwrbusprm(unsigned short FlibHndl, IODBBUSPRM *idb) ; </prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Writes the bus parameter of master function.</p>
            <p>
                This function is available at the version 01-07 and 09 or later of the
                PROFIBUS-DP control software(6557 Series).  In the control software in
                the version 08, the return value becomes EW_VERSION.<br/>
                When the parameters are changed, the restart of CNC is required for putting the change into effect.<br/>
                This function is also available at the 6558 Series.
            </p>
            <p>
                * Please refer to "PROFIBUS-DP function manual" for details of the PROFIBUS-DP 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>idb</name>
                    <type>in</type>
                    <content>
                        <p>
                            Pointer to the IODBBUSPRM structure including the bus parameter.
                            The IODBBUSPRM structure is as follows.
<pre>
typedef struct {
    char           fdl_add ;
    char           baudrate ;
    unsigned short tsl ;
    unsigned short min_tsdr ;
    unsigned short max_tsdr ;
    unsigned char  tqui ;
    unsigned char  tset ;
    long           ttr ;
    char           gap ;
    char           hsa ;
    char           max_retry ;
    unsigned char  bp_flag ;
    unsigned short min_slv_int ;
    unsigned short poll_tout ;
    unsigned short data_cntl ;
    char           reserve1[6] ;
    char           cls2_name[32] ;
    short          user_dlen ;
    char           user_data[62] ;
    char           reserve2[96] ;
} IODBBUSPRM ;
</pre>
                            <dl>
                                <dt>fdl_add</dt>
                                    <dd>Specify station number of DP-Master.(0-125)</dd>
                                <dt>baudrate</dt>
                                    <dd>Specify code number of baudrate.</dd>
                                    <dd><table border="0" class="dd">
                                        <tr>    <td>0</td><td>:</td><td>9.6Kbps</td>
                                                <td>1</td><td>:</td><td>19.2Kbps</td>
                                                <td>2</td><td>:</td><td>93.75Kbps</td>
                                        </tr>
                                        <tr>    <td>3</td><td>:</td><td>187.5Kbps</td>
                                                <td>4</td><td>:</td><td>500Kbps</td>
                                                <td>6</td><td>:</td><td>1.5Mbps</td>
                                        </tr>
                                        <tr>    <td>7</td><td>:</td><td>3Mbps</td>
                                                <td>8</td><td>:</td><td>6Mbps</td>
                                                <td>9</td><td>:</td><td>12Mbps</td>
                                        </tr>
                                    </table></dd>
                                <dt>tsl</dt>
                                    <dd>
                                        Specify the maximum time that the initiator waits for the complete receipt of 
                                        the first frame character of the immediate acknowledgement or response, 
                                        after transmitting a token frame. (1-65535)
                                    </dd>
                                <dt>min_tsdr</dt>
                                    <dd>
                                        Specify minimum progress time from the final bit of the transmitting or receiving data 
                                        to the top bit of the next transmitting or receiving data. (1-65535)
                                    </dd>
                                <dt>max_tsdr</dt>
                                    <dd>
                                        Specify maximum progress time from the final bit of the transmitting or receiving data 
                                        to the top bit of the next transmitting or receiving data. (1-65535)
                                    </dd>
                                <dt>tqui</dt>
                                    <dd>
                                        Specify after data were transmitted, the waiting time until the receiver is moved. (0-255)
                                    </dd>
                                <dt>tset</dt>
                                    <dd>
                                        Specify the time after an event occurs until an action is carried out is stored. (1-255)
                                    </dd>
                                <dt>ttr</dt>
                                    <dd>
                                        Specify the anticipated time for one token to make a round on the PROFIBUS. (1-1677215)
                                    </dd>
                                <dt>gap</dt>
                                    <dd>
                                        Specify the number of the token making the rounds between the GAP maintenance cycle. (1-100)
                                    </dd>
                                <dt>hsa</dt>
                                    <dd>
                                        Specify the maximum node number set on PROFIBUS. (2-126)
                                    </dd>
                                <dt>max_retry</dt>
                                    <dd>
                                        Specify the maximum number of retries. (1-8)
                                    </dd>
                                <dt>bp_flag</dt>
                                    <dd>Specify the flag for the user's interface. The meaning of each bit is as follows.</dd>
                                    <dd>BIT7</dd>
                                    <dd><table border="0" class="dd">
                                        <colgroup align="left" valign="top"/>
                                        <colgroup align="left" valign="top"/>
                                        <colgroup align="left" valign="top"/>
                                        <tr> <td>0</td><td>:</td><td>The User-Interface will remain in the operation mode in the case of an error.</td> </tr>
                                        <tr> <td>1</td><td>:</td><td>The operation mode will change from Operate to Clear in the case of an error.</td> </tr>
                                    </table></dd>
                                    <dd>* BIT0 to BIT6 are not used.</dd>
                                <dt>min_slv_int</dt>
                                    <dd>
                                        Specify minimum time between two slave poll cycles. (1-65535)
                                    </dd>
                                <dt>poll_tout</dt>
                                    <dd>
                                        In the case of master-master communication, specify the maximum waiting time to obtaining
                                        the response after request is sent. (1-65535)
                                    </dd>
                                <dt>data_cntl</dt>
                                    <dd>
                                        Specify the time during which the Data Transfer List will be updated at least once 
                                        and will be made available to the user. (1-65535)
                                    </dd>
                                <dt>reserve1</dt>
                                    <dd>not used</dd>
                                <dt>cls2_name</dt>
                                    <dd>not used</dd>
                                <dt>user_dlen</dt>
                                    <dd>
                                        Specify the number of bytes of specific data 
                                        which is neccesary for the bus parameter set from the maker.(0-62)
                                    </dd>
                                <dt>user_data</dt>
                                    <dd>
                                        Specify the specific data which is neccesary for the bus parameter set from the maker.
                                        The data of the number of bytes returned to above-mentioned user_dlen is effective.
                                    </dd>
                                <dt>reserve2</dt>
                                    <dd>not used</dd>
                            </dl>
                        </p>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
           <name>EW_DATA</name>
            <content>
                Data error<br/>
                The bus parameter is wrong.<br/>
                In order to get more information for this err_no return value,
                execute <a href="Pmc/pmc_getdtailerr.htm" target="_parent">pmc_getdtailerr</a> function.  
                The following details status will be set onto the member, err_no of ODBPMCERR structure.
                <table border="0">
                    <tr><td>1</td><td>:</td><td>fdl_add is wrong.</td></tr>
                    <tr><td>2</td><td>:</td><td>baudrate is wrong.</td></tr>
                    <tr><td>3</td><td>:</td><td>tsl is wrong.</td></tr>
                    <tr><td>4</td><td>:</td><td>min_tsdr is wrong.</td></tr>
                    <tr><td>5</td><td>:</td><td>max_tsdr is wrong.</td></tr>
                    <tr><td>6</td><td>:</td><td>tset is wrong.</td></tr>
                    <tr><td>7</td><td>:</td><td>ttr is wrong.</td></tr>
                    <tr><td>8</td><td>:</td><td>gap is wrong.</td></tr>
                    <tr><td>9</td><td>:</td><td>hsa is wrong.</td></tr>
                    <tr><td>10</td><td>:</td><td>max_retry is wrong.</td></tr>
                    <tr><td>11</td><td>:</td><td>min_slv_int is wrong.</td></tr>
                    <tr><td>12</td><td>:</td><td>poll_tout is wrong.</td></tr>
                    <tr><td>13</td><td>:</td><td>data_cntl is wrong.</td></tr>
                    <tr><td>14</td><td>:</td><td>user_dlen is wrong.</td></tr>
                </table>
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>No option<br/>
                    <li>The PROFIBUS-DP board(hardware) is necessary.</li>
                    <li>The PROFIBUS-DP control software is necessary.</li>
                    <li>The PROFIBUS-DP master function is necessary.</li>
                    <li>The extended driver/library function is necessary.</li>
            </content>
        </item>
        <item>
            <name>EW_VERSION</name>
            <content>Version of PROFIBUS-DP control software is wrong.<br/>
                    This function was called by version 08 of the control software.
                    Exchange the control software besides the version 08.
            </content>
        </item>
    </errcode>



    <option>
        <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, 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>
            The PROFIBUS-DP master function is necessary.
        </need>
    </option>



    <parameter>
    </parameter>



    <mode>
    </mode>



    <support>
        <m>
            <fs0ia>X</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>X</fs16>
            <fs18>X</fs18>
            <fs21>X</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>X</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>X</fs16>
            <fs18>X</fs18>
            <fs21>X</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>X</fs16i>
            <fs18i>X</fs18i>
        </w>
        <pw>
            <d>X</d>
            <h>X</h>
        </pw>
    </support>



    <reference>
    </reference>



    <example>
    </example>



  </func>
</root>
