Jump to content

Chart redraw issue with multiple plots


thols

Recommended Posts

Hi, I hope this is the right place to post this.
 
Please take a look at the attached VI to see an issue I'm having. If you have any ideas, please share.
 
I managed to find a partial workaround to this issue, but the behaviour looks odd and bug-like, and sweep mode still looks very bad.
 
Background:
I wanted to use charts to create the most efficient way of displaying data, since I need to display several plots with high update frequencies but of varying sampling frequencies. Before plotting the data, it is already decimated so I will only plot as many points as I have pixels available.
 
Scenario:
Plot 2 waveforms periodically to a chart (array of wfms for each period). Use scope or sweep mode. Strip mode seems to work a little bit better.
 
Issues:
* If one plot in a wfm-array is empty for an update, the other plot will not redraw properly. It will redraw when the second plot has data but the first plot will be incorrectly drawn, parts of the data/points will be missing. 
 
* Sweep mode will leave lots of red lines and erase some of the data it is passing.
 
 
Attempted workarounds:
* ForceRedraw: Does nothing. Am I using it wrong?
 
* Defer FP: Does nothing.
 
* Remove empty wfms at end of wfm array (for one update/iteration):
- draws first plot correctly
- does not draw line on second plot
- If window is resized, data is cleared, only the last section of the plot is visible. Seems like earlier data in plot is "forgotten".
- Autoscaling will not work. It will autoscales on the last section of data.
 
* Increase history lenght: Does nothing.
 
* Put an indicator in front of the graph: Screws up redraw until window is resized. Graph update gets very slow. I used this trick once on a flickering text indicator and placed an invisible object in front of it, which helped in that situation.
 
* Resize the window: Works! Not a very convenient workaround. Even sweep mode looks ok.
 
* Use XY-graph: My goal was to make the most efficient way of displaying data with relatively high update rates. I Used an XY, but when I had a few of those graphs, the cpu load was very high, and I verified that it was the actual writing to the graph indicator that took all cpu. I tried updating less frequently and I already have the data decimated before sending it to the graph, but the cpu was still too high. Replacing with chart work like a miracle with almost no cpu-load
 
* If a wfm is empty for an iteration, plot the last plotted point again but with a very small positive time-offset (I think it didn't work well plotting with the same time again): graph redraws ok in scope mode but not in sweep mode. But If I plot that last point again and again, the other plot will eventually cause the x-scale to autoset, and I will need to keep track of the scale and not re-plot that lone point if it falls out of the x-scale. It starts to get tricky here and I have not solved all issues that can arise here yet, but this is the workaround I'm using now. And For charts, I haven't found a way to disable that automatic scale update (is there a way?).
 
I have made and test VI for testing these issues (attached), where different workarounds can be tested by activating different buttons. Just run it in the default setting to run it without workarounds activated and it should show the refresh issue quite clearly. I have tested this on 2 PCs and on LabVIEW 2013, 2012, 2010 and 8.6.
 
 
Any ideas?
 

Chart Redraw issue - LV2013.vi

Chart Redraw issue LV 2010.vi

Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.