LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Sine Generation with Instantaneous Adaption - Memory Overflow

Hello all

 

I want to develop a LabVIEW script that outputs a sine and whose amplitude can be changed while running without big delays. The frequency of the sine wave is 10Hz. Currently I am using the example "Voltage (non-regeneration) - Continuous Output.vi" where I can generate a single waveform that is 0.1s long. I added a 100ms wait function to the while loop to pause before running the next sine. Like this I can ensure that the while loop does not write to many sine profile into the buffer and I am able to adapt the amplitude without much delay. However, including a static wait function means that the buffer can run a little behind since the wait time is not exactly the same as the buffer time. Since I want to run the VI for a long time and possibly include a feedback loop, this inaccuracy is not ideal. If I increase or decrease the wait time in the while loop I get a memory underflow or overflow error. 

 

Ideally I want to append a new adapted sine wave to the previous one, right before the buffer is finished. How can this be done? I suspect that the buffer time needs to be linked to the wait time of the while loop.  

 

Some keyfigures:

Used example: Voltage (non-regeneration) - Continuous Output.vi

Labview: 2020
NImax Device Driver: 20.7

Chassis: NI cDAQ-9189

IO Module: NI 9269

Thank you in advance

Download All
0 Kudos
Message 1 of 2
(450 Views)

@RomyS wrote:

 

Ideally I want to append a new adapted sine wave to the previous one, right before the buffer is finished. How can this be done?


I'm tempted to say "Not easily!".  If you want to change (just) the amplitude of the waveform, you could do that by using one D/A channel to generate the waveform and a second one to drive an amplifier's Gain control to set the Amplitude (if this signal is also a (lower frequency, offset) sinusoid, you'd have FM (Frequency Modulation).  Similarly, if you wanted to adjust the mean of the waveform, use the second D/A to generate the offset voltage and use a summing circuit to add the sinusoid and the "bias" signal.

 

Almost anything else (it seems to me) almost requires point-by-point processing of the output waveform.  Faulty Programming Gets Annoying! (abbreviated FPGA).

 

I apologize for the bad Pun.

 

Bob Schor

 

 

0 Kudos
Message 2 of 2
(391 Views)