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: 

How to pause a waveform chart?

Hello,
 
I would like to be able to (simply) pause a waveform chart, while still sending data to it (i.e. I don't want to just pause the VI altogether, I'd just like the chart indicator to stop updating, without losing any data).  I'd also like to be able to scroll the x-axis scroll bar and manually edit the axis scales while doing this.  I've tried using a property node to hold the x-axis range, but this causes flickering, as new data causes the x-axis to change briefly before the property node sets it back.  I've also tried using the front panel "Defer Panel Updates" property.  This works well, except for one bug/feature in LabVIEW: If I set "Defer Panel Updates" to TRUE, the display pauses as I would like, but if I then drag the x-axis scroll bar on the chart, the plot area actually gets properly redrawn - which is actually exactly what I want (apparently the event handler for the scroll bar is ignoring the "Defer Panel Updates" property).  The problem is that only the plot area gets redrawn - the actual x-axis values don't change (i.e. the chart plots display data that does not correspond to the x-axis scale displayed - the gridlines don't even line up with the axis values and tick marks).
 
I know I could maintain my own data buffer, and stop sending data to the chart when I want to pause, but I'd like to avoid doing this, since the chart is already a nice buffer, and this would use up memory.
 
Any suggestions?
 
TIA,
 
Jaegen
0 Kudos
Message 1 of 6
(5,759 Views)

Hi Jaegen,

Have a look at this VI.

I pause the chart by simply placing it inside a case structure.once paused, you can rescale axis, select a portion of chart and zoom it etc.

Hope this helps

Regards

Dev

 

Message 2 of 6
(5,736 Views)

Thanks for this, but unfortunately it doesn't quite do what I need.  I don't want to lose any data while the chart is paused, and this VI does (random numbers generated while the chart is paused are lost).

 

Jaegen

0 Kudos
Message 3 of 6
(5,721 Views)
Well,
 
If that's your requirement, go for a graph with a shift register as shown
 
Note: watch out for virtual memory overload while using shift registers
 
 
Regards
Dev
 
0 Kudos
Message 4 of 6
(5,704 Views)

I hope you don't mind me chipping in here. I have an alternative method that uses two charts and property nodes. One chart is used to store all the data and the other to show the data after a pause. You don't need the shift register here just use the history data collected on the chart.

Have a look and see what you think.

David

0 Kudos
Message 5 of 6
(5,696 Views)
Hi Jaegen and David,
 
David's solution also shows an innovative way of "pausing" the chart.
 
But Jaegen, do keep in mind that  charts have a limit on the history length or the number of values you can store.
 
Regards
Dev
 
0 Kudos
Message 6 of 6
(5,673 Views)