Passing parameters through M701
-
Don't know if this is just some stupid idea that won't work in most cases.
BUT what if we were able to pass a parameter to the
/filaments/"filament"/load.g
in question through the M701 command?
For example, I'm using PrusaSlicer and have
M701 S"[filament_type]" ; Load filament for the active tool
in my filament specific start gcode.And my
load.g
looks like this:; filaments/"filament"/load.g ; called when M701 S"filament" is sent ; ====================--------------------------------------------------------- ; Settings section ; ==================== ; Filament settings var FilamentType = "ABS" ; Input the filament type (only for the message) ; Message placeholders var Message1 = "N/A" ; ====================--------------------------------------------------------- ; Message section ; ==================== ; Generate message set var.Message1 = "" ^ var.FilamentType ^ " filament loaded" ; Filament loaded message M118 P0 S{var.Message1} ; Send message to DWC M118 P2 S{var.Message1} ; Send message to PanelDue M703 ; Load filament config.g for the selected filament
And if I was able to pass a paramater like with
M98
i could make theload.g
files totally agnostic and wouldn't have to add"ABS"
etc. manually to all the differentload.g
's.
For instance if i could do this
M701 S"[filament_type] F"[filament_type]" ; Load filament for the active tool and pass paramter F
in Prusalicer.And adapt my
load.g
's to:; filaments/"filament"/load.g ; called when M701 S"filament" is sent ; ====================--------------------------------------------------------- ; Settings section ; ==================== ; Filament settings var FilamentType = (param.F) ; Input the filament type (only for the message) ; Message placeholders var Message1 = "N/A" ; ====================--------------------------------------------------------- ; Message section ; ==================== ; Generate message set var.Message1 = "" ^ var.FilamentType ^ " filament loaded" ; Filament loaded message M118 P0 S{var.Message1} ; Send message to DWC M118 P2 S{var.Message1} ; Send message to PanelDue M703 ; Load filament config.g for the selected filament
If it's viable at all
🤷♂️
-
@Exerqtor Couldn't you just use a M291 message box in your filament specific start gcode to accomplish the same thing?
-
@Surgikill
Uuuhm, not quite sure I understand what you're hinting too there🤔
-
@Exerqtor From the looks of what you are doing, the only thing
var FilamentType
is being used for is an M118 message. It's not actually affecting the filament that is being loaded, because you need that input in theM701 S"filament"
command. Unless you are using this variable in other places.Your other option would be to set the variable value in your filament specific start gcode.
Also, apparently M703 does not work in load.g, from what I have been told.