Conditional Gcode docs
Hi All are there any docs available for conditional gcode. Object models etc.
At the moment I'm playing with simple IF statement and it's not working as expected. I have
if !move.axes.homed G28 Z G1 Z8 F3000
Expecting when Z axis is homed the G1 move would operate.
if Z not homed then home the Z axis.
The code you've posted there has no indentation, so if that's exactly the code you're using, then that's not gonna help. See here: Conditional construct
lyndon last edited by lyndon
Perfect Thank you.
if !move.axes.homed G28 Z else G1 Z8 F3000
FWIW, for that particular example you can omit the
Cheers Chris I have yes.
Thanks to your pointer I have progressed to
if heat.heaters.current < 190 abort "Extruder is cold" if heat.heaters.current < 48 abort "Heat bed is cold" if !move.axes.homed G28 Z
It's part of a simple manual bed leveling macro.
All I need now is a message box with OK..Next..Cancel which would become Repeat... Call next macro.. Cancel. But I think that's for RRF3.02 fingers crossed.
I'm curious as to what you're trying to achieve with that. Is it just out of interest & experimenting? Otherwise, is there a reason not to use M116 to wait for the heaters?
It's a simple manual bed leveling macro.
So far I have 3 macros level test1 to 3.
first 1 homes Z then G30 S-1 at that X Y location then moves X Y to right side of bed and does G30 S-1 prompts for OK or Cancel. If result of G30 S-1 matched the result of probe position 1 then I cancel else I adjust the bed screw at that point then hit OK, which repeats G30 S-1 in the same X Y position.
2nd Macro doesn't probe position 1 since I now know the result from previous probing., it moves X Y to the 3rd probe position and then G30 S-1.
I repeat the above as needed calling macro's 1 through 3.
Based on the outcome of a G32 bed level test, I could run 1 or more of the macros again.
The X Y locations match the outer 4 points that G32 probes.
If that makes sence..