Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take remained data in "double-buffer" after continuous DAQ acquisition was stopped.

Dear all

I have some question to developping application software using "NI-DAQ E series" board.
Please consider in following case,
. Developping an application software using Microsoft-VC6.0 with NI-DAQ 6.9.3 driver.
. Using Double-Buffering mode.
. Continuous DAQ operation start by "DAQ_Start" command.
. Analog data sampling operation is controlled by "Digital-Clock-Gating".
. While continuous DAQ operation is running, application software check DAQ
acquisition buffer status by "DAQ_DB_HALFREADY" and get acqusition data using
"DAQ_DB_TRANSFER" command.
. Continuous DAQ operation is stoped by software like "DAQ_Clear" command issue.
"DAQ_Cle
ar" commad may issue in any timing, dose not consider "Buffer-HalfReady" status.

Question1:
Could somebody tell me, how to take the remained data in last "HalfBuffer" after
DAQ operation is stopped.

Question2:
And is something method to stop continuous DAQ operation exists instead "DAQ_Clear" command ?
It is failer when tried to take remained data in last "HalfBuffer" using "DAQ_Monitor" command.
Because "DAQ_Clear" seems clear all current DAQ operation parameter with aborting DAQ operation.

Best Regards

Yamada
0 Kudos
Message 1 of 2
(2,600 Views)
Hi T.,

Unfortunately, there is no way to acquire the complete buffer during an asynchronous clear of the DAQ board. Also, the DAQ clear is the only way to stop a continuous acquisition.

The best thing for you to do is acquire your data and when you want to end your program, delay the DAQ Clear command until you receive the next buffer of data. That way you have acquired the buffer and are stopping (clearing) during the next buffer cycle which you don't care about anyway.

For example, suppose you have acquired 5 buffers of data and you want to send the clear command (through a button or callback function etc.). Using the old code, it would miss the remainder of the 6th buffer. However, when you choose to stop your program, you can set a flag that your
clear function monitors. It waits until you receive 1 more buffer of data at which point your acquisition function resets the flag and your clear function will clear the next buffer (7th buffer). Therefore you got all the points you were looking for.

Anyway, hope that workaround helps.

Ron
0 Kudos
Message 2 of 2
(2,600 Views)