Ignore One Sensor In Iteration - CNC Start Up Protocol
-
Hiya - I'm using this piece of script to check the end stop status before homing as a failsafe - in case any are disconnected. I pilfered it from another forum post.
while iterations < #sensors.endstops if sensors.endstops[iterations].triggered echo "Endstop " ^iterations^ " is triggered" abort "Endstop already triggered - aborting (X0 Y1:4 Z2 U3 V4)"
However one of the end stops, which is for an experimental tangential knife is not safety critical, and the tool itself may also be removed from time to time.
Is it possible to use iterations but to ignore a particular part or should I just re-write this for the individual sensors that are safety critical?
Many thanks, Savvas
-
@educatingsavvas
I'm not an expert on the syntax of conditional code, but something like this might work: (Assuming the sensor you want to ignore is 5)if sensors.endstops[iterations].triggered && iterations != 5
or, right after the while skip the check for iteration 5:
if iterations == 5 continue
-
@alankilian Thanks for the pointers - will test this on the weekend when I get a free moment. Cheers, Savvas