LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having many charts in LabVIEW NXG 3.0.2 causes some of them to hang

Hi

 

I have created an application for a customer based on the modified Continuous Mesurement project template provided in this forum topic:

https://forums.ni.com/t5/LabVIEW/Create-Application-Library-from-item-moves-files-on-disk/m-p/390634...

 

Problem: the charts lag and hang.

 

Description: The panel of the main VI contains nine charts that plot a total of 21 waveforms. The chart history length is 1024. The sampling rate is 50 S/s/ch. The acquisition loop and the chart population loop run uniterrupted. The notifier that provide data to the charts gets approximately two samples per acquisiton loop iteration. After a short while the charts start to visually lag or to not update as smoothly as expected. After some minutes one or more of the charts completely hangs, while the others continue to present new data. I have found a trick to make the hanged charts come alive again. If I scroll the mouse wheel or click the mouse buttons, the charts start moving again. If it is really bad, it can take a number of scrolls or clicks to make the charts to "catch up". This means that buttons of the panel becomes unresponsive or takes several seconds to respond. The problem appears regardless of using real hardware, simulated hardware or streaming from TDMS. The CPU load is between 50-70 %, see the screenshot of the task manager.

 

Mitigation: I seems that having smaller chart history lengths and a smaller x axis ranges (max - min) minimizes the risk for this behavior.

 

Example code: Since I cannot share the customer's code, I have created and attached code based on the project template mentioned above with a minimum amount of edits to recreate the problem.

  • 24 charts
  • History length 1024
  • X max 10
  • Y max 0
  • Acquisition loop:
  • Simulated sine wave freq: 1 Hz
  • Loop freq: 25 Hz
  • Sampling freq: 50 Hz
  • Samples per iteration: 2

The attached video shows a scenario where three of the charts have hanged. The video zooms in on one chart. The chart comes alive when the mouse wheel is scrolled.

 

Any ideas on the cause of this problem and how to avoid it?

 

Thanks

Sebastian

0 Kudos
Message 1 of 3
(1,764 Views)

I just tried this in NXG 3.0, and yeah, it's slow. Some things you could try:

  • Under File -> Preferences, on the Editor tab scroll down to Visual Experience and check/uncheck Use hardware graphics acceleration for graphs (if available).
  • Instead of 24 separate charts, is plotting multiple channels to a single chart an option? As it stands, LabVIEW has to update the interface for every write to an indicator (ie. 24 times/point).
    • If that's not an option, grouping the charts on a multi-page tab control will help. I just put a tab control down with four charts per page and it sped things up dramatically.
  • Uncheck the anti-aliased option for each chart (in the side panel, under Visual style)
  • I'd recommend trying the "defer panel updates" option, but NXG doesn't seem to have it?




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 3
(1,717 Views)

Thanks for your reply and suggestions. Greatly appreciated.

 

  • The Use hardware graphics acceleration for graphs (if available) checkbox has been checked in my system throughout (by default). I tried to uncheck it but I noticed no improvement.
  • The customer's application contains nine charts. Because on different ranges and units it would be preferrable to be able to keep the nine charts rather than combining them into fewer charts. Initially I tried dual y axes and fewer charts, but found it tricky to make it look pretty. I went for having more charts. That was before I noticed this lagging problem.
    • I now tried using a tab control and placing two or four chart on each tab. Yes, it seems to make things smoother. I will investigate if this is a good workaround in this case. I noticed that when switching to a tab, the immediate history of the plots in the charts in that tab is not shown. This might be unwanted behavior by the user.
  • The anti-aliased option is unchecked in the customer's application. I forgot to uncheck it in the example code that I attached. It does not seem to do much difference, if any.

Sebastian

0 Kudos
Message 3 of 3
(1,708 Views)