
B–61803E–1/10
3. EXECUTION MACRO
PROGRAMMING
25
To call a P-CODE program from the user program, the codes shown in
Table 3.1 are used.
Table 3.1 Codes for Calling P–CODE program
Codes for call Type of call
Program num-
bers called
Common variables in
which a specified
code is stored
Parameters to be set
T Subprogram call 9000 #149 Compile parameter TCAL(No.9002#0)
M Subprogram call 9000-9003 None Compile parameters No.9010-9012
Specified code Subprogram call
9004
9005
#146,#147
Compile parameter ACL1,ACL2
(No.9002#1,#2)
G
Macro call,
Modal call
9010-9019 None
Compile parameters No.9013-9022,
No.9034
M Macro call 9020-9029 None Compile parameters No.9023-9032
T Macro call 9008 #27 Compile parameter TMACC(No.9005#7)
M (range specifi-
cation)
Sbprogram call 9009 #148 Compile parameters No.9042,9043
G (range specifi-
cation)
Macro call Parameter None Compile parameters No.9045-9047
Address for axis Macro call
9009 or 9031 to
9038
#27
Compile parameter
AX*CL(No.9005#0-#3, No.9008#0-#3)
AXCLS (No.9005#4)
NOTE
These codes cannot be used in combination. For example,
a macro call by a T code cannot be executed together with
a subprogram call by an M code.
Correspondence between codes that call macro programs or subprograms
and program numbers of called programs, and whether or not to call a
subprogram or a macro , are determined by compile parameters. Since
these parameters are registered to the ROM at compilation, be sure to
designate them at compilation. Exclusive codes that call subprograms
shall be set to CNC parameter (No,6090,6091) in executing.
(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.
User’s program
O0001;
:
G100X123Y456;
G00X789;
:
N100G00Y999;
:
M02;
P–CODE program
O9010;
#100=#24+#25;
:
M99P100;
3.1
CALL CODE AND
PROGRAM NO.