49
Subprogram Call
M98
Format
M98[P
times number
]
Description
The subprogram of the specified number is called up and executed. A subprogram call can be made not only from a main program, but
from another subprogram as well. However, attempting to call another subprogram from a fourth-level subprogram of a main program
causes an error to be generated.
The times parameter indicates the number of calls. The subprogram is called and executed the number of times specified by this
parameter. When times is not specified, the subprogram is called once.
The number parameter indicates the program number of the subprogram. A four-digit number must be specified. For example, “0002”
is used to specify Program number 2. If a program of the specified number does not exist, an error is generated.
N254M98P0003
N100M98P0002
N101G00X10.
M99
N255G00Y5.
M99
M99
N176M98P20006
N177G00Y2.
O0002
O0005
O0006
..........
N312M98P0004
M99
N313G00Z0
O0003
N447M98P0005
M99
N448G00X0
O0004
* Attempting to call another
subprogram from a fourth-level
subprogram of a main program
causes an error to be generated.
Main
program
(Program No. 1)
Subprogram
(Program No. 2)
Subprogram
(Program No. 6)
Call
Call
Call
Call
Call
Subprogram
(Program No. 3)
Subprogram
(Program No. 4)
Subprogram
(Program No. 5)
Second
times
Parameter
Function
Acceptable range
Effective range
times
Number of calls
Range 2
1–9999
number
Program number
Range 2
0001–9999