From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-22-2012 07:32 PM - edited 01-22-2012 07:34 PM
Hello, I use version 7.1 for developing a scada application for seeing liquid tanks levels, and I need to see the flow depicted at tank indicator from one to another in this way.
I fail in third point, Is it possible to make it as I madeor anything similar? The vi I made became crazy when I turn on.
Thank you very much.
01-22-2012 07:44 PM
1. Your VI is designed to only run one time. It runs once. Then it stops. My guess is your are using the Run Continuously button. Don't. It is only intended for special situations like if you want to debug a VI. If you want your VI to keep running, then use a while loop around it and a stop button.
2. You need a wait statement in your loop. Without a wait statment, your VI will run as fast as the CPU allows.
3. Local variables are almost always used incorrectly by new LabVIEW users. Read this thread Why some people say Local Variables are bad... for some reasons why.
Then I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
01-22-2012 07:57 PM
Paul,
How are you running this VI? Are you using Continuous Run? If so, STOP! That is only for use during development. To cause code to run repeatedly put it inside a while loop.
Once you have a loop, add shift registers for the Tank levels. Get rid of the local variables. They may be contributing to race conditions. Wires are always better.
Your conditions are not clear. You specify that Tank 1 should increase when EV 1 is on but you only write the value of the control to the tank. Your code shows a decrease on Tank 1 when EV 2 is on, but your words do not say that. Similarly if EV 2 is on and EV 1 has never been on, Tank 2 will have a negative value.
Please try again to explain what you want. Perhaps a small table showing values of EV 1, EV 2, Level1, Tank 1, Level2, and Tank 2 over time would help.
Lynn
02-13-2012 02:10 PM - edited 02-13-2012 02:10 PM
I think so I must rethink the problem. First of all, I need to design a hysteresis cycle for the system.
I explain you, When the tank is empty or has a low liquid level, automatically the switch must be turned on, untill the liquid fill the tank up.
And when the tank is filled, automatically the switch is turned off despite of the liquid go down under the maximum value. After, the second switch is turned on and must repeat the same while it is turned the first tank down.
But I don't know how to do it, untill now I only did something similar as an inverter comparator.
02-13-2012 02:30 PM
Paul,
Hysteresis is what you need.
In your loop have two thresholds. One is near the top of the tank (Upper). When Level > Upper, then open the drain valve and close the fill valve. The other is near the bottom of the tank (Lower). When Level < Lower, close the drain valve and open the fill valve. When the Level is between Upper and Lower, do nothing. Keep the current state of the valves in shift registers.
Lynn
02-13-2012 03:54 PM
I think that I get it, I guess...
Well, this is only the begining but I post it the other parts of the problems.
Thank you