M Codes
1 7 3
96-8000 rev R June 2007
O0100
(SUB-PROGAM NUMBER)
G00 G90 G55 X0 Y0
S500 M03
G43 H01 Z1.
Z-.5
G01 G41 X.5 F100.
G03 YI-.5
G01 X0 G40
Z1. F50.
G91 G28 Z0
G90
M99
M99 Sub-Program Return or Loop
This code is used to return to the main program from a subroutine or macro, the format is M99 Pnnnn (Pnnnn is the
line in the main program to return to). It will cause the main program to loop back to the beginning without stopping
when used in the main program.
Programming Notes - You can simulate Fanuc behavior by using the following code:
calling program: Haas
Fanuc
O0001
O0001
...
...
N50 M98 P2
N50 M98 P2
N51 M99 P100
...
...
N100 (continue here)
N100 (continue here)
...
...
M30
M30
subroutine:
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.
M101 MOM (Minimum Oil Machining) Canned Cycle Mode
M101 tells the system to start MOM whenever the appropriate G-Code Canned Cycle is encountered (G73, G74,
G76, G77, and G81 thru G89). Oil is dispensed for the on time duration whenever the tool is at the R-Plane.
I(on time): Canned Cycle Mode
On Time: Squirt duration in seconds (0.050 is 50 msec).
M102 MOM Mode
M102 tells the system to ignore the G-Code Canned Cycles and dispense oil whenever M102 is encountered in the
program. Oil is dispensed for the on time duration at a periodicity dictated by the Time Between Squirts MOM.
I(on time) J(cycle time): MOM Mode
On Time: Squirt duration in seconds (0.050 is 50 msec).
Cycle Time: Time (in seconds) between squirts.
M103 Cancels MOM Mode.
M103 tells the system to cancel both Canned Mode and MOM Mode (no oil will be dispensed via MOM).
M103: Cancels MOM Mode.
M109 Interactive User Input
This M code allows a G-code program to place a short prompt (message) on the screen. A macro variable in the
range 500 through 599 must be specified by a P code. The program can check for any character that can be
entered from the keyboard by comparing with the decimal equivalent of the ASCII character (G47, Text Engraving,
has a list of ASCII characters).
The following sample program will ask the user a Yes or No question, then wait for either a “Y” or an “N” to be
entered. All other characters will be ignored.
Summary of Contents for Mill
Page 12: ...96 8000 rev R June 2007 Safety 5 ...
Page 14: ...96 8000 rev R June 2007 Safety 7 LATHE WARNING DECALS ...
Page 15: ...8 Safety 96 8000 rev R June 2007 ...
Page 17: ...10 Introduction 96 8000 rev R June 2007 ...
Page 117: ...110 4 5 Axis Programming 96 8000 rev R June 2007 ...
Page 199: ...Settings 192 96 8000 rev R June 2007 ...