Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: lightntrax on June 16, 2012, 07:12:27 PM

Title: EStop and Nested Loops
Post 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
Title: Re: EStop and Nested Loops
Post by: BR549 on June 19, 2012, 05:51:10 PM
That is a very good question. I see your point but don't have a solution.

I will ask around, (;-) TP