Home › M-codes › Haas NGC › M109
M109 Interactive user input
Haas NGC M-code · Mill, Lathe
On mills: Interactive user input
Lets the program ask the operator for a one character answer, stored in a macro variable given by P.
Format
M109 P
Addresses
| Address | What it does |
|---|---|
P | Macro variable number for the answer, in the 500 range |
How it works
Not modal. Acts once on the line where it is commanded.
Example program
(PRESS Y TO RUN THE FINISH PASS)
M109 P501 (STORE THE ANSWER IN #501)
IF [#501 EQ 89] GOTO100 (89 IS THE CODE FOR Y)
M109 P501 (STORE THE ANSWER IN #501)
IF [#501 EQ 89] GOTO100 (89 IS THE CODE FOR Y)
Example is in inch. Check offsets and clearances first.
Watch out for
- Needs macros. The program waits until the operator answers.
- Put the question in a comment on the line before M109.
On lathes: Interactive user input
Shows a prompt and waits for the operator to press a key. The key value is stored in macro variable 500 to 549 given by P.
Format
M109 P
Addresses
| Address | What it does |
|---|---|
P | Macro variable 500 to 549 that stores the key pressed |
How it works
Non-modal.
Example program
(CUT ANOTHER PASS Y OR N)
M109 P501 (WAIT FOR KEY)
IF [#501 EQ 89] GOTO10 (89 IS Y)
M30 (END)
…
M109 P501 (WAIT FOR KEY)
IF [#501 EQ 89] GOTO10 (89 IS Y)
M30 (END)
…
The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- The stored value is the decimal ASCII code of the key, for example 89 for Y.
- Needs the macro option.
Related codes
M109 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Doosan (Fanuc) | T.S.C coolant off(left spindle) |
| Mazak (EIA) | Workpiece measurement DIS end |
| Okuma OSP | Cancel of M110 |
| Heidenhain TNC (ISO) | Constant feed at the cutting edge |
| Centroid CNC12 Acorn | Disable override knobs |
Every M-code for Haas NGC in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open M109 in the app All Haas NGC M-codes