How to Stop Parallel Loops with Event Structures?

Updated Nov 23, 2018

Reported In

Software

  • LabVIEW

Issue Details

I have an application with parallel loops, one of the loops has an event structure inside it. This loop has a stop Boolean control wired to the terminal condition of the loop. My other loops have a local variable, linked to this control, wired to the respective terminal condition.

When I press the Boolean control, all my loops stop except the one with the event structure. How can I stop all the loops when I press the button?

Solution

The reason why the other loops stop and the one with the event structure doesn't is because the value change is passed to all the local variables but the loop with the event structure keeps running because there is no event triggering the loop to run. Once the event has been triggered, the Boolean value will pass to the terminal condition and stop that loop.

To solve this, you can add an event for the stop button when its value changes. This means that when you press the stop button it will enter the event and then the value will pass to the terminal condition, stopping this loop and the others that are linked by the local variable. 

The following snippet show two parallel loops, one with an event structure and one with a local variable wired to the terminal condition. This shows how to set the stop conditions so both loops stop when you stop the one with the event structure.