LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Color Transparency Strobe is bogging down my computer's CPU

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 12
(5,085 Views)

You should convert to U8 before the loop. There is no need to do the inner calculations in I32 with coercions.

Message Edited by altenbach on 08-19-2009 08:48 AM
0 Kudos
Message 2 of 12
(5,078 Views)

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

0 Kudos
Message 3 of 12
(5,061 Views)

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...

Message 4 of 12
(5,060 Views)
Solution
Accepted by topic author CINC.Cal

CINC.Cal wrote:

...suggestions to get the flashing rect and the circle graphic on the same floorplan...


Here's a very quick draft.

Message 5 of 12
(5,047 Views)

Oh dang......That works very well.....you rock.

 

 

 

I'm going to spend some time figuring out what you did 🙂

 

 

 

Thanks!

 

 

-Cal

Message 6 of 12
(5,046 Views)

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

Greets, Dave
Message 7 of 12
(5,042 Views)

Dave, Cal has LabVIEW 8.5 and won't be able to open your LabVIEW 2009 VI.

Message 8 of 12
(5,018 Views)

Ups,

sorry for that. Although I think you don't need it anymore, cause of Altenbach's very good suggestion ... here it is Smiley Very Happy

 

greets, Dave

 

P.S. @altenbach: do you check every posted VI on its version? Or do you have something automatic?

Greets, Dave
Message 9 of 12
(4,976 Views)

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.

 

Message 10 of 12
(4,964 Views)