Showing results for 
Search instead for 
Did you mean: 

Incrementation and Decrementation

Go to solution

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?



0 Kudos
Message 1 of 4

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.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
Accepted by topic author johan.sinaga
Message 3 of 4

Hello and thanks guys for the help! Appreciate it!

0 Kudos
Message 4 of 4