LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computer freezes while LabVIEW is waiting

When my application is running and testing, the screensaver will appear and I can easily stop it.  When the application is running but it is not testing (the start button has not been pressed), and the screensaver appears, it takes more than five minutes to stop the screensaver.  I only have this problem when the application is up and not currently testing.
 
The application is one while loop checking if the Start button is true. This is when I have my problems.  Until it is true, nothing else should be going on inside the application.  When it is true, the application does its testing.  While this is going on, I do not have any problems, which is puzzling because thats when more resources are being used.  Not when it is looking at a single boolean button.
 
I am running this application on Windows XP and this computer should not be slow.  This is the only application running on this pc.  It is a 3.6 gHz pentium 4 with 2 gig of ram.
 
Thanks in advance for your help.
Ron Deavers, CLD
0 Kudos
Message 1 of 4
(2,724 Views)
You need to insert a Wait in the loop where your program is checking the boolean. Your fast computer is checking that boolean as fast as it can, and it is tying up all of your computer's resources. Give it something like 100-250ms between iterations of the loop, and you'll get fast response. It may not be obvious that adding Waits will make your computer more  responsive, but that's how it works.

Chris
0 Kudos
Message 2 of 4
(2,718 Views)
Inside your while loop, do you have a wait statement? Putting even a 0 msec wait will allow the OS to do other things and respond while the loop is doing the poll but you should be able to put a 100 or 200 msec wait because it's not really necessary to poll the user interface much more often. Also, instead of a while loop and case statement, use an event structure inside the loop. All you need is a single value change event for the start button.
0 Kudos
Message 3 of 4
(2,717 Views)

Thank you very much for the response.  I've had to fix similar problems the same way.  I'm suprised that I didnt think of it.

Thank you again.

Ron Deavers, CLD
0 Kudos
Message 4 of 4
(2,712 Views)