LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart/Graph for time-stamped data

I want to display multi-pseudrealtime-x values from serial port with its correct time stamps. Serial communication frequncy is about 10 Hz but not uniform, changing 1-20Hz. So I cannot use standard chart. I try to use x-y graph with scroll by range property, but it is awully dizzy. How I can display them?
0 Kudos
Message 1 of 15
(4,249 Views)
How about adding a polling routine that only examines the serial input buffer once every 10ms? That way all of your data will be displayed with a 10ms resolution and in 10ms chunks. If there are multiple data points in the buffer, then you can average them. If there are no points, then you can skip that time stamp or adjust your program so you'll get at least one data point per sample. Of course this will move away from 'realtime', but it may be acceptable depending on what you are going to be doing with the data (visual only, logging, etc.).

+Chris
0 Kudos
Message 2 of 15
(4,249 Views)
Thanks for your advise. I have tried that, but it displays diffrent waveform from that of x-y graph. I'd like to display correct waveform.
0 Kudos
Message 4 of 15
(4,249 Views)
What is the exact waveform you would like to display? You mentioned data and timestamp, and I envisioned a scrolling stripchart. Is this what you had in mind as well? What are your x and y axis?
0 Kudos
Message 6 of 15
(4,249 Views)
What I want to display are Speed command for a divice and its actual speed sent from the control computer other than Labview computor. As the control computer gives priority to the real time control, serail communication timing varies time to time.
0 Kudos
Message 7 of 15
(4,249 Views)
Sounds exactly what a waveform chart object was designed to do. There is a good example of a chart of multiple data points with time stamps in the LabVIEW examples (charts.llb->real-time chart.vi). Using a waveform chart means you don't have to redraw the graph for every new data point. Is this what you had in mind?
0 Kudos
Message 8 of 15
(4,249 Views)
I cannot open the sample because my LabVIEW is version 6.0.2. But I look in real-time chart.vi of 6.0.2, it seems that dt can be configurable at start-up only.... What I want to do is dt can configurable for everytime.
0 Kudos
Message 10 of 15
(4,249 Views)
> What I want to display are Speed command for a divice and its actual
> speed sent from the control computer other than Labview computor. As
> the control computer gives priority to the real time control, serail
> communication timing varies time to time.
>

You don't mention a version number. If you can build the points into
a waveform, then the chart will be given timestamped points and will
correctly plot them. This is the only way to timestamp points for a
chart and all other methods assume that dT is constant between points.
If you don't have LV6, you don't have waveforms and your best bet is to
use the XY graph. There are VIs in the examples/general/graph folder
for making an XY chart.

Greg McKaskle
0 Kudos
Message 9 of 15
(4,249 Views)
My LabVIEW version is 6.0.2. Will you inform me how to change dt everytime?
0 Kudos
Message 11 of 15
(3,633 Views)
> My LabVIEW version is 6.0.2. Will you inform me how to change dt
> everytime?
>

The key is to make the basic element a waveform rather than a scalar
number. If you currently have a scalar double wired to your chart, go
to the waveform palette and drop a Build Waveform node. This will allow
you to wire up a timestamp and a deltaTime. For single points, only the
timestamp is used. Doing this, you now have timestamped points and the
chart will place them on the time scale based upon this value. There
are a few assumptions such as -- time marches forward. A timestamp
before others written to the chart will clear the chart assuming that
you are starting over again.

If you are currently updating
the chart with an array, you can drop the
same node and give the amplitudes a timestamp as well as a dT to
describe the time between the elements of the array.

If you currently have a cluster wired to the chart, take the point of
each cluster, make a waveform, and build an array of the waveforms.

If you currently have an array of clusters, then you will want to build
an array of waveforms similarly.

If this description isn't enough help, you might want to look at the
graph examples.

Greg McKaskle
Message 12 of 15
(3,633 Views)