Re: New buffer reading behaviour in continuous acquisition mode?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 28 January 2003 02:01 pm, Herman Bruyninckx wrote:
> We are using Comedi for analog input with a NI 6024E card, and want to
> get the following acquisition mode:
>  - continuous acquisition at a fixed frequency (1000Hz in our case)
>  - trigger an interrupt each 6 samples (this number "6" must be
>    programmable)
>  - the interrupt writes the 6 samples from the hardware buffer to the
>    Comedi buffer, _overwriting_ everything that still happens to be in
>    that buffer.
> So, what we want to achieve is to always have the six most recent
> samples in the software buffer, always at the same place, _and_ the
> hardware buffer has to be emptied as soon as the 6th sample has been
> reached. (And not when the buffer is half full or so...)
>
> We are having a problem with Comedi to do this, because the currently
> offered functionality is somewhere in between the semantics we need:

I don't see that any change in comedi's api is necessary.  All you need is 
for end of scan events to be fixed in the driver.  Your callback function can 
get woken up at the end of every scan, and decide to do something when there 
are 6 samples available.  It can also trivially copy the 6 samples wherever 
you want them.  Or, if you are working from user space instead of kcomedilib 
you would use the TRIG_WAKE_EOS flag.

- -- 
Frank

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+NxXv5vihyNWuA4URAmPBAKCheUur3zfY2OyaqxCv/yhEG8qi/gCfeBPf
kXowIGTUE50F1xC5QnE6mJw=
=cTzZ
-----END PGP SIGNATURE-----

Received on 2003-01-28Z23:44:47