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


    <title>cnc_wrcomparam</title>



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



    <doc>
        <cmn>
            Writes communication parameters for DNC1,DNC2 or OSI-Ethernet function.<br/>
            When communication parameters are written to OSI-Ethernet board following alarm will occur.
<p/>
            <table class="dd">
                <tr>
                    <td>Series 150</td>
                    <td>PW000</td>
                </tr>
                <tr>
                    <td>Series 160/180, 160i/180i/210i</td>
                    <td>P/S000</td>
                </tr>
            </table>
        </cmn>
    </doc>



    <argument>
        <hssb>
            <vc>
                <item>
                    <name>FlibHndl</name>
                    <type>in</type>
                    <content>
Specify the library handle. See "<a href="handle.htm" target="_parent">Library handle</a>" for details.
                    </content>
                </item>
                <item>
                    <name>idb</name>
                    <type>in</type>
                    <content>
Pointer to the IODBCPRM structure where communication parameters are set.
<p/>
The IODBCPRM structure is as follows.
<pre>
typedef struct {
    char           NcApli[65] ;
    char           Dummy1 ;
    char           HostApli[65] ;
    char           Dummy2 ;
    unsigned long  StatPstv ;
    unsigned long  StatNgtv ;
    unsigned long  Statmask ;
    unsigned long  AlarmStat ;
    unsigned long  PsclHaddr ;
    unsigned long  PsclLaddr ;
    unsigned short SvcMode1 ;
    unsigned short SvcMode2 ;
    long           FileTout ;
    long           RemTout ;
} IODBCPRM ;
</pre>
                        <dl>
                            <dt>NcApli</dt>
                            <dd>
CNC application name<br/>
NULL terminated character string with maximum length of 65 characters including NULL can be specified. This is valid only for OSI-Ethernet.
                            </dd>
                            <br/>

                            <dt>Dummy1</dt>
                            <dd>not used</dd>
                            <br/>

                            <dt>HostApli</dt>
                            <dd>
Host application name<br/>
NULL terminated character string with maximum length of 65 characters including NULL can be specified. This is valid only for OSI-Ethernet.
                            </dd>
                            <br/>

                            <dt>Dummy2</dt>
                            <dd>not used</dd>
                            <br/>

                            <dt>StatPstv</dt>
                            <dd>
                                Status report mask (positive edge)<br/>
