Using conditional gcode to evaluate a value
-
I've just added switches to detect when a tool is installed to my printer.
I can then identify which one is fitted and dock it accordingly if needed.
IO inputs are available in the OM but how do I evaluate them using conditional gcode?
i've triedif sensors.gpIn[0] = 1
-
That should work, You can use:
echo sensors.gpIn[0]
to check the state from the DWC console.
-
I get this if I try echo in the console
echo sensors.gpIn[0] Error: Failed to evaluate "sensors.gpIn[0]": unsupported type code 11
The error from code I tried in post 1 is
Failed to evaluate "sensors.gpIn[0] = 1": cannot convert operands to same type
-
Which firmware version are you using?
-
PS - using recent firmware (preferably 3.01-RC12) you would need to use:
if sensors.gpIn[0].value = 1
-
That worked. Thank you!