LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the system resources LV is using.

I am currently using LV8.6 to monitor the input on a TCP connection, monitor input from a user and send any input over the connection, and operate on any received data.  These are three main functions occuring in parallell and each contained within their own while loop.  I am using multiple local variables and many nested case statements.  The problem I am running in to is that my VI is using almost 100% of my microprocessor.  I have almost completed my code and I will try to reorganize my setup to make it more efficient but my question is if there is a way to monitor the system resources that the VI is using while it is running.  Any help on monitoring the system or advice on how to reorganize from my general description would be greatly appreciated.
0 Kudos
Message 1 of 4
(3,398 Views)

This usually happens when you have a loop with no wait, because then it tries to run as fast as possible. Usually, TCP reads and event structures have some delay built in, so if I had to guess, I would guess it was the TCP writing loop. The easiest solution is to add a simple wait command to each loop, even of 0 or 1 ms.

 

As for a more general answer, if you have the professional version of LabVIEW, you should have some profiling tools in the Tools menu. You can also do debugging by placing case structures around pieces of your code and disabling and enabling them while monitoring your CPU usage. When it drops, you can usually assume you've disabled the culprit and investigate further.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,391 Views)

Hi 5thGen,

 

You can get a snap shot of the VI's memory and performance usage by using the Performance and Memory window. You can find this window in Tools->Profile->Performance and Memory. There are also two other tools there which may be useful to you when evaluating your VIs performance. 

 

Hope this helps,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(3,375 Views)
Excellent.  Thank you for both of those replies.  I haven't tried it out yet but I know the absence of delays is causing the problem.  I will also look into the resource monitoring options.  Thank you for your help.
0 Kudos
Message 4 of 4
(3,356 Views)