Code: Select all
YPark = INPUT3
If Not IsActive(INPUT3) Then 'y already parked
Code("G01 Y60 F75")
Do While (IsMoving())
'Sleep, so other threads can run while we’re waiting
Sleep(5)
If IsActive(INPUT3) Then 'y parked
DoButton(3) 'stop
Sleep(500)
Exit Do
End If
Loop
End If
Code("G01 Y" & GetDRO(1) - 0.5 & " F20")
While (IsMoving())
'Sleep, so other threads can run while we’re waiting
Sleep(100)
Wend
I'm wondering if this is the most elegant solution to get an axis to move an unknown distance toward a switch and then stop when it contacts the switch and back off. Basically a homing move but the opposite direction.
In case you think I'm lazy...I have the same code for all 3 axes under a button so I can just click one button and no matter where the table is at it will move the z up and move the torch to the corner. Just trying to simplify repetitive tasks. And I am a little lazy sometimes.
