01-13-2016 03:52 AM
Hi everyone.
If I have two while loops running in parallel, and I stop one of the while loops with a stop boolean, how can I restart that while loop again from another boolean button?
01-13-2016
03:57 AM
- last edited on
11-19-2021
02:59 PM
by
NI_Community_Su
Hi David-Baratheon,
There's several way to do it.
The first thing to do, is to include the loop you want to restart in another high level loop. Then you could use an event structure insithe the high level loop to run the low level loop each time you click on your boolean.
Regards.
01-13-2016 04:01 AM
Hi Sabri,
Thank you for your input.
I am looking for the second loop to run continuously until I stop it, and then start again when I start it.
At the same time I have some various booleans in my first loop that I want to continue to run in parallel.
If I put the second loop inside the first loop, I found that labview gets stuck inside the second loop and so nothing from the first loop works in parallel.
01-13-2016 04:10 AM
I tthink there's a misunderstanding.
The high level loop goal is to allow you to restar one or several loop on demand.
So you could include all the parallel loops inside the high level one.
Do you want an example?
Regards
01-13-2016 04:13 AM
Yes please if you have one.
It sounds good.
So how would the event structure be used?
Could I just use two parallel while loops inside a "master" while loop?
01-13-2016
04:19 AM
- last edited on
11-19-2021
03:02 PM
by
NI_Community_Su
My example is based on producer consumer with event structure.
There is one loop to handling event, one loop that you can restart and one that you cannot.
Hope this helps
01-13-2016 09:05 AM
Perhaps something like this would suit your needs.
01-13-2016 12:10 PM
Hi Jatlaoui,
In your example the top loop should have a "False" wired out of it in the "run loop" case. Then you can make another exit case which has a "True" wired out. As it is right now, you can only run it once, not stop and restart.
01-13-2016 12:15 PM
Yes, true, I forgot to change it.
Thx.
01-13-2016
12:17 PM
- last edited on
11-19-2021
03:02 PM
by
NI_Community_Su
I made the correction. And change the stop button behavior to lacth when pressed.
😉