thols Posted February 21, 2014 Report Share Posted February 21, 2014 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 Quote Link to comment
thols Posted March 13, 2014 Author Report Share Posted March 13, 2014 This has been filed as CAR 455443 see this thread: http://forums.ni.com/t5/LabVIEW/Chart-Redraw-Issue-with-Multiple-Plots/m-p/2755616/highlight/true#M812948 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.