Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Amplitude of Continous Analog Output on fly for NI 6229

 I am using  NI PCI 6229 Card.
 
 
 
i am generating Analog output voltage (Triangle WaveForm)from Card and feeding in to  MicroController for simulation of microcontroller behaviour.
 
To Test MicroController  properly i should be able to change the Amplitude and Phase Shift of the waveform on the fly with out
disturbing the current  generation of waveform. i.e if i am changing the amplitude form 3 to 5 v, unitl  change takes place card
should generate at 3v. there should not be any distortion. i should be able to change the phase shift in the same manner.
 
moreover transition time should be as less as possible.
 
i am using ANSI C API .  so that i could integrate this other Test Scripts.
 
 
can any one give some suggestions in this regard..
 
Raja
 

Message Edited by Ganga on 05-30-2006 06:56 AM

0 Kudos
Message 1 of 4
(4,313 Views)

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

0 Kudos
Message 2 of 4
(4,295 Views)
Hai Laura
 
Thank u for u r suggestions. but i am having some doubts how to put data in to buffer Continously  while NI Cards generate
waveform? i don't see any such type of  example in Examples Folder ?
 
i am quite confused how the sequence will go?
 
actually i have put triangular waveforms samples in a array .i.e 40 elements.
 
first i write these values using DAQmxWriteAnalogF64 function.
 
and then i start the task so analog output waveform generates. In regeneration mode this works fine.
 
but in non regeneration mode what should be the size of data array?how can we put data in to the array continously once task is started?
 
how writing and generating waveformi is synchronized? i,.e my main confusion?
 
more over do u have any idea how onboard FIFO's can be selected  instead of PC Buffer?
 
can u give any suggestion in this regard?
 
 
0 Kudos
Message 3 of 4
(4,286 Views)

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

0 Kudos
Message 4 of 4
(4,271 Views)