05-30-2006 06:52 AM - edited 05-30-2006 06:52 AM
Message Edited by Ganga on 05-30-2006 06:56 AM
05-31-2006 04:24 PM
Hello Raja,
Are you using hardware-timed analog output such as the shipping example found at \Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage\Cont Gen Volt Wfm-Int Clk? This is the best way to generate such a waveform.
In order to avoid glitching when changing amplitude and phase, you should set your analog output operation to not allow regeneration using the function DAQmxSetWriteRegenMode. You will need to continually put waveform data in the buffer but you will have complete control as to when the phase and amplitude changes and you will not have any glitching problems.
Regards,
Laura
06-01-2006 09:07 AM
06-02-2006 01:19 PM
Hello Raja,
No, there aren't any shipping examples for this type of operation for Visual Studio.
Currently, you fill up the buffer using DAQmxWrite before you start the task. To use the non-regeneration mode, you will need to call DAQmxWrite during the generation to keep adding data to the buffer. For example, if you have a 1000 sample buffer and your update rate of the output is 500 samples/sec, then every 2 seconds your buffer will be empty. You will need to time the DAQmxWrite calls such that your buffer is never completely empty, or you will get a buffer underflow error. You can choose whatever size of buffer you need. You will probably want to take your current 40 sample array and duplicate it to make a larger array to write each time you call the DAQmxWrite function, so you do not have to call it so often.
If you try to use the onboard memory instead of the PC buffer, the buffer cannot be updated once you start the task, so this is not a good option for you.
Regards,
Laura