Hello Guest it is April 24, 2024, 08:06:30 PM

Author Topic: EStop and Nested Loops  (Read 2352 times)

0 Members and 1 Guest are viewing this topic.

EStop and Nested Loops
« 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

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: EStop and Nested Loops
« Reply #1 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