LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to have two stop conditions for one loop?

I have two tanks in one loop (one empties while the other fills) and I'm looking to have two stop conditions for the loop. Can this be done? The conditions would be based on the levels in both tanks. Thanks.

0 Kudos
Message 1 of 4
(3,917 Views)

@Dario316 wrote:

I have two tanks in one loop (one empties while the other fills) and I'm looking to have two stop conditions for the loop. Can this be done? The conditions would be based on the levels in both tanks. Thanks.


yes...AND'd the two tanks once they met their levels, and OR it into the stop loop condition with a UI stop control

0 Kudos
Message 2 of 4
(3,915 Views)

You can OR as many conditions you want to stop a loop.  If going more than 2, use the Compound Arithmetic node set to OR.  That node is growable.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(3,892 Views)

@crossrulz wrote:

You can OR as many conditions you want to stop a loop.  If going more than 2, use the Compound Arithmetic node set to OR.  That node is growable.


Use the compound Arythmatic primitave anyway!  Not only does it scale nicely when you realize you want to add a new exit case you can right click any node and invert (Negate) the input or output.  Saves lots of notsSmiley Wink


"Should be" isn't "Is" -Jay
Message 4 of 4
(3,883 Views)