LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reinitialize a stopped while loop

I couldn't view Paul's, but I think the pause/resume is probably the best way to go (as the loop can respond to different messages when not running the timeout code). Here is a version using an event structure just for fun.

 

Pause Resume Events.png

0 Kudos
Message 11 of 14
(1,540 Views)

No need to get so complicated.

Create Pauseable Loop.png

(anybody spot the bug in the vi in my earler post?)

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 12 of 14
(1,526 Views)

Hello paul_cardinale,

 

A problem appears with your VI. The isn't stop right away, as event structure buffered event, it take several iteration before pausing.

However, it's a good idea.

 

regards.

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 13 of 14
(1,483 Views)

Hi Jatlauoi,

 

It depends how you define right away. If you press pause when i=0, that will trigger an event and update i=1, it will then start the next loop and update i=2 but be waiting on the event structure before making another move. The only loop cycle used up by flipping the switch is i=1, so I would say that it stops right away.

0 Kudos
Message 14 of 14
(1,451 Views)