LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pump tank control

Hi, I am trying a tank control VI but im having a problem when i stop the tank filling pump, the value of the tank is not held when going to the next frame if someone can point out my error, very new to this!

0 Kudos
Message 1 of 6
(2,077 Views)

Run your code, and watch what happens. 

Because your second sequence is initialised at 90 as the tank value, rather than reading the value, it jumps. 

0 Kudos
Message 2 of 6
(2,016 Views)

Thanks I'll try this when I get home, I knew that was the problem I just couldn't spot where in that frame was causing it. Do I need to make a tunnel from the first frame to the second or will using a local variable do the job?

0 Kudos
Message 3 of 6
(2,003 Views)

Your problem is a seriously flawed program architecture. All you need is one outer loop, not a single local variable, and a simple state machine architecture.

 

Some glaring problems:

  • equal comparisons with floating point values
  • race conditions due to writing to terminals and reading from their local variable in parallel (e.g. storage tank 1 in the first inner loop).
  • Learn about shift registers
  • etc. etc.

I recommend to start with a few basic tutorials. Write down all the program requirements and what should happen as a function of time and user interaction.

Message 4 of 6
(1,971 Views)

Try to understand the attached very simplified program. Maybe it can give you some ideas.

 

altenbach_1-1704223690493.png

 

 

 

 

Message 5 of 6
(1,965 Views)

Thank you for this! I'll post an update when I have my program fixed!

0 Kudos
Message 6 of 6
(1,953 Views)