can someone look over this and see if this is correct?
-
basically the machine is not executing my end gcode script to turn off my hotend it does everything else which is weird. So i am trying to create a loop so it will repeat this part of the code until all tool heater are turned off. can someone check if this will work? Thank you.
while <heat.heaters[4].state != off> | <heat.heaters[5].state != off> | <heat.heaters[6].state != off> | <heat.heaters[7].state != off> M568 p0 a0 ;turn off tool0 heater G4 s1 M568 p1 a0 ;turn off tool1 heater G4 s1 M568 p2 a0 ;turn off tool2 heater G4 s1 M568 p3 a0 ;turn off tool3 heater G4 s1 if <heat.heaters[4].state == off> | <heat.heaters[5].state == off> | <heat.heaters[6].state == off> | <heat.heaters[7].state == off> continue
-
The one thing I can say is that you don't need lines 10 and 11
The while loop will automatically "go to the top" when it hits the end of the indented region.
Also, you can maybe make it more clear by doing this: (Just my preference for simplicity)
while <heat.heaters[4].state != off> M568 p0 a0 ;turn off tool0 heater G4 s1 while <heat.heaters[3].state != off> M568 p1 a0 ;turn off tool1 heater G4 s1 while <heat.heaters[2].state != off> M568 p2 a0 ;turn off tool2 heater G4 s1 while <heat.heaters[1].state != off> M568 p3 a0 ;turn off tool3 heater G4 s1
I don't know how the heater numbers map to the M568 px so that part is probably wrong in my example.
-
@tekstyle also remove the < >
-
Thank you both. got it all working!