M99 Subprogram Return or Loop

Classic Control - Mill 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
P - Program line number to go to when conditional test is met

M99 has three main uses:

  • M99 is used at the end of a subprogram, local subprogram, or macro to return back to the main program.
  • An M99 Pnn jumps the program to the corresponding Nnn in the program.
  • An M99 in the main program will cause the program to loop back to the beginning and execute until RESET is pressed.
note: Fanuc behavior is simulated 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 ;
M30 ;
subprogram:
O0002 ;
O0002 ;
M99 ;
M99 P100 ;

M99 With Macros - If the machine is equipped with the optional macros, use a global variable and specify a block to jump to by adding #nnn=dddd in the sub-program and then using M99 P#nnn after the sub-program 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.

Feedback