Help with custom macro
I don't have much experience with writing macros so my knowledge is quite limited. I currently have a servo driven nozzle wipe routine that I can call either manually (when homed and no print is running) or at the beginning of a print automatically (as part of the start print macro that I've customized to call it before the prime). I would also like to be able to call it from the console terminal at will during a print if desired. What statements are required to be added to it so the nozzle wipe macro can run without wrecking the print that's in process? How do I skip those same statements when they are not required (when no print is in process)? Thanks for the help.
3 Replies
How are you calling it at the start of the print?
Just copied the ratos macro (name escapes me at the moment) that calls for the prime line (or blob) into my printer.cfg and just prior to that I add a call to my nozzle_wipe macro. Problem is if I try to call it during a print, it seems to get confused, it doesn't finish the nozzle_wipe macro as expected. That only happens during a print. Otherwise it operates correctly. I think I have to save the state of the printer like what is done in ratos pause, then execute the macro, and then use ratos resume. I could add pause and resume into the nozzle_wipe macro, but I still want to be able to add conditional statements to skip pause and resume when it's not needed, such as when the printer is idle or when it is called prior to the primeline. That's where I need some help.
How do I use the idle_timeout state in a conditional? I need an example so I know how to format it. {% if idle_timeout.state = "Printing" %} is that correct? Below is my guess.
What I posted has a syntax error, in the conditional statement near the very beginning involving the idle_timeout object. Can you tell me what it is?
@miklschmidt Let me rephrase the question. How do I use the klipper object: idle_timeout in a conditional statement, in order to check the state of the printer (to determine whether or not it is actively printing).