
3. EXECUTION MACRO
B–62073E–2/03
40
Call code
Parameter to be spe-
cified
Variable number in
which the specified
code is stored
Called program
number
Call mode
M Macro call 9020–9029 Unused No. 8523–8532
Special Subprogram call 9004, 9005 #146, #147 ACL1, ACL2 (No.
8508#0, #1) No. 8544,
8545
Range–designation M Subprogram call 9009 #148 No. 8538, 8539
Range–designation G Macro call Specified in the
parameter
Unused No.8546
No. 8551, 8552
T Macro call 9008 #27 TMCC (No. 8502#6)
Note
If the system features a SUB–CPU, only programs 9000 to
9999 can be stored and executed as execution macros.
The priorities of calling custom macros by G, M, S, T, and B, and calling
macro executors by G, M, S, T, and B are as follows:
High LowPriority
Calling custom
macros by G, M, S,
T, and B
Calling macro
executors by G, M,
S, T, and B
Calling macro
executors by special
codes
Calling macro
executors by
M–code with range
specified
>>>
Call of each macro, comparison of subprogram call code and program
number to be called is determined by a compile parameter.
(1) The return sequence number definition for returning to the user’s
program
When operational control is returned to the user’s program from
the P–CODE program, control passes to the sequence number of the
user’s program defined by address P.
(2) Macro modal call is enabled by setting a negative value in the
G–CODE parameters (Nos. 8513 to 8522) for macro call. For
example, –11 set in a parameter represents G11 for a modal call state.
Whether the modal call state corresponds to G66 or G66.1 depends
on parameter No. 8509, MODC.
The macro modal call function can be used to call a P–CODE program
from a CNC program. The function cannot be used to call a P–CODE
program from a P–CODE program.
G67 is used for modal call cancellation.
For the detailed specifications, refer to the description of macro call
using G–CODEs in the FANUC Series 15 operator’s manual.
When parameter No. 8513=–100, and parameter No. 8509 MODC=0
CNC program
G91 G01 F100. ;
Example