03-19-2009 03:59 PM
Hello,
I need to create an application (Platform: Windows XP, Programming in C++ in the .NET environment) where my card (PXI-6259) will continuously output an AO waveform from a buffer. The tricky thing is, I need to modify the buffer while the waveform generation is taking place*.( I.e. I want to update half of the buffer that the card is not using). I used to do this with the traditional NIDAQ drivers using double buffering. However, try as I may, I could not figure out how to do this with DAQmx. Any suggestion how I can do this?
Cheers,
Chammika
*In case anyone is wondering, my waveform has too many points to load in one go....
03-20-2009 02:09 AM
I am a LabVIEW programmer, so I could help you from a LabVIEW perspective. I believe you are looking for the Regeneration Mode property Node. Try to search for an example in C++ that explains non-regeneration. I have attached a LabVIEW block diagram from which you can replicate the API and try to run in your C++ application.
In the attached example, the application continuously outputs a waveform using an internal sample clock. The automatic regeneration of data has been disabled using the property node, so new data has to be provided throughout the duration of the continuous Analog Output operation. This allows the generation of any arbitrary frequency as this VI computes new data for each iteration of the loop, maintaining phase continuity of the signal.
Do Not Allow Regernation - Do not allow NI-DAQmx to regenerate samples the device previously generated. When you choose this value, NI-DAQmx waits for you to write more samples to the buffer or until the timeout expires.
Let us know if you have any questions.
03-20-2009 02:25 AM
Hello AdnanZ,
Thank you for your quick response to my query... I did not know about this 'regeneration mode' that you mention. I will look for more information on it for C++ programming. Thanks heaps for the information and the block diagram. Will keep this thread updated with my progress...
Cheers & have a good weekend,
Chammika