Home › M-codes › LinuxCNC Tormach › M100
M100 User M codes M100 to M199
LinuxCNC Tormach M-code · Mill and lathe
Runs an external program named M100 to M199 from the program folder, passing P and Q values. Used for custom machine actions.
Format
M100 to M199 [P] [Q]
Addresses
| Address | What it does |
|---|---|
P | First value passed to the program |
Q | Second value passed to the program |
How it works
Non modal. The interpreter waits for the program to finish.
Example program
G0 Z1 (RETRACT)
M101 P1 Q2.5 (RUN USER SCRIPT M101 WITH P1 Q2.5)
G0 X0 Y0
M101 P1 Q2.5 (RUN USER SCRIPT M101 WITH P1 Q2.5)
G0 X0 Y0
Example is in inch. Check offsets and clearances first.
Watch out for
- The file must be named like M101 with no extension, be executable and sit in PROGRAM_PREFIX or USER_M_PATH.
- A nonzero exit code stops the G code program.
- Restart the GUI after adding a new file, or you get Unknown M code used.
- Tormach PathPilot may reserve some user M codes. Check before adding your own.
Related codes
M100 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Doosan (Fanuc) | Milling spindle clamp |
| Mazak (EIA) | Workpiece measurement DIA start |
| Mach3 Mach4 | User macro M codes |
| Centroid CNC12 Acorn | Wait for PLC bit open or off |
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 M100 in the app All LinuxCNC Tormach M-codes