03-24-2006 04:54 PM
03-24-2006 07:51 PM
I see two things for you to think about.
If you add one point at a time to an array using build array, it will go slower and slower. It takes time to allocate more space for the array, and one point at a time is the worst way to do it. A better way is to allocate a large array at the beginning and replace one point at a time. This will speed things up quite a bit.
Another is that you can use a shift register to store the picture itself. Use a blank picture going into the loop, and add each point inside the loop. You can display the picture after you add each point or at the end.
Bruce
03-27-2006 01:25 PM
Bruce is correct in his theory. Every time you add to the array LabVIEW has to create a new memory space for the new array. This will drastically slow down the performance of your program. If you follow his suggestion and Initilze and array of the maxium size you wish, then LabVIEW will only need to interact with that one memory space, greatly improving the performance of the program.
Tyler H.
03-28-2006 01:03 PM
Thank you for your responses. Since the array size will vary greatly in size, I think
the best route for me is to store the picture and update with a shift register. This
is where I am having problems again. I attached a screen shot of what I have so far.
I have added the shift registers and I have the empy picture wired to the subVI shown.
The SubVI formats the picture and displays it. The empty picure from the main VI is linked
to the Draw Unflattened Pixmap function's empty picture sink. When I run this VI, the picture
updates, but does not keep the previous points on the picture. Any ideas?
Thanks again,
Kate
03-29-2006 12:23 PM - edited 03-29-2006 12:23 PM
Hello,
Thank you for posting to the NI discussion forums! Sorry I am joining this conversation a little late, but I am unclear about exactly what is going on. What do you mean by “the picture updates, but does not keep the previous points on the picture”? The picture of your sub-VI doesn’t appear to match the call in your main VI either (for example, what happens to all of those double numbers going to the picture sub VI?). I think what you want to plot a picture, and update some specified points with random colors. To do this, first draw the picture like you mention, pass your 2-D array around with a shift register and use the “replace array subset” to change the points you are interested in, and redraw the picture. The attached VI (for LV8) plots a picture of random pixel colors, and replaces the point you specify with the color you specify. Hopefully this helps provide you with a good start for programming your application!
Message Edited by Travis M. on 03-29-2006 12:24 PM
03-30-2006 09:43 AM
03-31-2006 02:32 PM
04-04-2006 01:39 PM