Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: lightntrax on June 16, 2012, 07:12:27 PM
-
Is there a better way to handle EStops in a nested loop? I need to stop the loops from running if the EStop is pressed. If I dont once the machine is returned to safe mode the Nested Loop continues to run.
Here is my VB Code:
Sub Main
If IsEStop() Then
Print ("Estop")
Exit Sub
Else
For r = 1 to 3
If IsEStop() Then
Print ("Estop")
Exit Sub
Else
Print "r=" & r
End If
For i = 1 to 10
If IsEStop() Then
Print ("Estop")
Exit Sub
Else
Print "i=" & i
End If
Next i
Next r
End If
End Sub
-
That is a very good question. I see your point but don't have a solution.
I will ask around, (;-) TP