Set status report mask bits, which enable or mask reporting CNC status information to DNC1, DNC2 and OSI-Ethernet board.<br/>
If any of the following bits is "1", corresponding status information is reported when its state changes from "0" to "1". Bit type data.
                                <table class="dd">
                                    <tr>
                                        <td>0</td>
                                        <td>:</td>
                                        <td>mask report</td>
                                    </tr>
                                    <tr>
                                        <td>1</td>
                                        <td>:</td>
                                        <td>enable report</td>
                                    </tr>
                                </table>
                                <br/>

                                <ul>
                                    <li>DNC1, DNC2</li>
    <table>
        <tr>    <td valign="top">bit 0</td> <td valign="top">:</td> <td valign="top">[RWD]</td> <td>Rewind signal</td>  </tr>
        <tr>    <td valign="top">bit 1</td> <td valign="top">:</td> <td valign="top">[AL]</td>  <td>Alarm signal</td>   </tr>
        <tr>    <td valign="top">bit 2</td> <td valign="top">:</td> <td valign="top">[RST]</td> <td>Reset state signal</td> </tr>
        <tr>    <td valign="top">bit 3</td> <td valign="top">:</td> <td valign="top">[SPL]</td> <td>Automatic operation suspend-in-progress signal</td> </tr>
        <tr>    <td valign="top">bit 4</td> <td valign="top">:</td> <td valign="top">[STL]</td> <td>Automatic operation start in-progress signal</td>   </tr>
        <tr>    <td valign="top">bit 5</td> <td valign="top">:</td> <td valign="top">[OP]</td>  <td>Automatic operation in-progress signal</td> </tr>
        <tr>    <td valign="top">bit 6</td> <td valign="top">:</td> <td valign="top">[SA]</td>  <td>Servo ready</td>    </tr>
        <tr>    <td valign="top">bit 7</td> <td valign="top">:</td> <td valign="top">[MA]</td>  <td>CNC ready</td>  </tr>
        <tr>    <td valign="top">bit 8</td> <td valign="top">:</td> <td valign="top">[M00]</td> <td>Decoded M00 signal (HEAD2)</td> </tr>
        <tr>    <td valign="top">bit 9</td> <td valign="top">:</td> <td valign="top">[M01]</td> <td>Decoded M01 signal (  "  )</td> </tr>
        <tr>    <td valign="top">bit10</td> <td valign="top">:</td> <td valign="top">[M02]</td> <td>Decoded M02 signal (  "  )</td> </tr>
        <tr>    <td valign="top">bit11</td> <td valign="top">:</td> <td valign="top">[M30]</td> <td>Decoded M30 signal (  "  )</td> </tr>
        <tr>    <td valign="top">bit12</td> <td valign="top">:</td> <td valign="top">[M00]</td> <td>Decoded M00 signal (HEAD1)</td> </tr>
        <tr>    <td valign="top">bit13</td> <td valign="top">:</td> <td valign="top">[M01]</td> <td>Decoded M01 signal (  "  )</td> </tr>
        <tr>    <td valign="top">bit14</td> <td valign="top">:</td> <td valign="top">[M02]</td> <td>Decoded M02 signal (  "  )</td> </tr>
        <tr>    <td valign="top">bit15</td> <td valign="top">:</td> <td valign="top">[M30]</td> <td>Decoded M30 signal (  "  )</td> </tr>
    </table>
* BIT08 to BIT11 are valid when two-path control function is available, and not used when two-path control is not available.<br/>
* BIT16 to BIT31 are not used.<p/>

                                    <li>OSI-Ethernet</li>
    <table>
        <tr>    <td valign="top">bit 0</td>         <td valign="top">:</td> <td valign="top">(not used)</td>    <td></td>   </tr>
        <tr>    <td valign="top">bit 1</td>         <td valign="top">:</td> <td valign="top">[SPL]</td>         <td>Automatic operation suspend-in-progress signal</td>    </tr>
        <tr>    <td valign="top">bit 2</td>         <td valign="top">:</td> <td valign="top">[STL]</td>         <td>Automatic operation start in-progress signal</td>  </tr>
        <tr>    <td valign="top">bit 3</td>         <td valign="top">:</td> <td valign="top">(not used)</td>    <td></td>   </tr>
        <tr>    <td valign="top">bit 4</td>         <td valign="top">:</td> <td valign="top">[MBDT1]</td>       <td>Optional block skip check signal</td>   </tr>
        <tr>    <td valign="top">bit 5 to 8</td>    <td valign="top">:</td> <td valign="top">(not used)</td>    <td></td>   </tr>
        <tr>    <td valign="top">bit 9</td>         <td valign="top">:</td> <td valign="top">[EFALM]</td>       <td><![CDATA[Excess error alarm (stop & moving)]]></td>    </tr>
        <tr>    <td valign="top">bit10</td>         <td valign="top">:</td> <td valign="top">[PSALM]</td>       <td>P/S alarm</td>  </tr>
        <tr>    <td valign="top">bit11</td>         <td valign="top">:</td> <td valign="top">[M00/M01]</td>     <td>Decoded M00/M01 signal</td> </tr>
        <tr>    <td valign="top">bit12</td>         <td valign="top">:</td> <td valign="top">[M02]</td>         <td>Decoded M02 signal</td> </tr>
        <tr>    <td valign="top">bit13</td>         <td valign="top">:</td> <td valign="top">(not used)</td>    <td></td>   </tr>
        <tr>    <td valign="top">bit14</td>         <td valign="top">:</td> <td valign="top">[M30]</td>         <td>Decoded M30 signal</td> </tr>
        <tr>    <td valign="top">bit15 to 27</td>   <td valign="top">:</td> <td valign="top">(not used)</td>    <td></td>   </tr>
        <tr>    <td valign="top">bit28</td>         <td valign="top">:</td> <td valign="top">[AL]</td>          <td>Alarm signal</td>   </tr>
        <tr>    <td valign="top">bit29</td>         <td valign="top">:</td> <td valign="top">[OP]</td>          <td>Automatic operation in-progress signal</td>    </tr>
        <tr>    <td valign="top">bit30</td>         <td valign="top">:</td> <td valign="top">[SA]</td>          <td>Servo ready</td>    </tr>
        <tr>    <td valign="top">bit31</td>         <td valign="top">:</td> <td valign="top">[MA]</td>          <td>CNC ready</td>  </tr>
    </table>
                                </ul>
                            </dd>
                            <br/>

                            <dt>StatNgtv</dt>
                            <dd>
Status report mask (negative edge)<br/>
Set status report mask bits, which enable or mask reporting CNC status information to DNC1, DNC2 and OSI-Ethernet board.<br/>
If any of the following bits is "1", corresponding status information is reported when its state changes from "1" to "0".Bit type data.
                                <table class="dd">
                                    <tr>
                                        <td>0</td>
                                        <td>:</td>
                                        <td>mask report</td>
                                    </tr>
                                    <tr>
                                        <td>1</td>
                                        <td>:</td>
                                        <td>enable report</td>
                                    </tr>
                                </table>
                                Definition of each bit is same as "StatPstv".
                            </dd>
                            <br/>

                            <dt>StatMask</dt>
                            <dd>not used</dd>
                            <br/>

                            <dt>AlarmStat</dt>
                            <dd>
                                Alarm status<br/>
                                Bit type data<br/>
                                <p/>
                                <ul>
                                    <li>Series 150</li>
                                    <table>
                                        <tr>
                                            <td>bit 0</td>
                                            <td>:</td>
                                            <td>BACKGROUND P/S ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 1</td>
                                            <td>:</td>
                                            <td>FOREGROUND P/S ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 2</td>
                                            <td>:</td>
                                            <td>OVER HEAT ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 3</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 4</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 5</td>
                                            <td>:</td>
                                            <td>PARAMETER ENABLE SWITCH ON</td>
                                        </tr>
                                        <tr>
                                            <td>bit 6</td>
                                            <td>:</td>
                                            <td>OVER TRAVEL ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 7</td>
                                            <td>:</td>
                                            <td>PMC ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 8</td>
                                            <td>:</td>
                                            <td>EXTERNAL ALARM MESSAGE</td>
                                        </tr>
                                        <tr>
                                            <td>bit 9</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit10</td>
                                            <td>:</td>
                                            <td>SERIOUS P/S ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit11</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit12</td>
                                            <td>:</td>
                                            <td>SERVO ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit13</td>
                                            <td>:</td>
                                            <td>I/O ERROR</td>
                                        </tr>
                                        <tr>
                                            <td>bit14</td>
                                            <td>:</td>
                                            <td>POWER MUST BE OFF</td>
                                        </tr>
                                        <tr>
                                            <td>bit15</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit16</td>
                                            <td>:</td>
                                            <td>BATTERY ALARM</td>
                                        </tr>
                                    </table>
                                    * BIT17 to BIT31 are not used.<br/>
                                    <p/>

                                    <li>Series 160/180, 160i/180i/210i</li>
                                    <table>
                                        <tr>
                                            <td>bit 0</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 1</td>
                                            <td>:</td>
                                            <td>P/S ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 2</td>
                                            <td>:</td>
                                            <td>OVER HEAT ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 3</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 4</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 5</td>
                                            <td>:</td>
                                            <td>P/S 100 ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 6</td>
                                            <td>:</td>
                                            <td>OVER TRAVEL ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit 7</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 8</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit 9</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit10</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit11</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit12</td>
                                            <td>:</td>
                                            <td>SERVO ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit13</td>
                                            <td>:</td>
                                            <td>P/S 101 ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit14</td>
                                            <td>:</td>
                                            <td>P/S 000 ALARM</td>
                                        </tr>
                                        <tr>
                                            <td>bit15</td>
                                            <td>:</td>
                                            <td>(not used)</td>
                                        </tr>
                                        <tr>
                                            <td>bit16</td>
                                            <td>:</td>
                                            <td>BATTERY ALARM</td>
                                        </tr>
                                    </table>
                                    * BIT17 to BIT31 are not used.<br/>
                                </ul>
                            </dd>
                            <br/>

                            <dt>PsclHaddr</dt>
                            <dd>
                                Pascal stack address (upper limit)<br/>
                                <ul>
                                    <li>Series 150</li>
                                    Set upper limit physical address of the area where writing data is inhibited.<br/>
                                    <p/>
                                    <li>Series 160/180, 160i/180i/210i</li>
                                    not used
                                </ul>
                            </dd>
                            <br/>

                            <dt>PsclLaddr</dt>
                            <dd>
                                Pascal stack address (lower limit)<br/>
                                <ul>
                                    <li>Series 150</li>
                                    Set lower limit physical address of the area where writing data is inhibited.
                                    <p/>
                                    <li>Series 160/180, 160i/180i/210i</li>
                                    not used<br/>
                                </ul>
                            </dd>
                            <br/>

                            <dt>SvcMode1</dt>
                            <dd>Service mode 1<br/>not used</dd>
                            <br/>

                            <dt>SvcMode2</dt>
                            <dd>
                                Service mode 2<br/>
Bit type data<br/>
Selects the operation of the "read entire file directory" function of the DNC1 and OSI-Ethernet option as follows.
                                <ul>
                                    <br/>
                                    <table>
                                        <tr>
                                            <td>bit 0</td>
                                            <td>= 0</td>
                                            <td> : </td>
                                            <td>file number and size</td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td>= 1</td>
                                            <td> : </td>
                                            <td>file number only</td>
                                        </tr>
                                    </table>
* BIT01 to BIT15 are not used<br/>
* In case of DNC2 function, this bit is not used and only file number is obtained by "read entire file directory" function.
                                </ul>
                            </dd>
                            <br/>

                            <dt>FileTout</dt>
                            <dd>
                                File request time-out<br/>
Set time-out value for file request.<br/>
When "0" is set for the time-out value, conventional fixed time value (25.6sec approx.) is used as the time-out value.<br/>
Time-out time is incremented on every 32 msec internally. Actual time to time-out is calculated as follows.
                                <br/>
<p/>
<table class="dd">
  <tr> <td  valign="top">Tout = ( </td> <td>(FileTout) / 32 + 1<br/><hr/></td> <td valign="top">) x 32 [msec]</td> </tr>
</table>
In calculating underlined part above, fraction part is discarded.
                                <p/>
                                <ul>
                                    <li>Series 150</li>
                                    Valid only for OSI-Ethernet. Not used for DNC1 and DNC2.<br/>
                                    <p/>
                                    <li>Series 160/180, 160i/180i/210i</li>
                                    Valid for DNC1, DNC2 and OSI-Ethernet all.
                                </ul>
                            </dd>
                            <br/>

                            <dt>RemTout</dt>
                            <dd>
                                Remote request time-out<br/>
                                Set time-out value for remote request.<br/>
                                Refer to "FileTout" for details.<br/>

                                <br/>
                                <ul>
                                    <li>Series 150</li>
                                    Valid only for OSI-Ethernet. Not used for DNC1 and DNC2.<br/>
                                    <br/>
                                    <li>Series 160/180, 160i/180i/210i</li>
                                    Valid for DNC1, DNC2 and OSI-Ethernet all.
                                </ul>
                            </dd>
                        </dl>
                     </content>
                </item>
            </vc>
        </hssb>
    </argument>



    <errcode>
        <item>
            <name>EW_DATA</name>
            <content>
                Data error(only Series 150)<br/>
                Time-out parameter(FileTout, RemTout) is wrong.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
                The DNC1, DNC2, OSI-Ethernet option, and the extended driver/library function are necessary.
            </content>
        </item>
        <item>
            <name>EW_PROT</name>
            <content>
                 Write protection(only Series 150)<br/>
                 Protection KEY(DI/KEY2) is off.
            </content>
        </item>
        <item>
            <name>EW_MODE</name>
            <content>
                CNC mode error<br/>
                The mode is not MDI.
            </content>
        </item>
        <item>
            <name>EW_REJECT</name>
            <content>
                CNC execution denial(only Series 150)<br/>
                MDI operation is in progress.
            </content>
        </item>
    </errcode>



    <option>
        <hssb>This function needs the DNC1, DNC2, OSI-Ethernet option and the extended driver/library function.</hssb>
    </option>



    <parameter></parameter>



    <mode>
        <cmn>It is possible to use in MDI mode.</cmn>
    </mode>



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



    <reference>
        <item>
            <name>cnc_rdcomparam</name>
            <file>Data/cnc_rdcomparam.htm</file>
        </item>
    </reference>



  </func>
</root>
