For my academic research I bought a Measurement Computing PCI-DAS4020/12 digitizer card. Strangely, the card does not come with a utility to capture analog data continuously and stream it to a file. So I wrote a C program that does continuous acquisition. The program basically acts like an audio recording program, and the digitizer is just an expensive sound card.

It is a usable program but it really could use some improvements. For example, it currently doesn't check to make sure that it is keeping up with the data that is coming in from the digitizer card. Anyway, it is good starting point.

It does not do double buffering. It is not clear to me that double buffering helps in this situation. I just use a big DMA buffer area and write directly from the DMA buffer to the file. If anyone has anything intelligent to say about why double buffering is or isn't the right thing to do in this situation, please write me.