Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 366 -
------------------------------------------------------------------------------
1.20 Read condition of registration/comparison buffer. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_buff
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_buff( struct odbapb *buf ) ;
struct odbapb {
int dummy[2] ; /* Not used. */
int data ; /* Buffer condition. */
} ;
[Arguments]
buf Buffer in which BUFFER condition is stored.
[Return]
0 Successful. (There is free room in buffer.)
1 The start-up procedure of CNC for registering or comparing NC
program has not been completed, or no start-up command has
been commanded.
10 Buffer is full.
[Description]
Reads condition of buffer which is used for registration and
comparison of NC program by address specification.
Status of buffer condition is returned as below.
buf.data = 0 No room in buffer.
buf.data = 1 There is free room in buffer. (Buffer is
available.)
[Example]
The following program reads buffer condition and displays the result.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct iodbapb buf ;
int ret ;
ret = cnc_buff( &buf ) ;
if ( buf.data == 0 )
printf( "BUFFER is full.\n" ) ;
else
printf( "BUFFER is empty.\n" ) ;
}