Resume print after M600 from within a macro
-
It seems that it's not possible to resume a print frrm a macros when a M600 is issued. A macro like below does not work. It requires extra klicks to go to the status menu and press the resume button.
Am I overlooking something?
; ================================================================================ ; called when M600 is issued. ; ================================================================================ ; ; M98 P"0:macros/01-Filament_Handling/03-Change_Filament" ; call macro to change filament ; M291 P"Press OK to resume print." S2 ; display message M24 ; resume print ; ; ============================================================================== ;
-
What is your full work flow here?
M600 is intended to be located inside of a gcode file being printed. When it hits M600 filament-change.g is executed.
You make it sound like your M600 is inside of another macro?
The snip of gcode you are showing there, what file is that?
What firmware version are you running?
-
@phaedrux I tried with 3.4.1 and 3.3. The M600 was issued from the console. But of course finally the M600 should be continaed in the print file. Do you think console or file makes a difference? I can try tomorrow to run it from a file.
-
@phaedrux Here is a detailed description using fw 3.4.1.
This is my print file:
M291 P"starting print" S1 G0 X60 Y-3 Z80 M400 M291 P"initiating filament change" S1 M600 M291 P"... resuming" S1
This is filament-change.g:
; ================================================== ; called when M600 is issued. ; =================================================== ; ; M98 P"0:macros/01-Filament_Handling/03-Change_Filament" ; call macro to change filament ; M291 P"Press OK to resume print." S2 ; display message M24 ; resume print ; ; ==================================================
Here what happens when the print is started:
First start.g (please find the code at the bottom) runs and finishes with this message
Then the print file M600-test.g starts:
Now this meesage is displayed:
Now it enters filament-change.g. Please note that the status is "pausing" and not "paused"!
After pressing the ok button it is "paused"
The M24 is maybe not executed because it was still "pausing". After the message vanished this "paused" status is displayed:
Here is the console:
This looks to me like an issue with the status / commang queue..
For completeness start.g:
; ========================================================================================================= ; ; for Caribou420 Duet2-WiFi-Ethernet LGX Mosquito - E3d or SE Thermistor - SuperPINDA ; ; Executed before each print - BEFORE ANY SLICER CODE IS RAN ; This also loads the heightmap ; ; =================================================== ; T0 ; ensure the tool is selected ; M572 D0 S0.0 ; clear pressure advance. M220 S100 ; set speed factor back to 100% in case it was changed M221 S100 ; set extrusion factor back to 100% in case it was changed M290 R0 S0 ; clear any baby-stepping M106 S0 ; turn part cooling blower off if it is on M703 ; execute loaded filament's config.g G32 ; execute bed.g (level gantry) G29 S1 ; load bed mesh for the system's set filament type M400 ; finish all moves, clear the buffer G90 ; absolute Positioning M83 ; extruder relative mode M98 P"0:/sys/current-sense-normal.g" ; ensure that motor currents and sense are set for printing ; ; Slicer generated gcode takes it away from here .... ; ; ==================================================== ;
-
I think your problem might be the same as here: https://forum.duet3d.com/topic/28673/m291-not-blocking
Take a look at the solution there with a working example of a filament-change.g macro.
G91 ; relative positioning G1 Z50 F360 ; lift Z by 50mm M98 P"/macros/print_scripts/goto_front_middle.g" ; move to front for filament change M291 P"Change and purge filament. Resume when after complete." R"Mid-print Filament Change" S2; G0 Z-50 ; drop back down to printing height G90 ; absolute positioning
No need for M24 at all.
@wschadow said in Resume print after M600 from within a macro:
But of course finally the M600 should be continaed in the print file. Do you think console or file makes a difference? I
Yes, it makes a difference where the gcode originated. Sending a command from the console is different than having it executed as part of a print job.
-
@phaedrux Thanks, but that code does practically the same. When M600 is issued, the filament-chnage.g is executed, where is does some tasks, the user confirms, and then end up in "paused" state. You have to press "resume" on the panel or DWC to continue.
It boils down to this: M600 will change the status into "pausing", will then execute "filament-change.g" and ignore any G24 while "pausing". After the macro has finished it will go into "paused". Now the printer will react to a G24 only while "paused" not while "pausing". This answers the initial question.
For the user that means he must confirm that the change was successful and the has to press "resume" (2 clicks". If the G24 was executed in the macro the user could confirm that everything is ok and press "ok" to resume (1 click)
-
Then just remove the M291 OK prompt and just have it as a timed message. One less click.
M24 won't work in this case because it's not a pause, it's a filament change.
You could try adding M25 to the beginning and M24 at the end but I'm not sure that would help in this case since we don't really want to evoke pause.g at all.