LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer in panel consumes whole memory

Hello.

I have a timer on a panel. As I set up the tick time lower, say 0.010 sec, it consumes the whole memory untill my labtop is suddenly shut down from CPU overheat.

From some tests, I realized it doesn't when the timer is set 1.0 sec or higher.
Is this normal behavior of timer? Does it related to the tick time setting?

P.S. I use the timer for manual data socket update.

Thanks.
YK.
0 Kudos
Message 1 of 5
(3,583 Views)
Hello YK,

The maximum resolution of the timer is going to be dependent on your operating system. So, which OS are you using and which version CVI? The behavior you are seeing with the timer is definitely not to be expected. Having said that, have you been able to reproduce this behavior on another machine with the same setup (OS, version of CVI, etc)?

Thanks
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 5
(3,559 Views)
Hello YK,

Some followup information about the timer behavior is that when timer controls are present, the CPU usage does ramp up, and it does so in proportion to the specified interval. When the timer control is discarded, the CPU usage goes back to normal since we no longer need to monitor whether a timer needs to fire an event. A key thing to note is that we still yield processor time to the OS at each iteration of our main loop, so a high CPU usage does not prevent any time-intensive process to get all the access it needs from the CPU. Basically, our CPU usage is only high when no one else needs it.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 3 of 5
(3,540 Views)
Hi.

That's what I thought, actually.
The harsher timing condition needs more memory on CPU usage.

As you mentioned, it does not harm other programs running. However, it physically heats up the CPU, especially in a laptop. I usually ended up with sudden death with overheated CPU. Now, I'm monitoring CPU usage with Windows Task Manager, when I need to work on the timer in a panel.

I'm glad you confirmed this.
And thanks for your reply.

YK.
0 Kudos
Message 4 of 5
(3,529 Views)
You can use asynchronous timers instead of the UI timer if CPU usage is becoming a problem for you. You can find examples for the async timer under .\CVI\samples\toolbox
Bilal Durrani
NI
0 Kudos
Message 5 of 5
(3,508 Views)