Home › G-codes › Mach3 Mach4 › G4
G4 Dwell
Mach3 Mach4 G-code · Mill
Pauses motion for the time in P. Spindle and coolant stay as they are.
Format
G4 P
Addresses
| Address | What it does |
|---|---|
P | Dwell time, seconds or milliseconds depending on setup |
How it works
Non modal. Only acts in its own block.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
S2500 M3 (SPINDLE ON)
G0 X1.0 Y1.0 (TO POSITION)
…
T1 M6 (TOOL CHANGE)
S2500 M3 (SPINDLE ON)
G0 X1.0 Y1.0 (TO POSITION)
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Mach3 reads P as seconds or milliseconds by a setting on the Config menu, Logic page. G4 P500 is over 8 minutes if it is set to seconds.
- Newer Mach4 builds read P without a decimal point as milliseconds and P with a decimal point as seconds. Always write the decimal point.
- Canned cycle P dwells are in seconds.
Related codes
G4 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Dwell |
| Haas NGC | Dwell |
| Mazak (EIA) | Dwell |
| Okuma OSP | Dwell |
| Mitsubishi M70 M80 | Dwell |
| Brother Speedio | Dwell |
| Siemens 840D 828D | Dwell for time or spindle revolutions |
| Heidenhain TNC (ISO) | Dwell time |
| Fagor 8055 8065 | Dwell or stop block preparation |
| LinuxCNC Tormach | Dwell |
| Centroid CNC12 Acorn | Dwell |
| Hurco WinMax (NC) | Dwell |
| Fadal | Dwell |
| Swiss (Citizen Star) | Dwell |
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 G4 in the app All Mach3 Mach4 G-codes