Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 379 -
------------------------------------------------------------------------------
1.27 Read sequence number in executing. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_rdseqnum
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_rdseqnum( struct odbact *buf ) ;
struct odbact {
int dummy[2] ; /* Not used. */
long data ; /* Sequence number in executing. */
} ;
[Arguments]
buf Buffer in which sequence number is stored.
[Return]
0 Successful.
-1 It has been failed to read sequence number in executing
because the CNC software was updating the sequence number.
[Description]
Reads the sequence number of the NC program which is being currently
executed in CNC.
If the NC program has no sequence numbers in its all blocks, the
sequence number of the last executed block is read.
This function is used for watch the block being executed or the
current process by the application program, or only displaying the
current sequence number.
The sequence number is stored in "buf.data" with unsigned binary
format.
[Example]
The following program displays "CURRENT N30" while
the block "O1234/N30" of the following NC program is being executed.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbact buf ;
cnc_rdseqnum( &buf ) ;
printf( "CURRENT N%ld\n", buf.data ) ;
}
O1234 ;
N10 M3 S1500 ;
N20 T12 ;