Home › G-codes › Mach3 Mach4 › G31
G31 Probe move
Mach3 Mach4 G-code · Mill
Feeds toward the point until the probe input trips, then stops and stores the trip position. Used for tool setters, edge finding and digitizing.
Format
G31 X Y Z F
Addresses
| Address | What it does |
|---|---|
X Y Z | Target point, past where contact is expected |
F | Probe feed rate |
How it works
Non modal.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T99 M6 (PROBE)
G43 H99 Z1.0 (PROBE LENGTH)
G0 X0 Y0 (OVER THE TARGET)
…
T99 M6 (PROBE)
G43 H99 Z1.0 (PROBE LENGTH)
G0 X0 Y0 (OVER THE TARGET)
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Mach3 stores the trip point in #2000 to #2005. Mach4 G31 stores it in #5061 to #5066.
- Mach4 has G31.1, G31.2 and G31.3 for probes 2 to 4. G31.1 results go to #5071 up.
- Mach3 errors if the start is closer than .01 inch to the target or if the probe never trips. Probe slow.
Related codes
G31 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Skip function |
| Haas NGC | Skip function, probe move |
| Okuma OSP | Skip function |
| Mitsubishi M70 M80 | Skip function |
| Brother Speedio | Skip function |
| Heidenhain TNC (ISO) | Blank form max point |
| Hurco WinMax (NC) | Skip, probing move |
| Fadal | Probe touch function |
Every G-code for Mach3 Mach4 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 G31 in the app All Mach3 Mach4 G-codes