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

<root>
  <func>


    <title>pmc_prfwrslvaddr</title>



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



    <doc>
        <cmn>
            <p>Sets the address allocation of slave 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 IODBSLVADR structure including the address allocation.
                            The IODBSLVADR structure is as follows.
<pre>
typedef struct {
    char           slave_no ;
    unsigned char  di_size ;
    char           di_type ;
    unsigned short di_addr ;
    unsigned char  do_size ;
    char           do_type ;
    unsigned short do_addr ;
    char           reserve[7] ;
} IODBSLVADR ;
</pre>
                            <dl>
                                <dt>slave_no</dt>
                                    <dd>
                                        Specify the station number of the DP-Slave.(0-125)
                                    </dd>
                                    <dd>In case of 6558 system, the address allocation data can be initialized by specifying "-1".</dd>
                                <dt>di_size</dt>
                                    <dd>
                                        Specify the size of area used as buffer of DI data.
                                    </dd>
                                    <dd><table border="0" class="dd">
                                        <tr><td>6557 Series</td><td>Version 01-07      </td><td>:</td><td>(1-32)</td></tr>
                                        <tr><td>6557 Series</td><td>Version 09 or later</td><td>:</td><td>(0-244)</td></tr>
                                    </table></dd>
                                <dt>di_type</dt>
                                    <dd>
                                        Specify the kind of the PMC address used as a buffer of the DI data with ASCII CODE.
                                    </dd>
                                <dt>di_addr</dt>
                                    <dd>
                                        Specify the top number of the PMC address used as a buffer of the DI data.
                                    </dd>
                                <dt>do_size</dt>
                                    <dd>
                                        Specify the size of area used as buffer of DO data. 
                                    </dd>
                                    <dd><table border="0" class="dd">
                                        <tr><td>6557 Series</td><td>Version 01-07      </td><td>:</td><td>(1-32)</td></tr>
                                        <tr><td>6557 Series</td><td>Version 09 or later</td><td>:</td><td>(0-244)</td></tr>
                                    </table></dd>
                                <dt>do_type</dt>
                                    <dd>
                                        Specify the kind of the PMC address used as a buffer of the DO data with ASCII CODE.
                                    </dd>
                                <dt>do_addr</dt>
                                    <dd>
                                        Specify the top number of the PMC address used as a buffer of the DO data.
                                    </dd>
                                <dt>reserve</dt>
                                    <dd>not used</dd><br/>
                                <dt>* 6557 Series Version 09 or later:</dt>
                                    <dd>Set parameter di_size and do_size so that the total of the two parameter lengths does not exceed 244.</dd>
                            </dl>
                        </p>
                    </content>
                </item>
            </vc>
        </common>
    </argument>



    <errcode>
        <item>
           <name>EW_DATA</name>
            <content>
                Data error<br/>
                The specification of the address allocation 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>slave_no is wrong.</td></tr>
                    <tr><td>2</td><td>:</td><td>di_size is wrong.</td></tr>
                    <tr><td>3</td><td>:</td><td>di_type is wrong.</td></tr>
                    <tr><td>4</td><td>:</td><td>di_addr is wrong.</td></tr>
                    <tr><td>5</td><td>:</td><td>do_size is wrong.</td></tr>
                    <tr><td>6</td><td>:</td><td>do_type is wrong.</td></tr>
                    <tr><td>7</td><td>:</td><td>do_addr 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 slave 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 slave 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>
        <item>
            <name>pmc_prfrdslvaddr</name>
            <file>Profibus/pmc_prfrdslvaddr.htm</file>
        </item>
    </reference>



    <example>
    </example>



  </func>
</root>
