Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 693 -
[Example]
This is procedure to customize the softkey of POSITION screen as
follows.
Original [ ABS ][ REL ][ ALL ][ ]
After customizing [ USER ][ ABS ][ ][ ]
1. Define a string " USER " by FANUC character code.
unsigned int skey_str[] = {
0x0020,0x0055,0x0053,0x0045,0x0052,0x0020, /* " USER " */
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020 /* " " */
} ;
2. Define customizing data.
struct user_softkey skey_table[] = {
/* Delete [ ALL ] key. */
{ 3, SKEY_OP_DEL, 0, NULL },
/* Move [ ABS ] to [ REL ]'s position. */
{ 2, 1, 0, NULL },
/* Define new user key at [ ABS ]'s position, the small
classification is 3. Register the small classification 3 screen
in POS function as user's screen using "crt_setuserscrn"
function. */
{ 1, SKEY_OP_USER, 3, skey_str }
} ;
3. Call "crt_setuserskey" function.
crt_setuserskey( SKEY_POSITION, skey_tbl_size(skey_table),
skey_table ) ;
After customizing, the small classification 3 user's screen is
displayed by pushing [ USER ] key, and the ordinary absolute position
screen by [ ABS ] key.
The above procedures are described in the following program.
#include <crt.h>
void example( void ) {
unsigned int skey_str[] = {
0x0020,0x0055,0x0053,0x0045,0x0052,0x0020, /* " USER " */
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020 /* " " */
} ;
struct user_softkey skey_table[] = {
{ 3, SKEY_OP_DEL, 0, NULL },
{ 2, 1, 0, NULL },
{ 1, SKEY_OP_USER, 3, skey_str }
} ;
crt_setuserskey( SKEY_POSITION, skey_tbl_size(skey_table),
skey_table ) ;
}