LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make stop button to work again in a while loop

Solved!
Go to solution

Gu,

 

Get rid of the local variable for stop2 - just use the terminal. Then, inside your event loop, just use a constant to send the value to exit that loop. Finally, use a latching action on stop2. This will eliminate your need to hit stop2 twice. 

0 Kudos
Message 21 of 27
(821 Views)

Hi  Johntrich1971,

 

Thank you for your suggestion.

Could you please modify my VI and upload it? I do not fully follow you.

The local variable Stop2 is to stop both upper and lower loops on the right simultaneously. 

 

Regards,

Gu

0 Kudos
Message 22 of 27
(812 Views)

Gu,

 

Yes, I understand that. The event structure will still fire even if the stop2 button is not inside it. You would then just use a True constant where the stop2 button currently is. This will stop both loops.

0 Kudos
Message 23 of 27
(809 Views)

Attached is my rev showing the suggested change. 

 

It should be easy to convert this to a state machine also - an MUCH more maintainable.

0 Kudos
Message 24 of 27
(806 Views)

Hi Johntrich1971,

 

My LV is 2015, could you please convert your VI to 2015 compatible so that I can open it?

 

Gu

 

0 Kudos
Message 25 of 27
(786 Views)
Solution
Accepted by topic author edmonton

Here it is in 2015. 

 

I encourage you to try to make the changes to your code yourself so that you can get a better understanding of how these things interact.

Message 26 of 27
(779 Views)

Hi  Johntrich1971,

 

Thank you.

 

Gu

0 Kudos
Message 27 of 27
(762 Views)