LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Accurate delay times using standard CVI without any DAQ cards

Is it possible by using Windows NT or 95 and LabWindows/CVI 5.5 to get accurate delay times?
Currently we are developing a protocol simulator which uses the RS232 serial port to send and receive messages. However, when introducing a delay time between two messages, it is automatically multiplied with a certain factor...
We were thinking of changing the thread priorities to real-time (WinNT), which improves the accurary a bit but this does not alter the delay-factor...
Any suggestions to solve this problem with "standard" Labwindows/CVI?

regards Tom
0 Kudos
Message 1 of 5
(3,007 Views)
What do you mean by accurate? The Windows system timer is only 1 msec resolution so any hope of accuracy below that resolution is a lost cause in Windows with software timing. Windows OS's are poorly designed for precise timing. You can get accuracy down to about 1-2ms with good programming, but that's the absolute best that could be done. Also, the Windows serial driver isn't designed to have rapid, precise timing in its communication either.

What accuracy are you trying to reach?

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 5
(3,007 Views)
Well Chris,
when specifiying a delay of 30 milliseconds between 2 consecutive serial write, oscilloscope shows around 25 to 100 (!!) msec delays instead of 30 +/- 2 msecs!

regards Tom
0 Kudos
Message 3 of 5
(3,007 Views)
How are you doing your delay? That kind of a variation would NOT just be related to software timing accuracy. Are you trying to use the Delay() function for timing?

Chris
0 Kudos
Message 4 of 5
(3,007 Views)
You may use the LARGE INTEGER library to retrieve the
processor counting in a memory map way. In that way you
can issue delays in a very good (less than 100 us) resolution.
0 Kudos
Message 5 of 5
(3,007 Views)