
B–62073E–2/03
3. EXECUTION MACRO
39
3
EXECUTION MACRO
Only a registered P–CODE program cannot be executed. It is called from
the user program by G, M, T code, or specified code by parameter setting,
and executed. In case of macro call, argument designation is possible, and
it is compared as a local variable at the P–CODE (execution macro) side.
Further, for the specification method for the argument, in the same manner
as the normal NC macro, there are possible 2 types of specification
methods, argument specification I, argument specification II, or a
mixture of argument specification I and II. Regarding argument
specification I and argument specification II, refer to FANUC Series
OPERATOR’S MANUAL (macro call command). Moreover, if a minus
value is set at parameter as for macro call by G code, modal call of
P–CODE program can be done by corresponding G code.
P–CODE program inside
macro ROM cassette
(execution macro)
User program
(Program edit memory)
Parameter
8513 101
G–CODE call
M–CODE call
T–CODE call
S–CODE call
B–CODE call
O0001 ;
G92X0Y0 ;
G00X100. Y100. ;
G101
<Argument>
M02 ;
O9010 ;
#100=#100+10 ;
M99 ;
To call a P–CODE program from the user program, call with G, M, or T
code as indicated above.)
Call code Call mode
Called program
number
Variable number in
which the specified
code is stored
Parameter to be spe-
cified
T Subprogram call 9000 #149 TCAL (No. 8508#2)
M Subprogram call 9001–9003 Unused No. 8510–8512
S Subprogram call 9029 #147 SCAL (No. 8508#3)
B
(Second miscella-
neous function code)
Subprogram call 9028 #146 BCAL (No. 8508#5)
No. 1030
G Macro call Continuous
call
9010–9019 Unused No. 8513–8522
MODC (No. 8509#2)
3.1
INTERFACE WITH
USER PROGRAM
AND EXECUTION
MACRO IN P–CODE
PROGRAM
3.1.1
Call Code and Program
No.