02-21-2013 09:37 AM
Hello,
I have a VI that displays a video feed from an IMAQdx grab on the front panel as well as a picture control that has quite a large image. Every time the picture control redraws, once per second, the video being displayed on the front panel lags. The indicated frame rate stays at 30 fps, but what is shown is a frozen frame half of the time. I'm sure this has to do with the picture redraw, but it is barely utilizing the computer resources when this happens. Any tips or ideas?
Thanks in advance for the help,
dnorman
02-21-2013 02:03 PM
I'm guessing this is from the front panel update. When the front panel has to redraw the large image it can't update the video feed. Is there a way to update in parallel somehow. I've never used sub panels, do they allow for this? Or is my only option to run the two processes in seperate VI's on screen simultaneously?
02-22-2013 02:19 PM
Dnorman,
How large is the image? The frame rate reported is the frame rate being brought in by the camera, not necessarily the rate at which it is updating on the user interface. If you run these in separate VIs do they run properly? You may also try running both of these in parallel while loops in order to devote each while loop to its own core of the CPU. Are the images or indicators overlayed on your FP? What are your computer specs (RAM, processor, etc.)?
02-22-2013 02:23 PM
Did you uncheck the picture option "Erase First"? This should speed up the front panel redraw.
02-22-2013 02:44 PM
The image is made up of 9 tiles of about 2600 by 1500 pixels, but the entire image is never shown, only a portion. If they are run seperately there is still a lag when the picture control is redrawn. They are currently in seperate while loops. The picture control image is overlayed by an XY graph. The computer has a i7 that is only working at 10-12% when this is running and no core is over 25% on average. Same with the RAM, the computer has 8GB and is using less than half of that when the VI's are running. I've heard it doesn't matter for this, but the GPU is barely being used either.
02-22-2013 02:45 PM
Erase first is unchecked. Found that one out when I first started working on this, but thanks for the heads up.
02-22-2013 03:11 PM
9 tiles each sized about 2600 x 1500? Big stuff. Do you use "Draw Flatten Pixmap" to produce the image? If yes, how do you do it? Can you post a screenshot of the BD part that produces the picture from the images?
02-22-2013 04:04 PM
I'm not near the computer that this is on right now, but what I have used to get the picture is something along the lines of jpeg to flattened pixmap and then draw flattened pixmap, with the subsequent tiles setup in a cascade with their origin information altered and the previous flattened pixmap used as an input for the next draw flattened pixmap.
02-25-2013 08:58 AM
This is how I have it setup currently for the 9 tiles.
02-27-2013 02:15 PM
As long as you see that your CPU usage is about 12% I assume that all the "Draw Flatten Pixmap" operations run in the UI thread. You can mitigate the issue by moving that code to a subVI and run that in a different "Preferred Execution System", see the VI Properties.
You might also want to look at the Profiler that will tell you how much time is spent on the VI calls and identify further VIs that should better not run in the UI thread.