LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart plotting in real time

I am acquiring various sensor readings at different rates.  I would like to plot them in various plots vs. actual time.  I want the old data points to remain in the plot but I don't want to store the values in memory (so I think a chart fits best).  Currently, my y values are working fine, but my x axis is incorrect.  It begins plotting with x0 = 1 and continues incrementing for each new array value added.  Thus, I can plot using relative time, but my relative times are also incorrect as the sensor values are not updated once/second.  I've looked at various examples (real-time chart.vi, variable time chart xy.vi, etc) but these all take an initial time reading and then base the rest of the time values off of a delay value built into the loop.  My application may be paused at times and this delay value would become off (too slow as the time counter would not count all the paused time).  What I'd really like to do is input the sensor value and actual time value into the plot each time a new data point goes up.  This way my time values cannot be off no matter what happens.  I'd like to display the x axis in absolute time.  It seems like this should be a pretty standard process, but I am really having trouble getting it right.  Thanks for your help.
0 Kudos
Message 1 of 2
(2,750 Views)

It sounds like you may benefit from using a waveform data type.

Wire up this VI

and you will see that the chart will plot the data points at the times you specifiy.

Notes:

Click on chart and make sure Ignore attributes" is NOT clciked.

If you srent a new number of plots than previous updates

or

You specify a time for a plot that is prior to a point that is already plotted

Then

THe chart will reset.

You can specify the time interval of periodic signals by specifying the dt, and presenting an array with more than one element.

You can force a gap (lift the pen) by posting NaN.

Have fun,

Ben

Message Edited by Ben on 02-12-2007 05:59 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,738 Views)