08-12-2011 02:06 PM
Hi,
I have attached the Temp_test.vi and the image of the output on the screen. The vi simulates a temperature reading over long time. The plot shows the data normally, but after a while some earlier genrated points, not the current data drops to zero. Please try it out and see if there are any answers. Running Windows 7 64-bit and Labview 2010 SP1 (LabVIEW 2911sp).
Thanks for your help.
Tom
08-12-2011 03:16 PM
My guess would be that this is a memory/performance issue of your system when LabVIEW redraw the graph when it need to change the x-scale. This VI require a continuously increasing size of memory and it probably need to make a copy of all data when it need to change the graph scale. Do you really need to display all the values since the beginning in you graph? A waveform chart would probably be more appropriate. Do you also really need to measure temperature every 10 ms?
Note that I was not able to reproduce what you observed, I did not run your VI as I'm using LV2009 but I reproduce the code. Also, why do you check if value is diferent from zero, since you add 25 to a random number between 0 and 1 the result will never be 0. So you could get rid of this comparison and of the shift register (note: if used, the SR should be initialized in this case).
Ben64
08-12-2011 03:34 PM
hi,
Normally the input is via an RS232 port sampled 4-5 times per second. System has 4GB memory. Problem did not appear with Windows XP 32- bit. Running time of program could be up to 12 hours - everiging about 2 hrs. That is 36000 points The data is also stored on disk at the end. Which does not show the glitches. Need to find out about video card and its capabilities on Monday.
Tom
08-12-2011 03:38 PM
Hi Tom. I get the same behavior. Running LV2010 and W7 64bit. Looks to me like a bug: the earlier points should not be changing value (and could not have been 0 anyway). If I plot the same data using a waveform chart then it's fine. I also tried redrawing the XY graph every 50th iteration and that was fine. Surely you don't need to updating the graph at this rate?
08-12-2011 11:16 PM - edited 08-12-2011 11:40 PM
I agree this seems like a real bug (now reported here).
You can open the front panel of the express VI and inspect the code. Code looks fine. Maybe there is a problem with the constant dynamic to waveform conversion/coercion?
There are a couple of things I would have programmed differently* (inside the inner subVI of the build xy graph express VI provided by NI), but even changing these points does not make the problem disappear.
*footnote (suggested code improvements for the xy graph express VI):
Overall, using the xy graph express VI is a nightmare in terms of memory reallocations. Internally, it constantly converts between dynamic and waveform data, growing inner arrays inside complicated data structures. While I question the need to grow arrays forever in general (it will never end well!) or trying to display millions of points on a graph that is less than 1000 pixels wide (what is the point!), you can avoid the observed problem by getting rid of the express VI entirely and just use a simple shift register. (See attached). It is also significantly faster overall.
Curiously, replacing the timed loop with a plain while loop also seems to fix the original problem in the original VI. Can anyone verify this?
08-13-2011 11:43 AM
@altenbach wrote:
Curiously, replacing the timed loop with a plain while loop also seems to fix the original problem in the original VI. Can anyone verify this?
I can confirm that.
08-17-2011 10:01 AM
I am converting all my XY-Graph express vi to while loop and shift registers for each of the data channels separately (6 of them). So far all seems to work well. Next to try a production program. I will post results after Labor Day - going on vacation.
Tom