01-14-2008 08:06 PM
01-15-2008 12:39 AM
You will take data at 5 Hz, then every few minutes you will switch to 0.5MHz...
To keep taking data at 5 Hz you will select the data you need from the 500.000 samples/sec that you take.
01-15-2008 07:10 AM
Well, it depends. (Doesn't it always?) In addition to the earlier suggestion which implied stopping, reconfiguring, and restarting the task, here are a couple ideas for gathering continuous data:
1. Always sample at 500 kHz. Most of the time, use decimation (without averaging) to retain only 5 Hz of info (1 out of 100k samples), but every 3 min you can retain all the data for some desired # of samples. If you do this, I would aim to accumulate enough data that I was only servicing the DAQmx Read call about 1-5 times a second during the slow sampling times.
2. Use an onboard counter to generate a continuous pulsetrain at 5 Hz which the AI task uses as its sample clock. Every 3 min, change the pulse specs on the fly to be 500 kHz. This will automatically change the AI sample rate. Drawback: can't control exact # of pulses generated at 500 kHz. AI task won't have built-in knowledge about change in sample rate. There *is* a way to track this stuff with the other onboard counter, but it starts to get complicated compared with the earlier options.
(Note: since your slow sampling periods only require 5 Hz, you may be fine with the simpler implementation of stop/reconfig/restart. Just presenting some alternatives for consideration.)
-Kevin P.
01-15-2008 10:26 AM