
------------------------------------------------------------------------------
1.19 Read program number in executing. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_rdprgnum
[Syntax]
#include <data.h>
#include <fwindow.h>
short cnc_rdprgnum( struct odbpro *buf ) ;
struct odbpro {
short dummy[2] ; /* Not used. */
long data ; /* Program number in executing. */
long mdata ; /* Program number of the main
program. */
} ;
[Arguments]
buf Buffer in which program numbers are stored.
[Return]
EW_OK( 0) Successful.
[Description]
Reads program number of the program which is being currently executed
in CNC.
If that program is a sub-program, the program number of the main
program of it is also read. The program number which can be read is
one of the root program. If the program in executing is not a
sub-program, the main program number is set as 0.
This function is used for management of NC programs in CNC by the
application program, etc.
The program numbers are stored in "buf.data" and 'buf.mdata" with
unsigned binary format.