01-22-2016 12:27 AM
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
Solved! Go to Solution.
01-22-2016 01:28 AM
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.
01-22-2016 01:32 AM
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!
01-22-2016 01:37 AM - edited 01-22-2016 01:47 AM
worked 🙂