LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ High CPU Use

Solved!
Go to solution

Hi,

 

I am trying to diagnose high CPU use on cDAQ 9132 running Linux RT.  I have double and tripple checked all while loops have delays.  I have even gone as far as disabling all code in my application except for a onle while loop with nothing in it but a 250ms wait.  Even then I see average 80 and 90% CPU average use on both cores (around 175% total).  Using MAX to watch CPU use.  I get "Waiting for target" error messages sometimes too.

 

I set my app as dont run on startup and rebooted the controller so it was just sitting there doing nothing.  CPU use was around 40 and 0%.  So not too bad.  That is just to keep Linux, the network connection and the GUI running.

 

I put a disable diagram structure around everything in my front VI and add a while loop with 100ms delay and run it.  CPU use is up around the 150-160% total mark, just to do nothing!

 

I then created a blank VI with just a 100ms while loop and ran it.  approx 47% total CPU use so not much different from doing nothing.

 

So I removed all the controls and indicators off my VI (even though all code that could ever update them was disabled).  And my CPU utilisation went down to around 50% total.  I copied and pasted all the controls and indicators to the blank VI (still no code in it but the while loop).  CPU utilisation stayed at around 50%.  So didn't change much.

 

So it seems all the controls and indicators are gobbling up the CPU but only when in my main VI, even with no code! Any ideas?

 

0 Kudos
Message 1 of 18
(4,167 Views)

Hi,

 

I am trying to diagnose high CPU use on cDAQ 9132 running Linux RT.  I have double and tripple checked all while loops have delays.  I have even gone as far as disabling all code in my application except for a onle while loop with nothing in it but a 250ms wait.  Even then I see average 70 and 80% CPU average use on both cores (arounf 150% total).  Using MAX to watch CPU use.

 

I set my app as dont run on startup and rebooted the controller so it was just sitting there doing nothing.  CPU use was around 40 and 0%.  So not too bad.  That is just to keep Linux, the network connection and the GUI running.

 

I put a disable diagram structure around everything in my front VI and add a while loop with 100ms delay and run it.  CPU use is up around the 150-160% total mark, just to do nothing!

 

I then created a blank VI with just a 100ms while loop and ran it.  approx 47% total CPU use so not much different from doing nothing.

 

So I removed all the controls and indicators off my VI (even though all code that could ever update them was disabled).  And my CPU utilisation went down to around 50% total.  I copied and pasted all the controls and indicators to the blank VI (still no code in it but the while loop).  CPU utilisation stayed at around 50%.  So didn't change much.

 

So it seems all the controls and indicators are gobbling up the CPU but only when in my main VI, even with no code! Any ideas?

0 Kudos
Message 2 of 18
(4,093 Views)
Solution
Accepted by ashesman1

For nomenclature, 80% on one core and 90% on another is 85% CPU usage, not 170%. 

 

Beyond that, I'd want to see what happens if you use a different troubleshooting style.  Rather than disabling things, create a new project.  With the new project, create a VI that has a while loop containing the following:

 

500 constant wired into wait (ms)

An add accepting two controls (not constants) as inputs and having an indicator output.

 

Do you see the same behavior with this project?  If not, something else in your project is causing higher usage.  If so, try formatting the cDAQ.  Then, run the project again.  Do we still see the higher usage?

0 Kudos
Message 3 of 18
(4,142 Views)

Hi,

 

I have tried adding controls and indicators to a blank VI with a simple while loop with a wait as I mentioned.  Infact I added all my controls and indicators from my main project (about 80) and it did not slow things down at all.  If the cDAQ runs OK CPU use when not running any code and when running my blank VI + controls example then should a reformat help?

 

Regards

 

Ashley

 

0 Kudos
Message 4 of 18
(4,128 Views)

If the example project runs fine, the reformat is less likely to be beneficial.  It doesn't hurt the cDAQ so you're welcome to try.

 

You'll want to take a look at what else you have in your original project.  Something in there is causing more usage than you're expecting.  You mentioned trying to disable things in that project.  Let's try the opposite.  Start adding things slowly into the example project.  Watch the CPU usage.  You should see when it spikes.  At that point, you know which part of your application is causing the problem.  From there, you can start to troubleshoot to determine why.

0 Kudos
Message 5 of 18
(4,112 Views)

I can disable my entire code and still get high CPU use.  So, the main VI does nothing but run a single while loop and CPU use was still high.  I assume disabling all the code will actually prevent any of the sub vis running?  It is all called from the main VI and everything is in a disable diagram structure.

0 Kudos
Message 6 of 18
(4,107 Views)

Hello,

 

I see that this is a duplicate forum post, where the original can be found HERE.

 

Best,

 

Shamik C

Applications Engineer

National Instruments

0 Kudos
Message 7 of 18
(4,027 Views)

Hi Shamik,

 

instead of marking as double post I tend to move a single new message into the related post… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 18
(4,011 Views)

It's also a bit less helpful to cite this as a double post and link to the original with a link that brings us back to the same thread 😮

Message 9 of 18
(3,992 Views)

Hi natasftw,

 

ShamWOW had replied in the former "double post" thread and his message got moved into this thread too. That's why the link points into this thread (now) for no reason…

(As long as there are only one or two messages in a double thread I rather like to join the threads. When there are more/reasonable answers in both threads links between them are ok IMHO.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 18
(3,956 Views)