Hello, I use a Klicky probe, which is essentially a switch. I’m trying to implement a macro to check the presence of the probe to avoid collisions.
Here’s what I’ve managed to do so far:
When I run the macro, QUERY_PROBE gives me the correct state of the probe, but with printer.probe.last_query|int I think I get the previous state. Even though I’ve added 2 QUERY_PROBE lines, the read state isn’t updated. To get the correct state, I have to run the macro twice.
This is a limitation of standard macros (the status of printer objects not updating within a single run). DynamicMacros solves this by allowing printer objects to update mid-macro run.
Also, in the future, it makes reading code a lot easier on these forums if you format your code in a code block (it’s the button by the bold and italic buttons that looks like </>)
I tried the update method, SAVE_VARIABLE, etc., I don’t know what else to do. If the code doesn’t give me an error, it just passes an empty variable. Can you help me with the code?
The get_macro_settings feature is only available for Dynamic Macros. Can you try moving the PROVA macro into your dynamic.cfg? Also, try changing this line (in the PROVA macro):
I need to pass the current state of the probe to start_print; the macro ‘prova’ is just an example. Somehow, I need to transfer information between dynamic macros and classic macros. Alternatively, I can convert the start_print macro into a dynamic one, but I expect other problems. I’ll try, thanks for the help.