09-26-2024 12:55 PM
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!
Solved! Go to Solution.
09-26-2024 01:11 PM
You attached a CTL, not a VI.
09-27-2024 02:08 PM
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
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
---
If you want a long ramp up followed up by no ramp changes, you could implement something like:
which produces output like:
09-27-2024 02:37 PM - edited 09-27-2024 02:39 PM
@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?)
09-27-2024 03:09 PM
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
09-27-2024 03:10 PM
Many Thanks I will check it!
09-27-2024 04:43 PM
Dear Doug,
Would you mind sending the VI corresponding to this capture please:
09-28-2024 01:36 PM
Saved attached VI for LabVIEW 2019:
09-29-2024 01:33 PM
Thanks a lot , that helped me to understand it so much