LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback function overrun with Asynchronous Timer

I wish to use the Asynchronous Timer to control the timing of data acquisition. What will happen if the callback function overruns the timer period? Will I miss timing periods, or is the next call stacked until the callback function returns? I have to make sporadic measurements at irregular multiples of 10ms, but the processing time may take more than 10ms. Will I lose timer ticks in this case?
0 Kudos
Message 1 of 4
(3,643 Views)
The Timer does not queue up the timer events. If it did, your program would eventually lock up or crash. If your callback takes longer to execute than the timer interval, then you will miss a timer event. You could use additional threads or PostDeferredCall to remedy the situation by doing your time intensive processing in another function (the thread function or the deferred callback).

Best Regards,

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

Hi Chris,

I read your reply message.

In my case, I have the similar problem.

The callback timer is stopped sometimes(for one or two days).

1. What will I check? Do you have any experience like this?

2. And, if I miss the timer event due to that my callback takes longer to execute than the timer interval, the next timer event is available or not for ever?

Best Regards,

Insik Kim

0 Kudos
Message 3 of 4
(3,500 Views)
Hello insik,

I'm not exactly sure what you are asking in your first question, but I would check out the comments on the following post: Wait for Timer Callback to Complete.

Hope that helps. Thanks

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 4
(3,474 Views)