Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 939 -
(3) How to control switching CNC screen by C Application
For FS16/18, usually the CNC system software manages all screen switching
including C user screen. The C application program can control this screen
switching by function keys. The required procedures are mentioned below.
(a) Use auxiliary task which is called periodically in C application.
Set the calling period of the task as 10 - 100 [msec].
(b) Set the NC parameters as below.
No.3111#7 NPA = 1 Don't change automatically to NC's alarm
screen when NC alarm or PMC message rises.
No.8650#1 CNA = 1 Don't change to NC's alarm screen if any
alarm rises while C user screen is displayed.
(c) Call the following function in the initialization process of the main
task just after power-on.
crt_setswt( CRT_SWT_MFKY ) ;
After execution of this function, NC system software doesn't read the
function keys of MDI keyboard.
(d) Execute the following process in auxiliary task.
Call "crt_getcurscrn()" function always, and save the small
classification number of each large classification screen.
Read function key status using "crt_readfkey()" function.
When any function is pushed, change the screen using "crt_cncscrn()"
function with specifying the small classification number saved before.
Concrete coding is as follows.
* Variables used in the auxiliary task.
unsigned int idx, fkey, newscrn, curscrn, savescrn[8] ;
* Initialization process in the auxiliary task.
for ( idx = 0 ; idx < 8 ; idx++ )
savescrn[idx] = idx ; /* Init. small class. */
* Periodical process in the auxiliary task.
curscrn = crt_getcurscrn() ; /* Get the current screen index */
savescrn[curscrn % 0x100] = curscrn ; /* Save it */
if ( fkey = crt_readfkey() ) { /* If any function key is pushed, */
newscrn = savescrn[fkey - MDIKEY_POS] ; /*Saved small class.*/
if ( newscrn != curscrn ) { /* [*] */
crt_cncscrn( newscrn ) ;
crt_setswt( CRT_SWT_MFKY ) ;
}
}