What M104 / M109 means
M104 is useful when heating should overlap other preparation, such as homing or bed heating. M109 blocks later commands until the requested hotend condition is met, which makes it suitable immediately before priming or printing.
S is the common target-temperature parameter. On Marlin, M109 with R can wait while either heating or cooling, whereas S normally waits only while heating. Exact waiting tolerances, tool selection and material presets depend on firmware configuration, so start G-code should be written for the target printer rather than copied blindly.
Syntax and parameters
M104 S<temperature> [T<tool>]M109 S<temperature> [T<tool>]M109 R<temperature> [T<tool>]STarget hotend temperature in the active temperature unit; common firmware does not wait for cooling with S.
RTarget that waits while heating or cooling on firmware that implements this Marlin-style behavior.
TTarget tool or hotend where supported.
Practical examples
Heat while homing
M104 S200
G28Starts heating, then continues to the homing command without waiting.
Wait before printing
M109 S200
G92 E0Waits for the hotend, then resets the extrusion coordinate before priming.
Firmware context
| System | Status | What changes |
|---|---|---|
| Marlin | Common | Standard set-and-wait hotend commands with build-dependent options. |
| Klipper | Common | Supports common slicer forms; native TEMPERATURE_WAIT is available for more explicit macros. |
| RepRapFirmware | Check dialect | Supports common temperature commands, with tool and wait semantics documented by the firmware. |
| CNC controllers | Not applicable | These additive-manufacturing M-codes are not generic spindle or coolant controls. |
What this viewer can show
The viewer recognizes nozzle-temperature commands, but it does not show temperature targets or add heating time to the print-time estimate.
Common mistakes
- M104 does not guarantee the nozzle is ready before extrusion begins.
- M109 can pause a print indefinitely when a heater cannot reach its target; firmware safety protections must remain enabled.
- S/R cooling behavior and multi-tool selection are firmware-specific.
Primary sources
This page is an original explanation, reviewed against the firmware documentation below. Always confirm commands against the firmware and configuration on the machine that will execute them.