Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 376 -
Format of input data
~~~~~~~~~~~~~~~~~~~~
- type=0
Each data are stored in each members of the structure with binary
format.
- type=1
ASCII strings are stored in "buf.u.asc" with following format.
% LF d1 LF d2 LF d3 LF d4 LF %
LF 0x0A ('\n').
d1 Amount of registered programs.
d2 Amount of available programs.
d3 Character number of used memory.
d4 Character number of unused memory.
d1 - d4 are ASCII strings without the leading '0'.
[Example]
The following program reads the management data of NC program, and
displays them.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbnc buf ;
int ret ;
ret = cnc_rdproginfo( 0, 16, &buf ) ;
if ( ret )
printf( "ERROR: %d\n", ret ) ;
else {
printf( "Registered program number = %d\n",
buf.u.bin.reg_prg ) ;
printf( "Registerable program number = %d\n",
buf.u.bin.unreg_prg ) ;
printf( "Used memory = %ld\n",
buf.u.bin.used_mem ) ;
printf( "Free memory = %ld\n",
buf.u.bin.unused_mem ) ;
}
}