LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Labwindows CVI 6.0: Application goes to sleep during RS232 Communications

I have an application implemented in LabWindows CVI that is communicating with a temperature controller via RS232. The app tells the controller to go to a temperature. Then the app goes into a while loop constantly checking the temperature of the controller to see if it has reached the temperature it told it to go to. The problem is that sometimes the application seems to go to sleep. All I have to do is come up and move the mouse and the program becomes responsive again and checks the controller and reachs the temperature. I don't have to click so I don't think it's a focus problem. And the application has to still be in the while loop because once you move the mouse everything comes back and
works. Is this something to do with either NT or my computer, or is it a labwindows problem?
Thanks in advance.
0 Kudos
Message 1 of 4
(3,211 Views)
No, LabWindows/CVI has a sleep policy that you can set. The sleep policy effects how fast the program runs when getting no interaction from the OS or user. This keeps inactive programs from hogging the CPU. Use the SetSleepPolicy function to set CVI to "Do Not Sleep" and it should fix your problem.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(3,211 Views)
Chris,
Under further investigation, this is what is happpening. When the mouse pointer enters the menu bar the application stops processing the loop where I am polling the controller via RS232. But when the mouse pointer leaves the context of the menu bar, it starts processing the logic in my loop again. Do you know what causes this?
Thanks,
Paul
0 Kudos
Message 3 of 4
(3,211 Views)
No idea just from the symptom. I haven't seen behavior like this before. Probably the quickest way for us to help you with this would be to create an example that illustrates the problem (you should be able to take out the serial communication) and send it to our support engineers at http://www.ni.com/ask. If we can reproduce the problem, we should be able to tell you why it is happening and how to avoid it.

Chris
0 Kudos
Message 4 of 4
(3,211 Views)