02-26-2014 01:27 AM
Scenario:
Plot two waveforms periodically to a chart (array of wfms for each iteration). 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.
Please take a look at the attached VI to see the (dare I call it bug) in action. 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.
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. The X-scale will go berserk. 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.
Solved! Go to Solution.
02-26-2014 02:52 AM
Hi thols,
I pressume based on the description you made and the result after I run the code which you have attached, you have an issue with the missing Plot 0 when Plot 1 passes it? Have you tried removing the flat sequence structure?
Warmest regards,
Lennard.C
02-26-2014 05:39 AM
03-07-2014 09:38 AM
This has been filed as CAR 455443.
Regards,
Jeff Peacock
Product Support Engineer | LabVIEW R&D | National Instruments
11-25-2015 01:27 PM
I am interested in the resolution of CAR 455443. I am having similar issues. This example displays the same issues I am having.
The sweep mode looks terrible with the red marker copying itself. I looked for a way to disable the marker or make it transparent and could not find anything in the property nodes.
I have a waveform chart with timestamps in the X axis. My application is indexing a data buffer every X period and plotting the data in a "real time" view. There are gaps in the waveform, which I believe I understand: each waveform I send in has the current time as the t0 start time and has a set sample period dt = 0.005. The gap is probably the error in the actual sample period compared to the set sample period.
My main issue is that sporadically, the graph will redraw in the middle of charting the data. It appears the history is disappearing. I am thinking that perhaps LabVIEW is generating some kind of internal error when plotting the data if perhaps the data points end up overlapping each other; then LabVIEW must erase the history and start over.
Any thoughts would be appreciated. At this point my application just appears glitchy as if it has issues. Hopefully my customer won't be too displeased...
11-26-2015 12:16 AM
My suggestion is to use an XY graph and ditch the chart. The reason I started using a chart is that the project I was on had performance requirements that the XY graph couldn't handle, even with pre-processing the data so that a minimum of data was updated to the graph (many plots and graphs with high update interval). If you want to get the data to be updated in the XY graph in the same manner as for a chart, you can do your own method for it, calculating what data should be presented.
There is no progress on the CAR, and I do not expect it to be. Instead I can only say: "Good things come to those who wait".
//Thomas
12-08-2015 02:45 PM
Thanks, Thomas. Sounds like I will have to just take the reigns on this one.