M97 Local Subprogram Call

Next Generation 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
L - Repeats subprogram call (1-99) times.

M97 is used to call a subprogram referenced by a line number (N) within the same program. A code is required and must match a line number within the same program. This is useful for simple subprograms within a program; does not require a separate program. The subprogram must end with an M99. Lnn code in the M97 block repeats the subprogram call nn times.

note: The subprogram is within the body of the main program, placed after the M30.

M97 Example:

% O00001 ; M97 P100 L4 (CALLS N100 SUBPROGRAM) ; M30 ; N100 (SUBPROGRAM) ; ; M00 ; M99 (RETURNS TO MAIN PROGRAM) ; %

This code calls a subprogram (subprogram) referenced by a line number (N) within the same program. A Pnn code is required and must match a line number within the same program. This is useful for subprograms within a program as it does not require a separate program. The subprogram must end with an M99. An Lnn code in the M97 block will repeat the subprogram call nn times.

% O69701 (M97 LOCAL SUBPROGRAM CALL) ; M97 P1000 L2 (L2 will run the N1000 line twice) ; M30 ; N1000 G00 G90 G55 X0 Z0 (N line that will run after M97 P1000 is run) ; S500 M03 ; G00 Z-.5 ; G01 X.5 F100. ; G03 ZI-.5 ; G01 X0 ; Z1. F50. ; G28 U0 ; G28 W0 ; G90 ; M99 ; %

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