M99 Subprogram Return or Loop

Classic Control - Lathe Operator's Manual

The Online Interactive Operator's Manual is currently available in English only.

A PDF version of the Operator's Manual is available for download in multiple languages. Click the link below to view the Operator's Manual in your language. Click "Continue" to view the online version in English.

Get a translated PDF Download Continue

M99 Subprogram Return or Loop

This code has three main uses:

  1. An M99 is used at the end of a subprogram, local subprogram, or macro to return back to the main program.

  2. An M99 Pnn jumps the program to the corresponding Nnn in the program.

  3. An M99 in the main program causes the program to loop back to the beginning and run until RESET is pressed.

Programming Notes - You can simulate Fanuc behavior by using the following code:

  Haas Fanuc
Calling program: O0001 O0001
  ... ...
  N50 M98 P2 N50 M98 P2
  N51 M99 P100 ...
  ... N100 (continue here)
  N100 (continue here) ...
  ... M30
Subprogram: O0002 O0002
  M99 M99 P100

M99 With Macros - If the machine is equipped with the optional macros, you can use a global variable and specify a block to jump to by adding #nnn = dddd in the subroutine and then using M99 P#nnn after the subroutine call.

Be aware: Many service and repair procedures should be done only by authorized personnel. The service technicians at your Haas Factory Outlet (HFO) have the training, experience, and are certified to do these tasks safely and correctly. You should not do machine repair or service procedures unless you are qualified and knowledgeable about the processes.

Danger: Some service procedures can be dangerous or life-threatening. DO NOT attempt a procedure that you do not completely understand. Contact your Haas Factory Outlet (HFO) and schedule a service technician visit if you have any doubts about doing a procedure.