LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing a signal from a double buffer

Hi, I have been working on a project here at
Vtech.  We
have been given a LabWindows/CVI code for DAQ card which implements the
double
buffer.  We have implemented this code with our existing program, but there
is
one issue that needs to be resolved.  For example, when we run our program
it
generates sine waves of different frequencies, which are then outputed to
the
channel using the double buffer.  If the program is run again the
frequencies
are normally generated to the channel with one exception however - the last

frequency from the previous run remains in the channel and is outputted
 together with the frequencies of the current run.  Is there a way to clear
the
channel after each run, so that when the program is run the next time, no
signal from the previous run remains in the channel?

Thanks for your help.

Branislav.

ps.  I have attached the original code for the double buffer provided to us
and
the modified double buffer code that was merged with our program.  One
notable
difference with the modified code is that the loop that recreated buffers
was
omitted [(while ((stopao1 == 0) && (iStatus == 0))].  Instead, the whole
start1
function (renamed to DoubleBuffer) is called within a loop from another
file,
which provides parameters such as amplitude, phase, frequency and so on.

Message Edited by Branislav on 05-09-2005 12:02 PM

0 Kudos
Message 1 of 2
(2,885 Views)


@Branislav wrote:
Hi, I have been working on a project here at
Vtech. We
have been given a LabWindows/CVI code for DAQ card which implements the
double
buffer. We have implemented this code with our existing program, but there
is
one issue that needs to be resolved. For example, when we run our program
it
generates sine waves of different frequencies, which are then outputed to
the
channel using the double buffer. If the program is run again the
frequencies
are normally generated to the channel with one exception however - the last

frequency from the previous run remains in the channel and is outputted
together with the frequencies of the current run. Is there a way to clear
the
channel after each run, so that when the program is run the next time, no
signal from the previous run remains in the channel?

Thanks for your help.

Branislav.

ps. I have attached the original code for the double buffer provided to us
and
the modified double buffer code that was merged with our program. One
notable
difference with the modified code is that the loop that recreated buffers
was
omitted [(while ((stopao1 == 0) && (iStatus == 0))]. Instead, the whole
start1
function (renamed to DoubleBuffer) is called within a loop from another
file,
which provides parameters such as amplitude, phase, frequency and so on.

Message Edited by Branislav on 05-09-2005 12:02 PM



I had a very quick look to the src code. I no longer have the legacy DAQ API on my PC and it is hard for me to remember the "old way" of working with this API... One or 2 ideas however :

1 - are you sure you use the very last version on the lagacy DAQ API.
2 - did you try to use the InitDABrds function call before the second run ? I suspect this function re-initialize the board (electronic stand point) but alos release the internal buffer used by NI-DAQ. I know this is quite brutal but at least this could give you other ideas
3 - Did you look around in the DAQ API for any low level buffer management function. Sorry, I can't remember any of them...

This may not be enough... I hope this help somehow.
Regards, Philippe proud to be using LabWindows since version 1.2
// --------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 2
(2,862 Views)