Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 1048 -
(*1) It is inhibited to write to the all data of address 'F' and 'X',
"R9000",..,"R9199" and "K0017",..,"K0019".
(*2) Address "G1xxx" and "F1xxx" are I/O area for the path#2, and "G2xxx"
and "F2xxx" for the path#3.
(*3) Exclusion control to PMC ladder program is not offered for writing PMC
data using the pointer by this function. Therefore, when both C-EXE
application program and PMC ladder program write to the same PMC
address, application programs must take exclusion control. Especially,
it is not recommended that both programs write to the same address by
bit unit. Bit operations like "OR(|)" or "AND(&)", which attempt to
set bit ON/OFF, may return incorrect result because NC's processor and
PMC's processor run not synchronously each other.
The following example program reads M-CODE (F0010-F0013) by High-
Level task and display it on the screen by Main task.
<< D-RAM shared variable (dramver.c) >>
unsigned long readmcode ;
<< Main task >>
extern unsigned long readmcode ;
void main( void )
{
printf ( "mcode=%8lu", readmcode ) ;
}
<< High-Level task >>
extern unsigned long readmcode ;
void main( void )
{
unsigned long *pmcad ;
[Initialization]
pmcad = (unsigned long *)pmc_getioptr( 1,10 ) ; /* F10 */
for(;;) {
[Process for each 8 msec]
readmcode = *pmcad ;
rettask() ;
}
}