01-21-2009 11:44 AM - edited 01-21-2009 11:49 AM
01-21-2009 12:25 PM
First of all, you are NOT drawing a grayscale image, but you are drawing 40000 1x1 full color greyed-out rectangles, one at a time (!!). That is something entirely different!
There is no reason to update the image in the innermost loop. A better way to do things would be to build a 2D aray inside the loop and then draw it once as image. Here's a quick draft. See if it makes sense (takes a few ms). It would be even faster as a true 8bit greyscale image, of course.
01-21-2009 12:47 PM
Thanks!
Actually, I tried your solution before to compare the speed, and I got to know what happened to the first vi. But for my case, I can not resolve the problem like that, because I have to see every plots immediately when got it. I think stopping the former plots redrawn before the next plot drawn may be the right solution, but I do not know how to realize it. Could you please give more advice? Thanks!
01-21-2009 02:25 PM - edited 01-21-2009 02:26 PM
Labview86 wrote:But for my case, I can not resolve the problem like that, because I have to see every plots immediately when got it.
OK, you have some serious misconceptions here. You should not update the plot faster than you can actually look at it. You monitor refresh rate, and thus the screen update, is the limiting speed at which you can display things.
If you receive more data in that timeframe, you should update at a resonable interval. It makes absolutely no sense to force an update after each point, because that slows things down much more as you noticed.
If you want to see intermediary updates, build the image in a shift register and update e.g. after every row. See attached. As you can see, it is still significantly slower that drawing the entire thing at once. You need to find the right balance!
01-21-2009 02:57 PM
01-21-2009 03:20 PM
Good solution! Thanks!
I tried to update image line by line before, but your vi is much better than what I did. See attachment (this one was edited by Labview version 8.6). Maybe I can get some comment from you about the style. It seems that my vi is faster than yours, which confused me. Theoretically, yours should be much faster than mine because you update all the former lines and the next line at once, while I update line by line before drawing the next line.