Is it possible to do some calculations within the marlin gcode? Means I have a variable parameter value near at the start of the gcodes and in dependence of this parameter some gcode commands change.
If no … o.k.
If yes …do you have an/some example(s) for me how to modify the gcode please?
no, it can’t calculate
it only supports 5 slots for gcode macros
/**
* 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 5 // Up to 10 may be used
#define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro
#endif
Honestly i haven’t obvious use case for those macros. May be it’s some case when you need a sequence of commands that you can change without regenerate main gcode file used in this file