Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 487 -
[Example]
The function "disp_modal", which displays the modal data on the screen
using this function, is included in
"position.c" file of the sample application.
It is shown as below. (This function displays on only 14-inch
display.)
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
/* --- display one modal G-code --- */
void disp_modal_g( int type, unsigned int *g_code, unsigned int line,
unsigned int column )
{
int ret ;
struct odbmo modal ;
unsigned char cur ;
ret = cnc_modal( type, 0, &modal ) ;
if ( ret ) cnc_err( ret, "MODAL" ) ;
cur = ( modal.modal.g_data[0] & 0x80 ) ? '*' : ' ' ;
printf( "\033[%u;%uH%cG%02d", line, column, cur,
g_code[modal.modal.g_data[0] & 0x7f] ) ;
}
/* --- display one modal data --- */
void disp_one_modal( int type, char adrs, unsigned int line,
unsigned int column )
{
int ret ;
struct odbmo modal ;
unsigned char cur ;
ret = cnc_modal( type, 0, &modal ) ;
if ( ret ) cnc_err( ret, "MODAL" ) ;
if ( modal.modal.aux.flag1 & 0x20 )
modal.modal.aux.aux_data = -modal.modal.aux.aux_data ;
cur = ( modal.modal.aux.flag1 & 0x80 ) ? '*' : ' ' ;
printf( "\033[%u;%uH%c%c%8ld", line, column, cur, adrs,
modal.modal.aux.aux_data ) ;
}
/* to be continued on the next page... */