LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Flushing of all channel buffer in M series DAQ card

Hi,
 
I am using NI M series multifunction card.
I want to flush the buffer of all the analog I/O and digital I/O...Is there any function to do this..I am using LabWindows Version 8
 
Thanks in advance
Gajanan Prabhu
 
 
0 Kudos
Message 1 of 4
(3,955 Views)
Hi Gajanan,

There are a few buffers that are configured during DAQ tasks. One is located on your PC's memory and one is the FIFO on your DAQ board. The PC buffer is the buffer that we configure programtically in each of the tasks and is dependent on the sampling rate and number of samples to read.

Many times users want to clear the onboard FIFO because after a task is cleared the card is still outputing the last value given to it. This is because the user hasn't told it to change the card's output to something else but rather just told the task to stop. The card will hold this output unless otherwise told.

If this is the case, simply write a value before clearing the task to set the output to what you wish. There is no function that simply flushes the memory of the FIFO but you can overwrite the buffer (which DAQmx does automatically if you stop or pause and then start a task) with new data. Please refer to this forum post with some more information about this programming technique.

I hope this helps,


Message Edited by Patrick_Ba on 02-11-2008 06:43 PM
PBear
NI RF
0 Kudos
Message 2 of 4
(3,933 Views)
Hi Patrick,
 
Thanks for your replay...
Are you sure DAQmxStopTask() function will flush the FIFO buffer?
Is there any way to flush the PC buffer?
 
Regards
Gajanan
0 Kudos
Message 3 of 4
(3,928 Views)
Hi Gajanan,

If you are worried about returning old data from the FIFO, stopping the task will prevent you from retrieving that data again. It doesn't 'flush' the FIFO but subsequent acquisitions do overwrite the FIFO.

As far as the PC buffer goes, if you are only interested in the most recent data, you can change the read point of the buffer using the DAQmx_Read_RelativeTo command. This command and information about it and other commands can be found in the LabWindows CVI help file and also refer to the NI-DAQmx ANSI C Reference Help accessed via the Start Menu in the National Instruments/NI-DAQmx program folder.
PBear
NI RF
0 Kudos
Message 4 of 4
(3,906 Views)