LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loads the CPU and takes the performace graph to 100%

I am facing performance issue with this particular VL, the moment the .exe file is loaded it loads the CPU and takes the performace graph to 100%...
At the first look, please let me what majorily could be the issue? doubting the dummy while loop, after the mesage box sequence frame we had introduced the time delay and it did help us.

 

 

Krithika
0 Kudos
Message 1 of 8
(2,796 Views)

@Kriti wrote:

doubting the dummy while loop,


Guess again. Greedy Loop

 

 

EDIT: Forgot to add this: All those local variables! Oh, the humanity!

Message 2 of 8
(2,793 Views)

Hi Kriti,

 

maybe you should put some timing in those little **bleep** CPU-hogging loops?

 

Edit:

Ok, there are at least two words, that trigger that **bleep** filter Smiley Wink They are "**bleep**" and "**bleep**" Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(2,791 Views)

yeah, smercurio_fc... the greedy while loop!! in the 2nd while loop, i hav introduced a 100ms delay and this did help in saving CPU.. all before introducing the 1st while loop with a dialog box....

GerdW - Please elaborate that for me, I hav no clue of wat to do further to make this fit for installation... Smiley Sad 

Krithika
0 Kudos
Message 4 of 8
(2,774 Views)

One suggestion on your code. I can see you are updating values to different graphs instead why don't you keep a single graph and depending on the selection of the Tab ( In this case you can use Enum) and update the value to the graph depending on the selection this would save space and avoid unnecessary update of plots ( Since you are viewing one plot at a time)

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 8
(2,766 Views)

Hi Anand,

 

Thank you for that suggestion on graphs, I did think abt using a single graph... but it was user requirement to have them seperate.. 😞

 

now my current problem is wen the VI .exe starts it loads the CPU and consumes 100%...pls can u suggest ways of working tat out..

Krithika
0 Kudos
Message 6 of 8
(2,740 Views)

Some comments that would help to clean up your code.

 

You don't need to initialize the same arrays full of zeroes multiple times to initialize the shift registers.  You can initialize the array once, then branch it to initialize the shift registers.

 

For the control # of samples to average, you broke that up into 5 branches outside of your loop.  As a result, you have multiple tunnels at several structure borders, and are carrying multiple wires throught those structures.  Since that control never changes once the loop starts, just feed it into the loop and inner structures with a single wire, then branch it only where necessary inside.  It would eliminate a whole lot of clutter.

 

You have some formula nodes back to back where the result of one is immediately turned around and becomes the input of another.  You can put multiple lines in a single formula node which would allow you to merge the two formulas into a single node.

0 Kudos
Message 7 of 8
(2,735 Views)

Also, timed while loops aren't really intended for desktop operating systems.  They are meant for real-time operating systems.  I'd suggest replacing it with a regular while loop.

0 Kudos
Message 8 of 8
(2,729 Views)