I have run loops at 1000 Hz where the output at T+1 is some function of the input at T. However:
1... This was under LabVIEW RealTime, not Windows. I don't know if Windows Vista or XP is any better, but Windows 2000/NT used to happily steal 300 mSec from you to switch windows, or listen to the network, or do something in it's own little world.
2... I didn't use the on-demand VIs. There's a lot of setup involved there, I imagine. Set up the acquisition to be continuous. Then simply wait for one sample to be available. When it is, process it, produce the output, and go wait for the next one. This lets the hardware clock control your timing.
3... In my case (PID Loop), CONSISTENCY of output timing was way more important than quickness. So I tied the output and input clocks together (via software) and told the DAQ output to only update the pins when the clock ticks. That way, I didn't have to sweat over the determinism in my processing code. The output is exactly 1 clock behind the input; no more, no less, regardless of the code path.
Carolyn Murphy, Culverson Software, custom DAQ solutions
www.culverson.com |