LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to synchronize switching times VERY precisely

I have a VI that switches between two voltage states and resides in one state or another according to a wait function. I need this switching to be extremely precise. For example, if I want the first voltage state to be held for 200ms, it MUST be as close to that as possible. How can I figure out how precise the switching in my VI is?

Thanks, I really appreciate your help.
Kelly
0 Kudos
Message 1 of 4
(2,653 Views)
Hello Kelly!

Essentially, it sounds like you are wondering how accurate the wait functions in LabVIEW are. The timing accuracy of a Windows-based computer is typically 1ms, so at first glance the answer to your question is approximately +/- 1ms. There are several things that can affect the timing of a VI, however, such as other applications taking processor priority and other functions inside your VI taking longer than the wait time specified. In general, if you are needing accurate timing, take all of your other operations 'out of the equation' (i.e. remove them from the loop if possible).

A lot of the time, very accurate timing can be done at the hardware level. Depending on which hardware you are using, you may have the ability to use an onboard clock
to control your analog output. This is known as 'Waveform Generation.'
See the NI Developer Zone tutorial on Waveform Generation for more information about hardware timing.
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 2 of 4
(2,653 Views)
Is there something I could implement into my VI that could show how long it is taking to switch between the two states with the wait function? I will attach my VI if that helps.
0 Kudos
Message 3 of 4
(2,653 Views)
The Windoze technical info states that they do not guarantee timing better than 100ms with the system clock. You're right, that generally it's much better than that, but I have seen pauses in my VIs that vary up to 25ms (using a take time before the loop and then check time after the loop). My old Windoze 98 machine varied by as much as 75ms. Yes, NT and XP are better for timing, but there are still no promises. If it's really critical, use hardware (like you said).

Rob
0 Kudos
Message 4 of 4
(2,653 Views)