- From: Herman Bruyninckx <Herman.Bruyninckx_at_mech.kuleuven.ac.be>
- Date: Tue, 28 Jan 2003 21:01:56 +0100 (CET)
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: - the acquisition can be made continuous, but then we cannot specify _when_ the hardware buffer is emptied, or indicate that the Comedi buffer should be overwritten. - the acquisition can generate an interrupt after a specified number of scans, but then the acquisition as a whole stops. What should we do? To make a proposition about an extension of the Comedi API? This could as be "simple" as extending the TRIG_COUNT and TRIG_NONE defines used for the stop_src variable in a command, and the values for the stop_arg, with a new define that indicates the desired behaviour. (Maybe through the "universal" TRIG_OTHER define?) Or as "complex" as extending the command semantics, adding an extra functionality between start_src/start_arg en stop_src/stop_arg, e.g., a buffer_acquisition/buffer_arg pair. The first one would indicate whether one wants to read the hardware buffer after a given number of scans, and the latter gives that number of scans. Of course, this "complex" extension requires all drivers to be adapted... Herman PS We have already succesfully extended the ni_mio_common.c driver, so there is no problem from that side. The problem is with the Comedi API. -- K.U.Leuven, Mechanical Engineering, Robotics Research Group <http://people.mech.kuleuven.ac.be/~bruyninc> Tel: +32 16 322480
Received on 2003-01-28Z20:01:56