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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build graph or chart

HI everybody...
 
I have two signals, one is temperatura and another one is pressure.
What is the best way to plot both information on a graph or chart?
Both sensors colect the signal and plot in a graph or chart.  I need to do in real time
 
I tried to simulate like showed in the photo attached.
Why the values from inside loop while dont' come out to build array function??
 
Tks
 
Muganga
 
0 Kudos
Message 1 of 12
(3,615 Views)
you won't get any data to flow past a while loop until the loop terminates.  consider those like outputs of a subvi and you'll have the right idea.  in order to get your chart to update continuously, put it inside the loop


Message Edited by JeffOverton on 05-27-2008 02:05 PM
0 Kudos
Message 2 of 12
(3,613 Views)
I want plot two array. For instance:
When I have 20°F , pressure read from sensor is 300 psi
 
Temperature     Pressure
       20                     200
       22                     210
       30                     236
       45                     280
       62                     294
 
How can I show those values in a graph or chart?
 
I tried to do this.
 
Tks
 
 
0 Kudos
Message 3 of 12
(3,584 Views)
You need to bundle the two values, e.g. as in the picture. Try it! 🙂
 


Message Edited by altenbach on 05-27-2008 01:38 PM
0 Kudos
Message 4 of 12
(3,574 Views)

altenbach

 

What I need to do is collect data from two sensors (temperature and pressure) and display in a graph like photo attached.

Tks

 

0 Kudos
Message 5 of 12
(3,565 Views)
Then use the express xy graph (from the express palette) and configure it to NOT clear data on each call.
 
There are many other ways to do this. How long it it supposed to run?
 
 
The example finder also contains an old xy chart example (pre-express).


Message Edited by altenbach on 05-27-2008 02:32 PM
0 Kudos
Message 6 of 12
(3,555 Views)
altenbach
 
At least 5 minutes and at most 24 hours.
Instead use express XY graph I tried use this way but it doesn't work. The graph is not shown.
what can I do to solve my problem?
Tks
 
Muganga
 
0 Kudos
Message 7 of 12
(3,519 Views)

Your graph is in the same loop as where you create the data points, so you only send two coordinates to the graph, which may be difficult to see.

Use a For Loop to generate the numeric arrays. Then wire them to the graph.

RayR

0 Kudos
Message 8 of 12
(3,509 Views)
Of course this will show the graph, but it will only show the current point (use a style with points instead of only lines and you will see it).
 
Your way has no memory between iterations and the code forgets all previous data with each new iteration.
 
Did you look at the xy chart example that ships with LabVIEW as I mentioned? Open the example finder and look for it. It contains a subVI that buffers the data. You could also use two instances of the express VI named "Collector" to buffer the x and y data. Check the online help.
 
Of course you could just use two shift registers as in the attached image.
 


muganga wrote:
At least 5 minutes and at most 24 hours.

Well, unless we know the sampling rate, this does not help. How many points will be on the graph in the worst case scenario? Instead of growing the history without limits (which can be very hard on memory management), you might want to use a fixed size FIFO buffer to keep only the last N point of the history.


Message Edited by altenbach on 05-28-2008 08:55 AM
0 Kudos
Message 9 of 12
(3,505 Views)

thank you everybody for all....

Let me try explain what I want do.

I have two sensors, temperature and pressure. After press a button in a specific VI, both sensores start working and start registering the temperature and pressure. Independent of time. I mean, just if pressure or temperature change I will have another point plotted in the graph.

Using the while loop with time delay, both sensors are working according to time. As I told before, I dont want the sensors working with time.

What is the best way to do this?

 

Tks

 

Muganga

 

0 Kudos
Message 10 of 12
(3,481 Views)