When you call the DAQ_Start() function you pass a reference to the buffer you will be using. Because you are performing a double-buffered operation the buffer will fill half-way and then you will transfer this data to a secondard buffer (piHalfBuffer). The original circular buffer will continue filling and when the second half is full you will again transfer the data out. Since the buffer is circular this process continues.
The DAQ_DB_Transfer() call accepts a reference to the half-buffer (piHalfBuffer) and will transfer data from the buffer configured in DAQ_Start. Since DAQ_DB_Transfer() is only called after DAQ_DB_HalfReady() returns true, you know that half of the buffer is full and you need to transfer it.
Since the buffer is circular you are al
ways transfering half of the buffer. The first call will return the first half, the second call will return the last half, the third call will return the first half, etc.
Regards,
Justin Britten
Applications Engineer
National Instruments