Marlin Gcode macros not registered
December 27, 2020 05:36PM
Hello.
I'm just writing to confirm that it's not happening only to me.
I'm trying the Gcode macros feature and when I put the macro command (M810) into cura, it's just skipped and not executed.
I've defined the M810 directly in Marlin like this:

#define GCODE_MACROS
#if ENABLED(GCODE_MACROS)
#define GCODE_MACROS_SLOTS 5 // Up to 10 may be used
#define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro
#define M810 G28|G91|G1 E350 F6000|G1 E30 F200|G90|G0 Z1 F2000|G0 X60 F3000|G0 Z5 F2000
#endif

And here's my Cura start code:

M810; Marlin Macro start code
M104 S{material_print_temperature};Heatup hotend
M140 S{material_bed_temperature};Heatup bed
M109 S{material_print_temperature};Wait for hotend to heat up

Just looking to confirm that it's not just used wrong.

Thank you.
Re: Marlin Gcode macros not registered
December 27, 2020 06:05PM
This is not how they work.

"#define M810 G28|G91|G1 E350 F6000|G1 E30 F200|G90|G0 Z1 F2000|G0 X60 F3000|G0 Z5 F2000"
creates a define M810 at compile time only. But M810 is not used anywhere

You have to send M810 G28|G91|G1 E350 F6000|G1 E30 F200|G90|G0 Z1 F2000|G0 X60 F3000|G0 Z5 F2000 then use it with M810 later

If you want it defined always, you might be able to add it to STARTUP_COMMANDS
Re: Marlin Gcode macros not registered
December 29, 2020 07:26PM
Just tried to put the code into the startup commands.
Unfortunately it doesn't work, but thanks for the tip.
Sorry, only registered users may post in this forum.

Click here to login