LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update XY graph during real-time?

As far as I know, waveform chart can update data during real-time. Yet XY graph can't do so for it uses array which can't be updated during real-time. I want to display a figure of intensity(from lockin amplifier) vs time (not x axis in waveform).The waveform can't change x axis, and the xy graph can't update during real-time. How can't do that?
0 Kudos
Message 1 of 4
(5,615 Views)
> As far as I know, waveform chart can update data during real-time. Yet
> XY graph can't do so for it uses array which can't be updated during
> real-time. I want to display a figure of intensity(from lockin
> amplifier) vs time (not x axis in waveform).The waveform can't change
> x axis, and the xy graph can't update during real-time. How can't do
> that?

All LV controls and indicators can update at runtime. The difference is
what they do when updated. Waveform Charts accumulate data like a chart
recorder, and everything else displays its new value, replacing the old one.

What to do about this? Accumulate the data into an array and plot the
accumulated XY rather than just the latest batch. The best way to do
this is with a shift register, and that b
rings up another good point.
You shouldn't really use controls for storage of data. Use wires until
you need feedback, then use shift registers.

For a working example of an XY chart, with a subVI that accumulates the
data for you, look at examples/general/graphs/charts.llb/XY Chart.vi.

Greg McKaskle
0 Kudos
Message 2 of 4
(5,614 Views)
Hi,Greg.Thank you for your answer,but I think I didn't put out my question clearly.

I want to display a figure of intensity(from lockin
amplifier) vs time (not x axis in waveform chart), which will plot point by point(just like waveform chart), not plot all data at the same time(like waveform graph).Of course, each intensity corresponds with a time value. How to change the X axis into my time values? It's the number of the points now.
0 Kudos
Message 3 of 4
(5,614 Views)
> I want to display a figure of intensity(from lockin
> amplifier) vs time (not x axis in waveform chart), which will plot
> point by point(just like waveform chart), not plot all data at the
> same time(like waveform graph).Of course, each intensity corresponds
> with a time value. How to change the X axis into my time values? It's
> the number of the points now.

Ah. I think you want to set the Multiplier and Offset for the X scale.
You can do this interactively in the Formatting dialog, or
programmatically using property nodes, then set the format of the scale
to display either relative or absolute time. Generally, the multiplier
and offset are the terms in a linear transform from the index to what is
diplayed for the scale labels
.

Set the multiplier to be the sample period in seconds. If sampling once
every five seconds, set the multiplier to five, if sampling at 1KHz, set
it to .001. Then set the offset to determine what index zero should be
displayed as. It may take a bit of playing, but the example Real-Time
Chart.vi in the examples/general/graphs.llb show how to do this
programmatically for absolute time.

Greg McKaskle
0 Kudos
Message 4 of 4
(5,614 Views)