LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does this consume a 100% CPU power

One of the biggest mistakes that we can make when using a While Loop is not using a timer such that it excutes by consuming a 100% CPU speed.

 

I have built an elaborate VI that saves and reads from a *.cfg file every time the loop iterates i.e 500ms using File Config. Is this a bad designing architechture, is it consuming a 100% CPU speed as well or does the timer take of it.

 

The reason why I am asking is because the following error message is being given every 1-2 days.

 


Error 6 occurred at Open/Create/Replace File in NI_LVConfig.lvlib:Save Config File.vi->NI_LVConfig.lvlib:Close Config Data.vi->write settings.vi:5->LP3000+.vi

 

Possible reason(s):

 

LabVIEW:  Generic file I/O error.

 

C:\LP3000+\stop watches\ ljlogud.cfg


 

Thanks in advance. Advise is a always much appreciated.

 

mhaque

0 Kudos
Message 1 of 4
(2,810 Views)

That error does not appear to be a result of using all of your CPU.

In fact, with a 500 ms delay, I don't think you would be using 100% of your CPU to simply write to a cfg file.


This error message leads me to believe there is a file issue, such as the file has not been properly closed, or it is read-only, etc

Cory K
Message 2 of 4
(2,808 Views)

I agree with Cory. If you attached your code we might be able to help you better.

---------------------------------
[will work for kudos]
0 Kudos
Message 3 of 4
(2,795 Views)

mhaque,

 

I agree with the others that this is probably not an issue of CPU usage. But I would like to know if you are actually suffering from high CPU during the problem. If you are, please explain what you're using to see it and how that data is recorded. Here's my reasoning:

 

The error 6 could arise from not closing the file properly or it could arise from issues such as the hard disk being full. I am wondering if you have some memory spikes going on, which would cause paging and high cpu. Is there any known activity such as an outside process happening at the time you're getting these errors?

0 Kudos
Message 4 of 4
(2,776 Views)