Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

API explantation

Hello,
Its there a documents which explains in detail about the API used in VC++. The explanation in NIDAQ help is not that sufficient.
0 Kudos
Message 1 of 3
(2,552 Views)
Hello,
for example if you see the example code of double buffer handshake in vc++, there are two buffers defined
pibuffer and pihalfbuffer. i didnot follow how does API DIG_DB_TRANSFER transfer data from pibuffer to pihalfbuffer without mentioning about which half of pibuffer is written to pihalfbuffer.
0 Kudos
Message 2 of 3
(2,552 Views)
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
0 Kudos
Message 3 of 3
(2,552 Views)