Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Clear Analog Output Memory

Hello,

 

I have a PXI-6733 Analog Waveform Output card and a VI that allows a user to dynamically select a function type/parameters that they want to output through the card. If the user selects a waveform type, which writes it to the analog output buffer (using the standard DAQmx write block) and decides that they would rather have another waveform, they are unable to write another function to the analog output buffer. Two problems have stemmed from this. The first being that the second output waveform was being concatenated in the buffer. This led to no errors and a gave the user a false sense that their waveform output was only the second waveform chosen. The second problem, after I added a output buffer size property node which was based on the waveform size written, an error occurred stating that the system could not write the waveform because the size writing is too large since it isn't clearing the buffer.

 

To make a long story short, is there a way to clear the analog output memory of something that has been written to it before without having to output that signal? So far the only way that I could tell to clear the output memory was to actually output the signal. I did see a property node which allows you to change the write position and thought about trying to set the position to 0 prior to writing the data and specifying the output data buffer size. I wanted to get the forums thoughts on my approach before implementation.

 

A preemptive thank you for you assistance.

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

Hi,

 

In order to clear the output buffer for your card, you would need to call the DAQmx Clear Task vi for that task each time you want it cleared.  It may seem inefficient to clear/recreate tasks when switching to another waveform, but that's probably the best way to go about it with the DAQmx API.

0 Kudos
Message 2 of 2
(2,756 Views)