M98 & M99 – Sub Program Call

M98 calls a sub-program and M99 returns from it. Sub-programs let you reuse common toolpaths without rewriting the same code. Each sub-program is a separate .nc file, so it can be shared between jobs. Up to 5 levels of nesting are supported.

Call
M98 P__ L__
Return
M99
Nesting
Up to 5 levels

Main program calling sub-program files

1. File rules

RuleDetails
LocationMain program and all sub-programs in the same folder on the USB flash drive. Before software v5.03, they must be in the root directory.
File typeSub-programs must be .nc files.
File nameA number, with no leading zero. 1.nc is valid; 01.nc is not.  File name can have a maximum of 7 digits.
PreviewSub-program toolpaths are not drawn on screen when the program loads.

2. M98 – Sub-program call

WordMeaning
PSub-program file name (number).
L (optional)Number of times to run the sub-program.
N10 M98 P10 L5

Runs 10.nc five times.

INFORMATION

When you load a program from the F6 screen, MASSO checks that all sub-program files are on the USB drive and shows an error if any are missing. If a file is missing at run time, an error is shown and the program enters Feed Hold.

3. M99 – End sub-program and return

N10 M99

Inside a sub-program file, ends the sub-program and returns to the main program.