What is the best way to acquire repetitive sets of data at precisely spaced time intervals? I'm running LabVIEW 6i on Windows NT.
For example, I want to acquire say 500 scans at my top scan rate, process them, and then repeat this process every 10 msec. (I have to make configuration changes to my system during the dead time.) I need these data points taken at well controlled time intervals so I can make a meaningful waveform out of the data later.
Here's what I've tried:
1. Using a pulse train to trigger the AI Start function. When a triggered AI Start is included inside a While loop it uses all of the system resources watching for the trigger. No good. If I put in any kind of delay inside
the loop, then NT can take away priority and not give it back until the trigger event has passed.
2. Using a pulse train to gate the DAQ scan clock. Here I set the data acquisition for continuous acquire, but then turn the scan clock off during the dead time. So the system should only be taking data when the gate signal is high. My problem here is I don't know how to configure the AI Read function properly. Specifically, I don't know how to set the number of scans to read. If I calculate how many data points should be available and use that number, I'll often leave a data point or two in the buffer due to timing/rounding errors. If I set the number of points to read higher than the number I should have acquired, I get unpredictable behavior. Sometimes I read exactly the number of points I expect, sometimes 10 more, sometimes thousands more as it waits through multiple cycles to acquire more points.
I'm sure there is a better way. Any suggestions?
Thanks!
Craig