M98 & M99 – Sub Program Call

MASSO supports Sub-Program Call using M98 & M99 codes. Subprograms with up to 5 levels of nesting is supported, with this feature sub programs can be called from the main program without the need to rewrite the same program again and again.

When a sub program is called, MASSO looks for a separate ".nc" file and runs that as a sub-program. Having a separate file approach means that programs that have common features can now be used used with other programs.

INFORMATION: The Main program and all sub-program files must be located in the same folder on the USB Flash drive. All subprogram files must be .nc files. For software versions prior to v5.03 the main and sub programs must reside in the root directory of your Flash Drive.

INFORMATION: Sub-program names can be single digit, but you must not prefix the name with a 0. 1.nc is valid 01.nc is not valid

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

M98 Sub-Program Call

Syntax & Parameters

  • M98
  • P Value - The P value is used to define the sub program file name.
  • L Value - The L value can be used to run the sub program multiple times.

Example program

N10 M98 P10 L5

The above program will look for the 10.nc file as set by the P value and will run it 5 times as set by L value.

NOTE: If the 10.nc file is not found an error message on the screen is displayed and program goes into feedhold. When a program is loaded from F6 screen, MASSO checks that all sub-program files are on the USB and if a file is missing an error is shown to the user

M99 End Sub-Program or Return

M99 command is used to End Sub-Program or Return back to the main program.

Syntax & Parameters

  • M99

Example program

N10 M99 

When the above line is found in a sub program file, the control returns back to the main program.