LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Charts,graphs and XY plots - with multiple time scales (and varying durations)

Solved!
Go to solution

Hi. A first time user here.

 

How best to display data that comes from say multiple loops (i.e. different timescales and durations).  This displaying would also accommodate imperfect time sampling (which can vary between samples).

 

My only solution with the LabVIEW range is XY plotting where the whole of the display happens at once. 

Is there a way to do this displaying with an incremental approach ?  The “charting” approach permits an incremental approach but seems to need a rigid requirement for the sampling.

 

Can a limited version of an XY plot be achieved with a charting approach (where samples a modified to suit) ?

 

Regards JC....

0 Kudos
Message 1 of 7
(1,165 Views)

You can create a waveform chart with sporadic sampling. Unfortunately, if you have 3 plots on your chart, it will expect 3 points every time you plot. I think you could get around this by setting the value to "NaN" on the plots you don't want to display anything on, but I'm not sure that is any simpler than holding XY graph data in memory and appending samples to the correct plot you want to update.

0 Kudos
Message 2 of 7
(1,148 Views)

Hi. Thank you Gregory.

I did investigate your comment and the provided link.  Based on this I came up with the attached vi.  If I use a NaN the series has a break in the presentation.  Yes I do need to provide a complete set of waveforms for each presentation (to the chart).  However, if I provide an empty array, this results in a continuous series (in the chart).  Both situations are presented in the red series below.

 

pushkin_1-1629884295720.png

 

It appears I can write the different waveform series (with a T0 for the single Y element) in a rather add hock manner (provided I give null type information for the other channels).

 

The next question is can I present values as Y0, Y1, Y2, Y3 (i.e. an array) with a T0, T2 , T2, T3 array ?  This means no dt usage (and it's a single value assuming constant sampling).

 

Another question is can I present a number of different Ys for different channels/series with the same T0 type time base information ? or should I not consider this an issue ?

 

Regards JC......

 

0 Kudos
Message 3 of 7
(1,110 Views)

Hi JC,

 


@pushkin wrote:

The next question is can I present values as Y0, Y1, Y2, Y3 (i.e. an array) with a T0, T2 , T2, T3 array ?  This means no dt usage (and it's a single value assuming constant sampling).

 

Another question is can I present a number of different Ys for different channels/series with the same T0 type time base information ? or should I not consider this an issue ?


When you want real full control over all points and plots you should consider using a XY graph!

Right now you get much (but not full) control using waveforms in a waveform chart…

 

With XYGraphs you can collect your data in any datatype you want, all you need to do is to prepare your plots as needed!

When you want to collect a timestamp array next to your Y sample array then it's fine.

When you use the same timestamp (array) for several Y sample (arrays), then it's also fine…

 

On your VI: writing to a chart using its terminal and a local variable in parallel might lead to unexpected results! (Race condition, etc.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(1,107 Views)

Hi.  Thank you GerdW.

The major reason for the use of Waveform Charts is the capacity to perform incremental updates from the previous update.  This is expected to be more efficient than XY Graphs, especially when we are doing 30,000 plot point per trace.

 

The Chart usage is such that 3,000 points are displayed (10 seconds) with the history set at plus 30,000 points (100 seconds).  When you expand the display it does seem to have an update issue for the chart.  So an XY Chart (with complete trace update) would be hopeless.

 

I did spot the race condition with the use of terminal and local variables.  So I trust that putting both into a Frame negates this.

 

Regards JC....

0 Kudos
Message 5 of 7
(1,091 Views)
Solution
Accepted by topic author pushkin

When you graph 30,000 points, you have to make a copy of all that data. The graph / chart will not display that many points. Your monitor probably has ~2000 horizontal pixels, so even if your graph takes up the width of the monitor you are only able to see 1/15 of the points. Instead of making a copy of all that data, you downsample the data yourself before sending it to the graph / chart. 

 

Also, if you're capturing data quite fast, you don't need to update the graph on every data point. The user probably won't mind if the graph is only updated 1 time per second. I've seen many UIs where the indicators update way too fast and it is actually quite hard to focus on.

0 Kudos
Message 6 of 7
(1,088 Views)

Hi.  Thank you Gregory.

The application is for 30,000 points into the 1 Chart.  Stopping the trace update if need be.  Use the provide NI tool Graph Palette and interrogate the historical data.

 

The 30,000 data points are necessary history.  I find the NI Waveform Chart with history, incremental updates and usage of the Graph Palette the most elegant solution.

 

The Chart update rate would be about 20 Hz while the data provided with these updates has a resolution of 20 Hz and 300 Hz for different channel/series groups.

Each channel/series has individual timestamps with the amplitude data for each channel.

 

My initial attachment indicate possible approaches.  My biggest mis-giving is that every channel/series point must be individually presented with a timestamp.

I cannot use the array processing of the Waveform structure that assumes the same dt between elements.

 

Regards JC....

0 Kudos
Message 7 of 7
(1,085 Views)