08-19-2009 10:28 AM
Good Afternoon,
I recently programmed an interactive floorplan that generates a transparent flashing color on top of an imported png file. The flashing indicator looks great and is exactly what I need but I have come across a few problems. I referenced the "colour and transparent boolean" thread to help me with this program.
When I run the program the CPU usage on my computer goes up to around 97 percent. After messing around with the loop timing and some of the color gradient options, I can get the CPU usage down to around 40-50% but the end result doesn't look nearly as good as before. Also, I plan to have multiple rooms flashing simultaneously in the future and just a single room indicator is causing this problem.
It is my goal to have the program run while using up at the most 15-20% of the CPU. Is this possible?
Does anyone have any suggestions for helping the program run without hogging all the CPU?
I will post my program because I know that helps 🙂
(Also, if anyone has any suggestions to get the flashing rect and the circle graphic on the same floorplan, that would be much appreciated)
Thanks much,
Cal
Solved! Go to Solution.
08-19-2009 10:46 AM - edited 08-19-2009 10:48 AM
You should convert to U8 before the loop. There is no need to do the inner calculations in I32 with coercions.
08-19-2009 11:21 AM
Can you please be more specific?
Should I convert my iteration block output to U8 to help get rid of all the coercion points? Would it be benefitial to convert the constants inside the for statement into U8 as well? When I did all this, there was little to no change in the CPU usage.
Thanks for the help,
Cal
08-19-2009 11:22 AM
CINC.Cal wrote:It is my goal to have the program run while using up at the most 15-20% of the CPU. Is this possible?
Try something like this...
08-19-2009 11:32 AM
CINC.Cal wrote:...suggestions to get the flashing rect and the circle graphic on the same floorplan...
Here's a very quick draft.
08-19-2009 11:32 AM
Oh dang......That works very well.....you rock.
I'm going to spend some time figuring out what you did 🙂
Thanks!
-Cal
08-19-2009 11:33 AM
Hello Cal,
I altered the program so the strobe and circle is shown in the same picture indicator.
I put the picture indicator into a Diagram Disable Structure, to compare the CPU- load when the picture is calculated & updated or only calculated. You can see the difference in CPU- load yourself, this will be unavoidable. You can try to use the Fill Rectangle VI to speed up things.
If you want to flash several regions then this would only affect the calculation, but not updating the indicator, since the picture is replaced in a whole every loop iteration.
Greets, Dave
08-19-2009 11:56 AM
Dave, Cal has LabVIEW 8.5 and won't be able to open your LabVIEW 2009 VI.
08-20-2009 09:39 AM
Ups,
sorry for that. Although I think you don't need it anymore, cause of Altenbach's very good suggestion ... here it is
greets, Dave
P.S. @altenbach: do you check every posted VI on its version? Or do you have something automatic?
08-20-2009 11:16 AM
daveTW wrote:P.S. @altenbach: do you check every posted VI on its version? Or do you have something automatic?
Nothing automatic. I typically look at the unsaved changes in VI properties to see what the original version was.