Welcome! Log In Create A New Profile

Advanced

Power On Macro

Posted by Snarg 
Power On Macro
September 26, 2021 10:29AM
Hello,

I am attempting to create, and use, a macro for when my machine powers on. The code I am using is listed below. It compiles just fine however, the machine does nothing when powered on. Any help is appreciated. Thank you in advance.

/**
 * Startup commands
 *
 * Execute certain G-code commands immediately after power-on.
 */
#define STARTUP_COMMANDS "M810"

/**
 * G-code Macros
 *
 * Add G-codes M810-M819 to define and run G-code macros.
 * Macros are not saved to EEPROM.
 */
#define GCODE_MACROS
#if ENABLED(GCODE_MACROS)
  #define GCODE_MACROS_SLOTS       1  // Up to 10 may be used
  #define GCODE_MACROS_SLOT_SIZE  50  // Maximum length of a single macro
  #define M810 M190 S55|G28|G34|G1 Z200 F1200|G28
#endif
Re: Power On Macro
September 26, 2021 04:10PM
Macros are run time only.

You cannot do a "#define M810 M190 S55|G28|G34|G1 Z200 F1200|G28" It has to be sent

or you need to put this in the STARTUP_COMMANDS separating each startup command with a \n

This should work.

#define STARTUP_COMMANDS "M810 M190 S55|G28|G34|G1 Z200 F1200|G28\nM810"
Re: Power On Macro
September 26, 2021 04:16PM
Quote
Dust
Macros are run time only.

You cannot do a "#define M810 M190 S55|G28|G34|G1 Z200 F1200|G28" It has to be sent

or you need to put this in the STARTUP_COMMANDS separating each startup command with a \n

This should work.

#define STARTUP_COMMANDS "M810 M190 S55|G28|G34|G1 Z200 F1200|G28\nM810"
Thank you, I will give that a try.
Re: Power On Macro
September 26, 2021 04:29PM
That is *PERFECT*! Thank you so much smiling smiley
Sorry, only registered users may post in this forum.

Click here to login