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

<root>
  <func>
    <title>cnc_rdmdipntr</title>


    <declare>
      <vc>
        <include>#include "fwlib32.h"</include>
        <prottype>FWLIBAPI short WINAPI cnc_rdmdipntr(unsigned short FlibHndl, ODBMDIP *mdip);</prottype>
      </vc>
    </declare>



    <doc>
        <cmn>
            <p>Reads the execution pointer information for MDI operating program.<br/>
                The content which can be acquired is the following items.</p>
            <ul>
                <li>program number being executed</li>
                    It is basically 0 for MDI operation.(In case of Series 160i/180i-W, it is -1.)<br/>
                    When executing program is sub-program, the sub-program number is returned.<br/>
                <br/>
                <li>execution block pointer</li>
                    Block pointer which is being currently executed in CNC.<br/>
                <br/>
                <li>preread program number</li>
                    Program number read in advance.(displayed in green on the CNC screen)<br/>
                    For MDI operating, it is basically 0, and for reading sub-program in advance,
                    it is the number of sub-program.<br/>
                <br/>
                <li>preread block pointer</li>
                    Last block pointer in the program read ahead.
            </ul>
            <p>
                In Series 150,150i, it is invalid except 'preread block pointer'. (0 can be read at any time)<br/>
                In Series 160i/180i-W, 'preread program number' and 'preread block pointer' are invalid.<br/>
                In Series 300i, 'program number being executed' and 'execution block pointer' are invalid.
            </p>
            <p>
                In Series 160/180, 160i/180i, 300i, Power Mate i, it is possible to use this function for
                the program number 8 digits, however it is necessary to switch API to
                the one for the program number 8 digits.<br/>
            See <a href="general.htm#O8" target="_parent">Program number 8 digits</a> for details.

            </p>
        </cmn>
        
        <is>
            <p>Reads the execution pointer information for MDI operating program.<br/>
                The content which can be acquired is the following items.</p>
            <ul>
                <li>preread program number</li>
                    Program number read in advance.(displayed in green on the CNC screen)
                    For MDI operating, it is 0.
                <li>preread block pointer</li>
                    Last block pointer in the program read ahead.
            </ul>
            <p>
                It is possible to use this function for the program number 8 digits,
                however it is necessary to switch API to the one for the program number 8 digits.
                See <a href="general.htm#O8" target="_parent">Program number 8 digits</a> for details.
            </p>
        </is>
    </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>mdip</name>
                    <type>out</type>
                    <content>
                        <p>
                            Pointer to the ODBMDIP structure including the execution pointer information.<br/>
                            The ODBMDIP structure is as follows.</p>
<pre>
<b>For program number 4 digits,</b>
typedef struct odbmdip {
     short  mdiprog;    /* Program number being executed. */
     long   mdipntr;    /* Execution block pointer. */
     short  crntprog;   /* Preread program number.  */
     long   crntpntr;   /* Preread block pointer. */
} ODBMDIP ;

<b>For program number 8 digits,</b>
typedef struct odbmdip {
     long   mdiprog;    /* Program number being executed. */
     long   mdipntr;    /* Execution block pointer. */
     long   crntprog;   /* Preread program number.  */
     long   crntpntr;   /* Preread block pointer. */
} ODBMDIP ;
</pre>
                    </content>
                </item>
            </vc>
        </common>

        <is><hssb>
            <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>mdip</name>
                    <type>out</type>
                    <content>
                        <p>
                            Pointer to the ODBMDIP structure including the execution pointer information.<br/>
                            The ODBMDIP structure is as follows.</p>
<pre>
<b>For program number 4 digits,</b>
typedef struct odbmdip {
     short  mdiprog;    /* Not used */
     long   mdipntr;    /* Not used */
     short  crntprog;   /* Preread program number */
     long   crntpntr;   /* Preread block pointer  */
} ODBMDIP ;

<b>For program number 8 digits,</b>
typedef struct odbmdip {
     long   mdiprog;    /* Not used */
     long   mdipntr;    /* Not used */
     long   crntprog;   /* Preread program number */
     long   crntpntr;   /* Preread block pointer  */
} ODBMDIP ;
</pre>
                    </content>
                </item>
            </vc>
        </hssb></is>
    </argument>



    <errcode>
        <item class="xis">
            <name>EW_FUNC</name>
            <content>
                Unavailable (Series 150i,160/180, 160i/180i, Power Mate i)<br/>
                This application is not customized for the program number 8 digits.<br/>
                See <a href="general.htm#O8" target="_parent">Program number 8 digits</a> for details.
            </content>
        </item>
        <item>
            <name>EW_NOOPT</name>
            <content>
                No option<br/>
                The extended driver/library function is necessary.
            </content>
        </item>
        <item>
            <name>EW_MODE</name>
            <content>
                CNC mode error<br/>
                Set CNC mode to MDI.
            </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 and 300i, 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>
        <type>
            <li>Series 160i/180i-W</li>
            <span class="dd">3203#1 = 1 (must be set)</span>
        </type>
    </parameter>

    <is_parameter>
    </is_parameter>



    <mode>
        <cmn>
            This function must be used in MDI mode.
        </cmn>
    </mode>



    <support>
        <m>
            <fs0ia>H</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>H</fs15>
            <fs15i>E</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</fs21ib>
            <fs30i>O</fs30i>
        </m>
        <t>
            <fs0ia>H</fs0ia>
            <fs0ib>O</fs0ib>
            <fs15>H</fs15>
            <fs15i>X</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>O</fs16ia>
            <fs18ia>O</fs18ia>
            <fs21ia>O</fs21ia>
            <fs16ib>O</fs16ib>
            <fs18ib>O</fs18ib>
            <fs21ib>O</fs21ib>
            <fs30i>O</fs30i>
        </t>
        <lc>
            <fs0ia>X</fs0ia>
            <fs0ib>X</fs0ib>
            <fs15>X</fs15>
            <fs15i>X</fs15i>
            <fs16>H</fs16>
            <fs18>H</fs18>
            <fs21>H</fs21>
            <fs16ia>H</fs16ia>
            <fs18ia>H</fs18ia>
            <fs21ia>H</fs21ia>
            <fs16ib>H</fs16ib>
            <fs18ib>H</fs18ib>
            <fs21ib>H</fs21ib>
            <fs30i>X</fs30i>
        </lc>
        <p>
            <fs16i>O</fs16i>
            <fs18i>O</fs18i>
        </p>
        <l>
            <fs16i>O</fs16i>
            <fs18i>X</fs18i>
        </l>
        <w>
            <fs16i>O</fs16i>
            <fs18i>O</fs18i>
        </w>
        <pw>
            <d>O</d>
            <h>O</h>
        </pw>
        
        <is>
            <m>
                <fs30is>O</fs30is>
            </m>
            <t>
                <fs30is>O</fs30is>
            </t>
        </is>
    </support>



    <reference>
        <item>
            <name>cnc_wrmdiprog</name>
            <file>Program/cnc_wrmdiprog.htm</file>
        </item>
        <item>
            <name>cnc_wrmdipntr</name>
            <file>Program/cnc_wrmdipntr.htm</file>
        </item>
    </reference>



  </func>
</root>
