LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramped waveform generation daqmx

Hello all,

I am trying to generate a finite voltage waveform 500ms long with my USB 6221.  I'd like to be able to ramp the amplitude of the waveform up from zero over a few cycles to the full amplitude and then also do the reverse at the end of the waveform.  Is this feasible? 

Thanks in advance,

Sam

0 Kudos
Message 1 of 3
(2,806 Views)
Yes.  You could work with the Y array of your original waveform.  Make another array that is a ramp from 0 to 1, holds for so many samples, then ramps from 1 to 0.  The key will be creating an array that has the same total number of samples, and the transitions from ramp to flat, back to ramp will occur at the indices you want.  Multiply that array by the original waveform array.  Bundle to the new Y array back into the waveform.
0 Kudos
Message 2 of 3
(2,805 Views)

I guess I should have stated that I will be making waveforms with frequencies up to about 30kHz.  So far I have been just loading a few cycles into the buffer, and repeatin the generation for a fixed number of samples.  With frequencies this high, if I write the entire waveform to the buffer I run into space issues.  I guess what I'd need to do is write the increasing cycles into the buffer, then as those are generating write the full amplitude cycles for to the buffer, and repeat until just under 500ms, at which point I'd write the decreasing ramp to the buffer.  Can I write new samples to the buffer while generating?  And if so is there any issue with dropping samples?

 

Thanks,

Sam

0 Kudos
Message 3 of 3
(2,789 Views)