LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

reliable timer

I want to use 10 ms timer to send message with a card, but
when i click a button of user interface, the period of 10 ms is not constant. How can i resolve this problem

Thanks for your answers
0 Kudos
Message 1 of 2
(3,052 Views)
It depends on what you mean by reliable. Precise, very accurate timing is only achieved with hardware timing. If you mean just ~10ms, and you are missing some of the events, then you could look at using an asynchronous timer. The normal timer control uses regular messaging and user interface activity or long callback functions can cause you to miss some of the timer events.

With the asynchronous timer, the timer events are processed in another thread which prevents the user interface and other callbacks from causing missed events. As long as your timer callback code can execute easily and consistently in under 10 ms, you should not miss events with the asynchronous timer.

You can see an example of the async timer under \cvi\samples\toolbox\asy
ncdem.prj.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 2
(3,052 Views)