How to Pause or Delay (Wait) a Print in G-Code? (Solved)

While producing the G-code your printer will be using for a print is a slicer’s job in most scenarios, being familiar with G-code allows you to have a higher level of control during the printing process.

With a higher knowledge of G-code, it’s possible to print more complex objects, have more control over the configuration of your printer, and introduce various QoL improvements to your printing processes.

Today, we will be talking about pausing or delaying a print in G-code in particular, as we believe every 3D printing enthusiast should be familiar with this functionality.

So, how to pause or delay a print in G-Code?

The primary way to pause a print in G-Code is with the M0 (Unconditional Stop) command, which stops the printer after its last movement.

The G4 (Dwell) command is the suitable option to delay a print in G-Code, which you can execute by giving it a timeframe in milliseconds, such as G4 P2000 for 2 seconds of delay.

While almost all 3D printer firmware supports these two commands, they aren’t the only ways to pause and delay a print in G-code. Next up, we will be going into greater detail about what other G-codes you can use, how they differ from each other, and the firmware that supports these G-codes.

How to Pause a Print in G-Code?

Pausing a print in G-code is a pretty simple task as it only requires you to send the printer a single command.

This command is M0 (Unconditional Stop), which halts the printer after the last move in its buffer. Using this command causes the motors and the heaters of the printer to turn off until the printing process is resumed.

While most popular firmware (such as Marlin, Prusa, RepRapFirmware) supports the M0 command, there may be slight differences in its syntax between different firmware.

Let’s look at a few examples:

  • Marlin – M0 P200 (200 milliseconds) or M0 S200 (200 seconds)
  • Prusa – M0 P200 (200 milliseconds) or M0 S200 (200 seconds)
  • RepRapFirmware – M0

As you can see, the Marlin and Prusa firmware optionally allows you to use the M0 command to delay the print for a set amount of time that you can denote with a value of either milliseconds or seconds.

On the other hand, in RepRapFirmware, it’s only possible to use the M0 function with no extra parameters.

The M0 command isn’t the only way to pause a print. In fact, as some firmware doesn’t support the M0 command (such as Repetier and Smoothie), the alternatives we will be talking about are the only options.

M25 (Pause SD Print)

M25 is another command you can use to pause the printing process, but it often comes with a caveat.

This command’s function is to pause a print only if the print file is on the SD card. That being said, in some firmware, the M25 G-code stops the printing process regardless.

We don’t recommend using the M25 G-code within a Gcode file to stop the print at that specific line, as most firmware doesn’t allow this behavior.

Compared to the M0 command, you will find that more firmware supports M25. In cases where firmware doesn’t support the M0 command, M25 may act as a direct replacement.

M226 (G-Code Initiated Pause)

M226 is a G-code denoted as “G-Code Initiated Pause” in the RepRap documentation, but most firmware decided to omit this feature and replace the functionality of this command.

For instance, both in Marlin and Prusa, M226 executes the Wait for Pin State command instead, and as a result, RepRapFirmware and a few others are the only firmware that supports this G-code.

We only recommend using this G-code after confirming that your firmware supports it and if none of the other alternatives worked for you.

M601 (Pause Print)

M601 is the last command in our list for pausing a print, a specific G-code for Prusa, and some versions of RepRapFirmware only.

The M601 command is no different than the M0 G-code at its core, essentially halting the printing process after the printer clears its buffer.

Just as M0, M601 also powers the motors and the heaters down until you resume the process.

As M0 and M601 are interchangeable (although M601 comes with slight improvements such as parking the nozzle), you can feel free to pick the one you want.

How to Delay (Wait) a Print in G-Code?

While pausing a print means that it will stay that way until you manually resume it, a delay allows the printing process to continue automatically after the required amount of time has passed.

The primary way to delay a print in G-code is by using the G4 (Dwell) command, which every 3D printer firmware supports.

When you send this command to the printer, the printer will do nothing for the amount of time you have specified, but the state of your printer will remain intact.

Let’s take a few quick examples of how you can use the G4 command.

  • G4 P5000 – Pauses the printer for 5000 milliseconds (5 seconds).
  • G4 S8 – Pauses the printer for 8 seconds.

While the P (milliseconds) switch is the standard way of using the G4 command, some firmware (such as Marlin and Prusa) also allows you to use the S switch, where you can pass seconds instead of milliseconds.

How to Resume a Print in G-Code?

Resuming a print in G-code depends on the command you used to pause it, which is why we will be analyzing each case separately.

Resuming After M0

As there is no specific command to resume a printing process after you have paused it with M0, the only option is to do it through the LCD panel of the printer.

Since this can be quite a nuisance in many cases, most host software (such as OctoPrint) halt the printing process on a software level instead of sending the M0 G-code to the printer.

With this slight modification, it’s possible to resume the print directly from the host software, making it an overall more convenient experience.

Resuming after M25

Resuming the printing process after the M25 command is very straightforward.

You can use the M24 (Start or Resume SD print) command to resume any printing process you have paused with M25.

Every firmware that supports M25 should automatically support M24 as they are parts of the same set of commands that require each other to work smoothly.

Resuming after M226

While there is no specific command to resume a print after pausing with M226, you should most likely be able to use M24 to resume a process that you have halted with M226.

Even though the M24 command is to resume SD card prints, it usually does the job as M226 invokes M25 behind the scenes in most cases.

Resuming after M601

Resuming a print after the M601 command is also an easy task as it has a corresponding command that allows you to do so.

You can use the M602 (Resume Print) command to resume any printing process you have paused with M601.

Wrapping Up

While the syntax can show slight differences between firmware, pausing or delaying the printing process in G-code is a simple task once you perform it for the first time.

As pausing or delaying a print may be necessary for many situations, such as halting a long printing process before going at night and resuming it when you wake up in the morning, knowing how to do it in G-code is quite valuable.

Even though we tried to cover the specific scenarios for most firmware, feel free to throw us a message if you couldn’t get the pause or the delay to work with the firmware you’re using!