LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update picture slows down

Hi
 
I am trying to make a little robot that can draw a 2D map of the suroundings. (It uses a rotating distance sensor, like af radar)
 
I whant to use the picture-control, to draw in the information, so i can get a printable picture out. I have already created a "picture-radarbeam" that reprecents one meassurement in the picture, and it works just fine.
 
So, the problem is then i try to put the picture in a while-loop and i want the program to sketch the measurements all the time (I mean updating the picture canstantly). Short after it starts, its slows down dramaticly (It seams like it reamember all the preavues sketches, and sketch them all every time the picture updates.). I tried to solve the problem by write the pictue to a image-file, and then load it again to a picture-string, but that is also a very slow solution.
 
Any sugestions?
 
Best reguard
Steffen Rasmussen - Danish Univerity of Science
------------------------------
LabVIEW 2009 and 2011 user, with LabVIEW toolkit for Lego Mindstorms NXT.
0 Kudos
Message 1 of 17
(1,637 Views)
Are you using a shift register in the loop to constantly add to the same picture, or are you creating a new picture every iteration through the loop? If you're using a shift register, it will continue to build on the same picture and it will get huge. Could you post an example of how you're creating the picture?
0 Kudos
Message 2 of 17
(1,629 Views)

I am using a shift-register as below:

i have by the way put in the "line tool", just to show you that the sub_vi is drawing lines.

------------------------------
LabVIEW 2009 and 2011 user, with LabVIEW toolkit for Lego Mindstorms NXT.
0 Kudos
Message 3 of 17
(1,624 Views)

Right, so if that while loop keeps running, the picture will grow without bounds and slow the program down considerably.

If that sub vi draws an entire picture, then you don't need to feed it the previous picture. It will create the whole thing from scratch each time and output it to the picture indicator. Try disconnecting the picture input and getting rid of the shift register.

Edit: Also, I would put a wait in there so that this isn't using the entire cpu. A 50 ms wait would give you 20 frames per second.

Message Edited by Marc A on 03-02-2007 11:43 AM

0 Kudos
Message 4 of 17
(1,618 Views)
Could you attach the code instead?
 
Is the picture indicator set to "erase first?"

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 5 of 17
(1,614 Views)
Even if the indicator is set to "erase first", the shift register will continue to hold the old picture and add to it every iteration. If every iteration creates a new picture, there shouldn't even be a shift register storing the old one.
0 Kudos
Message 6 of 17
(1,609 Views)
Yes, the right way would be to NOT use a shift register and uncheck "erase first?"
 
This should work well assuming that all parts of the image are being overdrawn with new data as a new data arrives. That's why I wanted to see the code. 🙂

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 7 of 17
(1,605 Views)

Thanks for so quick replay.
I tried to do on plug the shift-registers, buth then et only plot the last measurements, and do not the preauveus.

So the goal is to update the picture with new measurements on top of the preauvius., and not only plot with the last measurement.

------------------------------
LabVIEW 2009 and 2011 user, with LabVIEW toolkit for Lego Mindstorms NXT.
0 Kudos
Message 8 of 17
(1,605 Views)


Neffer wrote:
So the goal is to update the picture with new measurements on top of the preauvius., and not only plot with the last measurement.

Yes, right-click on your picture indicator and uncheck "erase first?" No shift register!


LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 9 of 17
(1,603 Views)

Ohh my god. So much trouble for suchs a little failure. I haven't seen the little "erase first".

Thank you so much all of you for so fast help.

Smiley Happy

Have a nice day! 

------------------------------
LabVIEW 2009 and 2011 user, with LabVIEW toolkit for Lego Mindstorms NXT.
0 Kudos
Message 10 of 17
(1,599 Views)