jonny e wrote:
> Thanks very much for the response.
> Do you know how repeated executions of the CIN and plotting data will
> effect max sampling rate? Obviously, it will decrease it, but do you
> have an intuition or experience by how much it will decrease?
It all depends on what you do with the returned data. Obviously if you
would display it in a chart, make some very involved data analysis,
write the data plus analysis results to disk and do 200 other things
every time you return from the CIN with yet another tiny bit of data you
will eventually slow down the system to the point that the intermediate
buffer has filled up before you return to get the next chuck of data
from the CIN.
> I'm not sure I can use the method you described above with sampling
> rates that are "high." Seems that if I'm busy saving/plotting data
> and repeatedly calling the CIN there would be samples I miss above a
> certain desired sampling rate. I'm sampling 16 channels at 25kHz,
> which is about 1/2 the max sampling rate possible using DMA.
> At any rate, I'll give it a shot and see what happens.
> cheers.
It depends on how the CIN and the underlying device driver are written.
If the CIN directly gets the data from the DAQ card the only buffer you
have is the FIFO. So in that case you might very soon have a problem. If
the CIN relies on a real device driver to transfer the data through DMA
or interrupt into an intermediate circular buffer this operation has
typically a much higher priority than your application level which is
displaying, calculating and whatever it does. The only problem then will
be if the intermediate circular buffer fills up before your application
gets around to get the next block of data. This is the mode NI-DAQ
typically uses and the maximum data acquisition rate is of course
dependant on the CPU speed and additional tasks you want to do but
typically is higher than if you would not use such an intermediate
circular buffer.
I have no idea how the Comedi CINs work in detail and if they do use
intermediate circular buffers on device driver level, often also refered
to as double buffered acquisition. If they do, it should be simple to
adapt the CIN to work as I have pointed out. Otherwise you won't be able
to do this very well without redesiging that part of Comedi.
Rolf Kalbermatter