Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

need clarification on DOUBLE BUFFERING

I am doing a double buffered analog acquisition on 3 channels. ( PCI 6052E, NI-DAQ, VC++ 6.0). I am using the DAQ_DB_Tranfer to move the data from the main buffer to an alternate one. The problem i am having is that the 'daq_stopped' value is always 0(implies the acqusition is still in progress) and never sets to 1. I have a loop which uses 'daq_stopped', which never finds 'daq_stopped' set to 1 and thus runs infinitely. shouldn't 'daq_stopped' be set to '1' after the required number of points (set as 'count' in SCAN_Start) are obtained?

thanks,
vikram
0 Kudos
Message 1 of 3
(2,803 Views)
Hi Vik, if you are doing double buffering (i.e., you've called DAQ_DB_Config to enable it), and you are not using a stop trigger, then the acquisition will always be continuous, regardless of the count passed into SCAN_Start. Thus, the daqStopped parameter will never return as 1 for DAQ_DB_HalfReady in this situation. The documentation for DAQ_DB_HalfReady doesn't mention this tidbit, but there's a better explanation in the docs for the daqStopped parameter of DAQ_DB_Transfer.

In your case, what you should probably do is just keep your own count of acquired samples, and call DAQ_Clear() when you've acquired enough.

Good luck,
Joe
Message 2 of 3
(2,798 Views)
Joe,

thanks!!! i thought i was doing something wrong.

vikram
0 Kudos
Message 3 of 3
(2,791 Views)