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: 

Waveform Charts and Data vs Time

A new Labview user, I've only been playing with Labview 8 for a couple
weeks and have a question about charts. I want to chart data over
time. The data comes in from an external instrument via RS232 and may
be one or more channels. The scan rate will be variable from 1 scan
per second upward. When I setup the chart I use the relative time
setting for the x axis. If I, say set it to 60 seconds and have a scan
rate of once per second all is okay. But if the scan rate is changed
to once every 2 seconds the 60 second display now represents 2 minutes.
In other words the 60 second x axis time represents 60 samples, not 60
seconds so when the scan rate is changed the time relative to scan rate
changes. Am I missing something? Is it possible to set up a chart
that actually accurately plots data relative to time? I want an
operator to be able to vary the scan rate and have the data accurately
plotted versus time. So that a chart with a fixed time interval of say
1 hour will plot data accurately time wise regardless of how often data
arrives. Obviously the distance between data points along the time axis
would change depending on the scan rate. Essentially, I wants to
emulate a mechanical strip chart recorder. Am I using the wrong type
of chart/graph? Does this even make sense? Thanks, Mike

0 Kudos
Message 1 of 6
(4,036 Views)
Hi:

Waveform graph/charts are for displaying evenly sampled measurements. In your case, the sample rate is variable so the best graph for your application is a XY Graph. I've made a simple VI that uses a XY Graph to plot data acquired (it this case simulated by the Random Function) at a variable sampling rate. The samplig rate is simulated with the Wait Function. Hope this helps you.

Regards.

Robst


Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 2 of 6
(4,027 Views)
Hi:

In the VI I posted I made a little mistake, one on the inputs of the Divide function must be 1000 not 255, I mistakenly choosed U8 for the representation of the variable, so LabVIEW truncated the value. Smiley Wink





Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 3 of 6
(4,016 Views)
Robst, indeed it does help. As I suspected, I was barking up the wrong
tree. Many thanks. Mike

0 Kudos
Message 4 of 6
(4,012 Views)
Hi!

If my sample rate does not vary during a test run, is there anyway to setup a Waveform chart so that the relative time is accurate?

That example program that you wrote works well, but I don't like the extra wiring required to keep the data going to the xy-plot as an array as oppose to point-by-point like the Waveform chart allows.  Like was pointed out before, if the sample rate is set to 1 then the relative time x-axis formatting works, but for any other sample rate it stops being accurate.

Thank you!
-Nic
0 Kudos
Message 5 of 6
(3,964 Views)
You can wire a waveform data type into a waveform chart. Waveforms demand uniform sampling rate. They are basicly a cluster with 3 pieces of information: dt (time between acquisitions), t0 (intial time), and an array of Y-values.
Jarrod S.
National Instruments
0 Kudos
Message 6 of 6
(3,950 Views)