LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time Amplitude Adjustment in VI

Solved!
Go to solution

Hello,

 

I have designed the attached VI to ramp up a sinusoidal signal and hold the last value for a specified duration. It works well, but I've encountered an issue: once the signal reaches its final constant amplitude, I want to change this amplitude in real time. Currently, when I modify the amplitude in the "Ramp End" VI, the change occurs with a delay that corresponds to the ramp duration.

 

For instance, if the ramp-up takes 20 seconds, it takes 20 seconds for the amplitude change to take effect; if the ramp-up is just 1 second, the delay is only 1 second.

 

I suspect this delay might be due to the program pre-calculating the ramp first, or perhaps the data is stuck and waits until the ramp finishes. I'm not entirely sure. Any thoughts or suggestions on how to tackle this issue would be very welcome.

 

Thank you!

0 Kudos
Message 1 of 9
(343 Views)

You attached a CTL, not a VI.

0 Kudos
Message 2 of 9
(336 Views)

The Sound and Vibration Toolkit supports a generation API that provides a lot of flexibility when configuring a sinusoidal test signal. For instance, this example ships with SVT:
examples\Sound and Vibration\Generation\Dynamic Generation (DAQmx).vi

dsbNI_0-1727460763724.png

I did replace the graph in the example with a chart to show the history of the amplitude during operation:

1. Ramp up

2. Steady state amplitude = 1.0

3. Ramp up to new amplitude = 1.789

4. Steady state amplitude = 1.789

5. Stop --> Ramp down to zero.


Here is the signal output by another example:

examples\Sound and Vibration\Audio Measurements\Amplitude Swept THD (DAQmx).vi

dsbNI_1-1727461826275.png

 

---

 

If you want a long ramp up followed up by no ramp changes, you could implement something like:
LongRampUp_QuickChanges.png

which produces output like:

dsbNI_0-1727464111803.png

 

Doug
NI Sound and Vibration
0 Kudos
Message 3 of 9
(282 Views)

@Danny0806 wrote:

I have designed the attached VI to ramp up a sinusoidal signal and hold the last value for a specified duration. It works well, but I've encountered an issue: once the signal reaches its final constant amplitude, I want to change this amplitude in real time. Currently, when I modify the amplitude in the "Ramp End" VI, the change occurs with a delay that corresponds to the ramp duration.


You still have not attached your code. You also have not explained the meaning of your terms, such as "real time". (which typically has a very special meaning here) Do you want to adjust the amplitude manually via a control on the front panel once your state machine has reached that state? (That is just a simple multiplication with a scalar, right?)

 

If you have long delays, it just means that your code is not implemented correctly. We cannot tell what's wrong without seeing your code!

 

(I also seriously question your decision to create a control that is just the OK button. What's wrong with the one found in the palette?)

0 Kudos
Message 4 of 9
(273 Views)

I want to ramp up a sinusoidal waveform and then hold the last value of the amplitude as long as I want. I have achieved this in the attached VI. However, I now want to be able to change the value of the amplitude once the sinusoidal reaches the constant stage. This VI does that, but it takes several seconds to perform the action ( more than 20). I want to update the amplitude as quick as possible. This is what I mean by real time. Apologies for any confusion

0 Kudos
Message 5 of 9
(256 Views)

Many Thanks I will check it!

0 Kudos
Message 6 of 9
(255 Views)

Dear Doug, 

 

Would you mind sending the VI corresponding to this capture please: 

Danny0806_0-1727473387736.png

 

0 Kudos
Message 7 of 9
(238 Views)
Solution
Accepted by Danny0806

Saved attached VI for LabVIEW 2019:

Doug
NI Sound and Vibration
0 Kudos
Message 8 of 9
(190 Views)

Thanks a lot , that helped me to understand it so much

0 Kudos
Message 9 of 9
(172 Views)