05-23-2012 07:08 AM
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.
05-23-2012 07:12 AM - edited 05-23-2012 07:17 AM
@Kriti wrote:
doubting the dummy while loop,
Guess again. Greedy Loop
EDIT: Forgot to add this: All those local variables! Oh, the humanity!
05-23-2012 07:16 AM - edited 05-23-2012 07:19 AM
05-23-2012 07:43 AM
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...
05-23-2012 08:43 AM
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)
05-23-2012 11:31 PM
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..
05-23-2012 11:44 PM - edited 05-23-2012 11:50 PM
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.
05-23-2012 11:58 PM
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.