jmagma
Posts: 1
Joined: Sat May 22, 2021 4:40 pm

Ender 5 Plus V 1.70.2 Pause At Layer Script

Hi Everyone,
I have an Creality Ender 5 Plus V1.70.2 printer (excellent machine), and I'm having trouble determining the best way to execute a 'pause at layer' gcode command. I'm trying to accurately insert a part to be embedded into the print, so I've determined a specific layer/height that will work. I've done this by watching and manually pausing the print, but the print takes 7 hours (that's a long time to wait!). I've tried multiple methods. Here's the script I've tried, but each time I use it or try an edited version of it, it seems to have no effect. I'm placing the below script into the 'Additional Terminal Commands for Post Processing' section of the scripts tab of the 'Edit Process Settings' menu. I found this one on youtube, but haven't found a script that people are specifically using with my printer:

;Filament change code below. Specify layer to swap filament. Print will pause and you can change filament, click LCD button to resume print.
;{REPLACE "; layer" "M117 Layer"}; show layer number and Z height on LCD
;{REPLACE " Z = " " Z="}; make room on LCD for text
;{REPLACE "\nM117 Layer 51, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 51, Z="}; pause at layer, move head, play sound

Also tried this:

;{REPLACE "\nM117 Layer 5, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 5, Z="}; pause at layer, move head, play sound

This printer uses Marlin/RepRap Gcode format. Does anyone know what I'm doing wrong or missing?

I've also tried printing the model by using the 'Variable Settings Wizard' to create a split process, and edit the start and end Gcode scripts of each process. This worked great except my printer has a BKTouch installed, and each time I initiate a print the printer automatically tries to touch off the print bed to determine the Z offset. I have not found a way to disable this feature in the printer settings. Because of this I cannot have a partial print still on the print bed without crashing the extruder head when I initiate the second part of the 2 step split process. I'm certain that this feature is built into the firmware of the printer itself because when I print live from simplify 3d I can see that the printer is 'busy' during this process in the communication display of the 'Machine Control Panel'. Does anyone know how to disable that feature? Turning off auto leveling in the printer menu doesn't work either. I'm not skilled enough to execute a firmware edit. I feel like I would be asking for trouble by attempting that!

I think the only way to accomplish the pause at layer function with my printer is to use a script.

Any help would be appreciated. Thanks!!!
c.murphy360
Posts: 1
Joined: Sat Oct 09, 2021 11:48 pm

Re: Ender 5 Plus V 1.70.2 Pause At Layer Script

Hi. Ender 6 Here hope it translates.

I don't have a proper solution but figured out a workaround to do what I needed.

I am printing a piece that has several magnets in it and I need the printer to pause at the last layer before it covers the void I've left for them.

Using the post-processing scripts in Cura I can insert pause at layer using M0 which works, but (almost) immediately resumes. Which requires me to be watching at the exact moment required to actually pause the machines.


After doing some research I found the Dwell command in gcode.

Dwell | Marlin Firmware (marlinfw.org)


This adds a wait at a specific line for a designated number of milliseconds (P) or Seconds (S).

So I slice my .stl file, add M0 script at the desired layers (112 in below example) and export gcode to SD card.

I then edit the gcode with notepad and insert a G4 after the M0 line and before M109 (resume temperature) line.

This is the first time I've messed with G-Code so I'm not 100% on formatting but this worked for me:

[COMMAND] [ARGUMENT] ; [COMMENT]

G4 S3600 ; Dwell for 1 hour

Example Code:

;current layer: 112
M83 ; switch to relative E values for any needed retraction
G1 F300 Z23.6 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
M104 S0 ; standby temperature
M0 ; Do the actual pause
G4 S3600 ; Dwell for 1 hour
M109 S200 ; resume temperature
G1 F9000 X54.4 Y215.6
G1 F300 Z22.6 ; move back down to resume height
G1 F1500 ; restore extrusion feedrate
M82 ; switch back to absolute E values



This parked my printhead at 190/190 which blocked one of my magnets (so choose park location carefully). It waited for an hour, reheated hot end and resumed like a champ. I was lucky enough to wake up this morning with it in the paused position and was easily able to add my magnets and wait for it to start up again to add the last one. If I really needed to make this happen, I'd have it pause for 6-8 hours to ensure that I had a decent window to catch it.

I bet if you keep your Standby Temperature hot and park your printhead in the right location you can manually change out filament and manually extrude the rest of the old color before the printer resumes.

Next step is figuring out how to resume on command which from all the forum posts seems to be really hard.

Return to “General Discussion and Tips”