M98 & M99 – Sub Program Call

MASSO supports sub-program calls using M98 and M99.

 

Up to 5 levels of sub-program nesting are supported.
Sub-programs allow commonly used toolpaths to be reused without rewriting the same code multiple times.

 

When a sub-program is called, MASSO looks for a separate .nc file and runs it as a sub-program.
Using separate files allows common program sections to be shared between different jobs.

 


 

 

 

 

 


INFORMATION: The main program and all sub-program files must be located in the same folder on the USB flash drive. All sub-program files must be .nc files. For software versions prior to v5.03, the main and sub-program files must be located in the root directory of the flash drive.

 


INFORMATION: Sub-program names can be single digit, but must not be prefixed with a zero. 1.nc is valid. 01.nc is not valid.

 


INFORMATION: Sub-program toolpaths are not drawn on the screen during program load.

 


M98 – Sub-Program Call

 


Syntax & Parameters

 

  • M98

  • P value – Defines the sub-program file name

  • L value – Optional. Specifies how many times the sub-program will run

     


Example Program

 

N10 M98 P10 L5

 

  • MASSO looks for the file 10.nc as defined by the P value.

  • The file is executed 5 times as defined by the L value.

 

 

INFORMATION: If the 10.nc file is not found, an error message is displayed and the program enters Feed Hold. When a program is loaded from the F6 screen, MASSO checks that all required sub-program files are present on the USB drive. If any file is missing, an error is shown.

 


M99 – End Sub-Program or Return

The M99 command ends a sub-program and returns control to the main program.

 


Syntax & Parameters

 

  • M99

     


Example Program

 

N10 M99 

 

When this line is executed inside a sub-program file, control returns to the main program.