03-31-2023 10:57 AM
Hello! I've written a program in which I can dynamically change the amplitude of the sum of waves. My problem now is that I want to be able to press the stop button and have the variable 'amplitude' decrement to less than .01 and then stop the run. My problem right now is that I need the amplitude variable to be inside the while loop in order to make it dynamically change the amplitude of the waves, but when I press the stop button the variable only decrements once, then remembers it's value from before that decrement and gets caught in an infinite loop. I've tried many things to solve this problem like shift registers and different kind of case and event structures to solve this. Can anyone help me out? Attached is my VI.
Solved! Go to Solution.
03-31-2023 12:13 PM
@RazorF wrote:
My problem now is that I want to be able to press the stop button and have the variable 'amplitude' decrement to less than .01 and then stop the run.
That's a control. LabVIEW does not really have "variables". Place the value in a shift register and keep decrementing until the desired stop condition is reached. (As a cheap hack, you could even write the decremented value to a local variable of the amplitude control, but then you need to set it again before the next run.)