Digital I/O

Showing results for 
Search instead for 
Did you mean: 

How do I obtain a continual uninterrupted stream of data with a PCI-DIO-32HS digital i/o card?

Hi all,

I'm trying to monitor two signals at a 100 kSample/s rate (10 us/sample). I am using Visual C++ and NI-DAQ, and have set up the card for double-buffered digital input. I am reading the buffer directly, i.e., using DIG_Block_Check to return the number of samples remaining and transferrring from the buffer passed to DIG_Block_In, rather than using DIG_Block_Transfer. The data stream is being written to the hard drive. When I run this, however, Every buffer has several glitches in the data. For example, if I am monitoring a pulse that is 30 us long, the data I collect would lead me to believe that it was actually twice as long. Please help!
0 Kudos
Message 1 of 2
I would recomend using the DIdoubleBufPatternGen.C examples that ships with NI-DAQ. You can find it in your \NI-DAQ\Examples\VisualC\Di folder. If you don't have this example on your machine, you can get it by running NI-DAQ Setup and selecting support for C/C++.
This example does double buffering to allow you to continuously acquire data from your card. Data is transfered only when a full 1/2 buffer is ready. You can set how long to acquire data by setting the number of half buffers to read, or by modifying the read loop conditional parameters to fit you needs. See the NI-DAQ help on how to set you REQ pulse rate to 100kS/s.

Nick W.
0 Kudos
Message 2 of 2