Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 659 -
Extended MDI key reading
~~~~~~~~~~~~~~~~~~~~~~~~
KEY_BIOS of C Executor scans the extended part of MDI key by setting of
the CNC parameter No.8650#2 EKY as "1". The user application program can read
keys which are assigned in the extended part by setting key code to the
extended part of the key matrix. (The user application program can't read
extended keys if key codes are not assigned.)
Key bit matrix
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
Line 0 | | | | | | | | |
1 | | | | | | | | |
2 | | | | | | | | |
3 | | | | | | | | |
4 | | | | | | | | | --> This part is scanned
5 | | | | | | | | | ordinarily.
6 | | | | | | | | |
7 | | | | | | | | |
8 | | | | | | | | |
+---+---+---+---+---+---+---+---+
9 | | | | | | | | |
A | | | | | | | | | --> Extended part
B | | | | | | | | |
+---+---+---+---+---+---+---+---+
Line A and B are added in the matrix.
* How to set key codes
(1) Get the key matrix using "aux_mdi_getmatrix" function.
(2) Write the function flag and the key code of the key in the extended part.
Set 0x10 for function flag ordinarily. Set ASCII code of the character
or the code which is not used in the other key for key code.
(3) Restore the key matrix using "aux_mdi_putmatrix" function.
(Example) Setting key code to the key in 7th bit of 10th line.
The key code to be assigned is '\' and '@' for "[SHIFT]+".
size_t mtxlen ;
unsigned char *ptrmatrix ;
mtxlen = aux_mdi_control( MDI_GET_MTXLEN ) ;
ptrmatrix = (unsigned char *)malloc( mtxlen ) ;
aux_mdi_getmatrix( ptrmatrix, mtxlen, MMC_MDI_MATRIX ) ;
*(ptrmatrix+0x57) = 0x10 ; /* function flag */
*(ptrmatrix+0x10E) = 0x5C ; /* '\' */
*(ptrmatrix+0x10F) = 0x40 ; /* '@' */
aux_mdi_putmatrix( ptrmatrix, mtxlen, MMC_MDI_MATRIX ) ;