I want to make a simulation of numbers incremented and decremented up until a certain point. Let's say I start with a constant of 10. I want to increment this 10 until it reaches 50. When it reaches 50, I want to decrement this until it reaches back to 10. And from there, it goes up again to 50, and so on.
I am new on LabVIEW, and by looking at some examples, I can make the incrementation part. However I can only stop the simulation when it reaches 50, and that's not I want.
Can anybody help me with this?
Solved! Go to Solution.
Make another shift register to hold a Boolean value. When the value is TRUE, you should increment. When it is FLASE, you decrement. Use a case structure to decide which code to run (increment vs decrement). When you are incrementing and the value reaches the upper limit, set the Boolean to FALSE. When decrementing and the value reaches the lower limit, set the Boolean to TRUE. It will keep going back and forth. Make your loop stop with a stop button.