Home › M-codes › LinuxCNC Tormach › M66
M66 Wait on input
LinuxCNC Tormach M-code · Mill and lathe
Waits for a digital input P or analog input E to meet condition L, up to Q seconds. Result goes to parameter 5399.
Format
M66 P or E [L] [Q]
Addresses
| Address | What it does |
|---|---|
P | Digital input number |
E | Analog input number |
L | Mode, 0 immediate, 1 rise, 2 fall, 3 high, 4 low |
Q | Timeout in seconds |
How it works
Non modal.
Example program
M64 P1 (CLOSE VISE)
M66 P0 L3 Q5 (WAIT UP TO 5 SEC FOR CLAMP SWITCH)
(DEBUG, CLAMP RESULT #5399)
G0 X1 Y1
M66 P0 L3 Q5 (WAIT UP TO 5 SEC FOR CLAMP SWITCH)
(DEBUG, CLAMP RESULT #5399)
G0 X1 Y1
Example is in inch. Check offsets and clearances first.
Watch out for
- Use P or E, not both.
- Parameter 5399 is -1 on a timeout. Test it with O-word IF to stop safely.
- Analog inputs only allow L0.
Related codes
M66 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Haas NGC | Built in M code relay 6 off |
| Doosan (Fanuc) | Chucking low pressure |
| DMG Mori MAPPS (Fanuc) | Tool skip ON |
| Mazak (EIA) | C-axis clamp |
| Fadal | MP-12 probe active |
Every M-code for LinuxCNC Tormach 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 M66 in the app All LinuxCNC Tormach M-codes