LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting a Case Structure to Zero

Solved!
Go to solution

The goal is to fill up two tanks one after another. When the first tank hits 90, a red light must emit, and the second tank starts to fill. Once the second tank reaches 190, a green light will light, and when it reaches it's max capacity (200) the loop stops.

 

I have most of the project finished, but my problen with my program is that when the first tank finishes and the second tank starts, the second tank starts at where the first tank ends (at 90). I want the red light to stay on while the second tank fills from 0 to 200. What's the best way to work around this problem? I am using case structures and a while loop.

 

Goals

-Fill first tank to 90, red light comes on

-Second tank starts to fill from 0, green light comes on at 190

-End loop when second tank reaches 200

 

 

0 Kudos
Message 1 of 4
(3,265 Views)
Solution
Accepted by topic author miyas

What if you would subtract 90 from the wire going to the second tank?

 

Still, you should rearchitect your code as a proper state machine with tank levels in shift registers. using the iteration counter is relatively inflexible.

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

Hm, I'll try that.

 

And I'd love to try once I better learn how to use shift registers. This is my first week using labview and my class has only gone over while loops and case structures so far. I have no knowledge apart from vague things I've read online about shift registers. Thanks for the help!

0 Kudos
Message 3 of 4
(3,230 Views)

worked 🙂

0 Kudos
Message 4 of 4
(3,221 Views)