Home › M-codes › LinuxCNC Tormach › M62
M62 Digital output on, synced with motion
LinuxCNC Tormach M-code · Mill and lathe
Turns on digital output P at the start of the next motion block.
Format
M62 P
Addresses
| Address | What it does |
|---|---|
P | Digital output number |
How it works
Non modal. Queued with the next move.
Example program
M62 P0 (OUTPUT 0 ON WITH NEXT MOVE)
G1 X2 F30 (OUTPUT TURNS ON AS THIS STARTS)
M63 P0 (OFF WITH NEXT MOVE)
G1 X3
G1 X2 F30 (OUTPUT TURNS ON AS THIS STARTS)
M63 P0 (OFF WITH NEXT MOVE)
G1 X3
Example is in inch. Check offsets and clearances first.
Watch out for
- Output pins are motion.digital-out-NN in HAL.
- Several can queue on one move. Use M64 for an immediate change.
Related codes
M62 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Haas NGC | Built in M code relay 2 off |
| Doosan (Fanuc) | Left spindle winding change high speed |
| Mach3 Mach4 | Output on with motion, Mach4 |
| Fadal | B axis brake on |
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 M62 in the app All LinuxCNC Tormach M-codes