
B-75074EN/04 GENERAL 4.NC PROGRAM MANAGEMENT
- 39 -
4.4.2 Details of the Subprogram Expanded Transfer Function
Subprogram call format
A main program can use four subprogram call formats:
(1) M98PxxxxLyy
(2) M98Pyyxxxx
(3) G65PxxxxLyy
(4) G66PxxxxLyy
(5) M98P<file name>Lyy
(6) G65P<file name>Lyy
(7) G66P<file name>Lyy
In these formats, xxxx represents a program number, and yy represents
the number of call repeats. The number of repeats can be omitted. When
format (2) is used, a 4- or 8-digit program number must be specified.
With a CNC supporting file name management, a subprogram can be
called by file name as in (5) through (7).
In an expanded transfer, a subprogram called several times by the main
program is transferred the specified number of times, with the
subprogram expanded each time in the main program.
Subprogram calling can be nested to a depth of 15 levels with Series 30i
/31i /32i, or to a depth of 8 levels with the other NC series.
When a subprogram called by the main program is found to be
nonexistent in the set directory, an error occurs. This means that the
transfer of the main program stops halfway, and the subprogram is not
transferred.
NOTE
1 The program number xxxx or file name must be directly
specifiable. A program number specified with a macro
variable cannot be transferred.
2 M99Pnnnn (function for returning to a sequence number)
cannot be used. When a subprogram is read up to M99, the
end of the subprogram is assumed. Control returns to the
main program, and Pnnnn is ignored.
3 Instructions such as branch instructions (GOTO, IF, WHILE)
are not processed, but are transferred to the CNC without
modification.
4 In an expanded transfer, the transfer of a subprogram alone
is impossible. If a subprogram alone is transferred, an error
indicating that the main program contains M99 occurs.
5 In a block that calls a subprogram, no other address can be
specified.
Example:When the block M98P9000G00X00Y00 is sent in
an expanded transfer, the subprogram
O9000.DAT can be transferred, but the portion of
G00X00Y00 cannot be transferred.