LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Accurate timing problem...

I need for an accurate task of about 100ms (for a serial ask) . I use a timer tick event but after some seconds - about 100 sec- the rate increases till to 150-160ms. I try also with a different thread but the problem remains the same.Have someone an idea to resolve the problem?Thanks in advance
0 Kudos
Message 1 of 4
(2,948 Views)
Because Windows uses a pre-emptive scheduler there is no software solution available to produce exact timing you're looking for. This is because when the event occurs the thread waiting for the event may not have access to the CPU and may be waiting for the OS to schedule the thread for processor time. So the event will be seen sometime after the event occurs. Maybe right after the event occurs and maybe hundreds of milli-seconds later.

Sorry,
Steve
0 Kudos
Message 2 of 4
(2,948 Views)
I suggest you use an Asynchronous Timer (the function panel is at CVI\toolslib\toolbox\asynctmr.fp).

These timers use the Windows multimedia timer mechanism, and are generally more reliable than timer control ticks.
--
Martin
Certified CVI Developer
0 Kudos
Message 3 of 4
(2,948 Views)
I try your advice but the result is about the same
0 Kudos
Message 4 of 4
(2,948 Views)