03-22-2006 01:57 AM
03-22-2006 10:24 AM
03-22-2006 07:25 PM
03-23-2006 03:59 PM
03-23-2006 04:03 PM
03-23-2006 11:43 PM
03-24-2006 03:46 PM
03-27-2006 12:29 AM
Hi, Alan, My problem is: This following acquistion loop takes too much time.
do
{
uStatus = theSTC_0->AI_Status_1.readRegister();
if (!((uStatus & 0x1000) == 0x1000))
{
uValue[i] = board_0->AIFifoData.readRegister();
// if(NBit==12) uValue[i]=uValue[i] & 0x0FFF;
i++;
}
} while(i<3);
No matter how to set the values of SI and SI2 , it takes at least almost 80 us for sampling only 3 channels.
but PCI-6025E is rated for a speed of 200KHz. Can I aspect for a time of 30 us or so for the last loop? How to set SI and SI2 ?
03-27-2006 12:31 AM
03-27-2006 02:44 PM
Ok, hopefully I can clarify some things here. SI, or scan interval, allows you to set the sample rate. SI2 allows you to set the convert clock rate. The convert clock is what controlls the switching of the ADC between different analog input channels. The max rate of the convert clock for your board is 200kHz. The max sample rate (or scan interval) is dependent on the number of channels in your scan list. If you have three channels, then the max sample rate for your device is 200kHz/3, or about 67kHz. Another important thing to mention is that the number you write to the SI and SI2 registers is the timebase divisor. This number is calculated with this formula: timebase divisor = timebase/rate. The timebase for all E Series is 20MHz. So if you want to set the convert clock rate at 200k, then you need to set the timebase divisor to 100.
Also, because you are really loading a counter here, you need to subtract one from the actual number you want to set.
So, I believe you want to write 299 to SI and 99 to SI2.
Now, having said all that. These settings will ensure that three samples will be acquired at 200Hz. This does not mean that your loop will execute at 3*(1/200k). There are other factors to mention here. First, anything you do in the loop will take time. You are doing two register reads in every iteration. Really, at that point, everythign is system dependent. It will depend on how long will it take your system to perform a register read. So I really can't tell you what to expect as far as how fast your loop will execute.
Hope this helps.
-Alan A.