Execute Macro as Job
-
Hello,
is there any way to execute macro code "as" a job?
I would like to have the additional feature a running job offers (Babystepping, pause/cancel) when running macros like calibration sequences and such.Thank you
-
@diamondback I'm not sure if i understand what you mean...
But when you like to call a macro during a printjob, use M98 to call a macro. -
@cosmowave Currently, when executing a macro via DWC, Duet just executes all the commands as if I typed them by hand in the console. This means that various features that exist during an actual print, do not work (Babystepping, aborting the executed code etc)
I have a few macros that actually print calibration pieces (like PA calibration) and sometimes this goes wrong or needs some Z adjustment on-the-fly.
So I would like to have some way to execute a macro file "as if it was an actual printjob", so that DWC actually gives me these "printing-only options". -
Upload the macro to the "jobs" tab in DWC and then run it as a print.
-
@phaedrux Hm, while that technically works, I'm afraid it's far from practical in my use case...
I have a parametric PA test that is fed the relevant data (nozzle and bed temps, toolnumber, etc) via secondary macros that just call the first one with parameters, and then for each filament/tool combination a dedicated macro with the relevant parameters...Wasn't there some way to dynamically write files? Can i possibly dynamically create a job file and start that from a macro?
-
@diamondback What happens if you create a job gcode file that simply runs your top level macro (or sequence of macros)?
-
@gloomyandy said in Execute Macro as Job:
@diamondback What happens if you create a job gcode file that simply runs your top level macro (or sequence of macros)?
That would probably work, but i'm not really overly happy with having to start my stuff from the jobs tab, so far I've treated all the files there as temporary stuff basically, so all logic is in /sys and /macros while the job files are just the printed parts...
I was hoping there was some "easy-enough" way to just "set" the printer state from within a macro, but seems like this doesn't exist (yet?)
@dc42 is it possible to add something like this? -
@diamondback I think, i don't understand your problem.
You can write a macro which is doing what you want and start it from the DWC macro tab or touchscreen.
Or you can set a "user defined" button in DWC with the plugIn BtnCmd...IMO this should cover all your needs?!
-
@cosmowave said in Execute Macro as Job:
@diamondback I think, i don't understand your problem.
You can write a macro which is doing what you want and start it from the DWC macro tab or touchscreen.
Or you can set a "user defined" button in DWC with the plugIn BtnCmd...IMO this should cover all your needs?!
The problem is that DWC/RRF has a specific "mode" it enters when printing a job vs merely executing a macro. Try executing a lengthy macro, you will see that you can't abort that via regular means for example (other than emergency stop/cutting power).
Some of my macros would greatly benefit from the ability to abort them mid execution or use the regular babystepping controls.
-
@diamondback said in Execute Macro as Job:
The problem is that DWC/RRF has a specific "mode" it enters when printing a job vs merely executing a macro.
I wonder what is the reason for the different modes rather than just executing gcode files, regardless of their origin directory.
-