12-22-2016 01:36 PM
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?
Solved! Go to Solution.
12-22-2016 01:12 PM
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?
12-22-2016 02:47 PM
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?
12-22-2016 04:20 PM
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
12-22-2016 04:40 PM
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.
12-22-2016 04:51 PM
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.
12-27-2016 10:00 AM
Hello,
I see that this is a duplicate forum post, where the original can be found HERE.
Best,
Shamik C
Applications Engineer
National Instruments
12-28-2016 02:49 AM
12-28-2016 09:44 AM
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 😮
12-29-2016 01:20 AM - edited 12-29-2016 01:21 AM
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.)