LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I increment a variable at the end of a loop to run it through the loop again?

I'm new to LabVIEW programming and I'm trying to write a small program that just receives a lower and upper limit, and whether the user wants to increment or decrement the number. I can't figure out how to increment the number after the simple calculations have been done and to run through the loop again with the incremented number. Right now I'm using a while loop inside of a case structure where true decrements and false increments.
0 Kudos
Message 1 of 6
(8,188 Views)
Right click on the left or right edge of the loop, and select "add shift register". The shift register transfers data from one iteration of the loop to the next.
Message 2 of 6
(8,188 Views)
Add (or subtract) the iteration value and your number. If you want to increment or decrement by more than one you can multiply the iteration value and then add or subtract.
0 Kudos
Message 3 of 6
(8,188 Views)

but what about if I want to make increments of 0.1 or less ?? .. Labview doesn't let me make a multiplication of the iteration by a fraction like 0.1 0.2 or 2.3 ... somebody can explain me how ?

Thanks ..

0 Kudos
Message 4 of 6
(7,928 Views)

Alvaro_Ortiz wrote:

but what about if I want to make increments of 0.1 or less ?? .. Labview doesn't let me make a multiplication of the iteration by a fraction like 0.1 0.2 or 2.3 ... somebody can explain me how ?


Simply multiply [i] with 0.1, for example. It will let you, if you do it right!

 

I would use the shift register approach, simply add your fractional increment at each iteration. If you still have problems, please show us your code.

0 Kudos
Message 5 of 6
(7,923 Views)

Here are a few possibilities.

 

Message Edited by altenbach on 12-05-2008 03:25 PM
Message 6 of 6
(7,919 Views)