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.
02-03-2021 07:38 AM
Hi, I'm completely new to LabVIEW. I am trying to make a program that measures the water level in a tank, I have a tank loses water to a resrvoir tank. The tank has a pressure gauge that turns the pressure into a voltmeter. Then I also have a pump that pumps up water from the reservoir gauge wich is controlled via a power supply. The program should be able to have a max and a min height in the tank, if then tank is at min the pump should start and at max the pump should stop. I also want to monitor this in a sweep chart. And last i want to have a lamp that goes red if tank is below min height and green if at max height. I will attach what i have done and happily take suggestions or if im even doing anything right.
Solved! Go to Solution.
02-03-2021 08:15 AM
What you have looks like it is almost there, at least once you use block diagram cleanup to get rid of those backwards running wires.
But since you only want the power supply to turn off in once situation, and turn on in the other, those GPIB write functions belong in case structures that are connected to the same booleans that connect to the LED's.
02-03-2021 09:20 AM
How would I go about that? Can't really figure out how those case structures work, is it just to take it from for exampel <= and wire it to a case structure and then have the GPIB write inside or?
Thanks for the response.
02-03-2021 10:01 AM
Yes. Put the write inside the Case structure.
If you don't understand case structures, then back up and take some LabVIEW tutorials. How to Learn LV
02-03-2021 11:17 AM
So maybe more like this then?
02-03-2021 11:45 AM
Close. But you wired the boolean wires to a tunnel of the case structure.
They are supposed to be wired to the Case Selector (green ?) like the tutorials show you.
If you click on the broken run arrow, it will give you a list of the errors in your VI.
You also seem to have the GPIB read and write for the voltmeter in parallel. Should those be in series (wire the error terminal from one to the other) so that you can write a command first then proceed to read the response?
02-03-2021 12:09 PM
Aha okay, well I think I got it now, can you make a last check and see if you can see anything wrong, at least I don't have a broken arrow anymore.
Thanks for all the help! Really appreciate it!
02-03-2021 01:01 PM - edited 02-03-2021 01:05 PM
Hi kalwet,
@kalwet wrote:
can you make a last check and see if you can see anything wrong, at least I don't have a broken arrow anymore.
Are you sure about the address strings for all those GPIB calls? The LabVIEW help describes them in a different way…
Do you really need to use those old GPIB functions? Why not use the "modern" VISA functions instead?
You should only send commands to the "Power supply" when the boolean values (Tank full, Tank tom) change: read the help for PtByPt-BooleanCrossing…
You don't need two indicators (Tank, chart) to show the very same value: show the numeric display of the chart!
The constant "5" should be of DBL datatype…
02-03-2021 01:06 PM - edited 02-03-2021 01:07 PM
@kalwet wrote:
... check and see if you can see anything wrong, at least I don't have a broken arrow anymore.
A few more tips:
02-03-2021 01:15 PM
Those are the ones we are supposed to use, the old GPIB. Regarding the GBIP address string, I don't have it for the moment, will add them later. And regarding the graph, I want to show how much there is in the tank during a time span. It should be a "sweep chart" but I'm not sure if I've done it right.
Can't really understand the PtbyPt-BooleanCrossing, I will read about it tomorrow.
Thanks for the feedback!