Implementing macros in gcode
-
I print with PLA and PC+. I use a hotend mounted piezo for a Z probe.
My print start up routine is to preheat the bed and nozzle, the nozzle a point where any residual plastic softened for cleaning but no ooze.
Thing is I need to have a different temp for PC+ than for PLA.
Since I am also using a PanelDue now, I'd like to be able to call up the macro to preheat and level too.
Can this macro be called up via the gcode? I know that I can have filament specific gcode in the slicer, and that is an option, but I am thinking that the best way for me is the macro.
I tried searching for this but getting too many results that dont apply.
Any suggestions?
tia
sinneD
-
@sinned6915 Yes - look at M98 https://duet3d.dozuki.com/Wiki/Gcode#Section_M98_Call_Macro_Subprogram
You can use M98 pretty much anywhere, including the slicer start gcode or in the slicer filaments section if it has one.
So for example in my start gcode I might have
M98 P"0:/macros/PrePostPrintMacros/PrePrint3CBed50"
M98 P"0:/macros/SetToolTemps/4Tool195"The first "preprint" macro heats the bed and carries out homing. The homing file itself calls a macro to wipe the nozzle before homing Z so macros can be nested in that way.
The second macro above sets the tool temperature for 4 tools to 195deg C but I have other macros for other tool/temperature combinations. -
thank you! i think this will work!