05-19-2015 12:09 PM
Hei
Anybody know how to do, on loop or while loop.., I need that constant or control number 300 would b subtract for constant number.., but I mean for example 300-2=298-2=296-2 and so on,subtract of the last value.
Thanks
Solved! Go to Solution.
05-19-2015 12:11 PM
Read up on Shift Registers and For Loops and you should be able to get there.
05-19-2015 12:20 PM
I have checked, but dont understand... may help?
05-19-2015 12:26 PM
Read the help on shift registers again. Take some tutorials.
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
Shift registers take a value at the end of one loop iteration, and return it to the beginning of the next loop iteration.
05-19-2015 12:30 PM
Can you explain which part you don't understand?
There is an example in the LabVIEW help that does exactly what you want except with addition and multiplication.
Look in the LabVIEW help for Shift Registers: Passing Values between Loop Iterations.
05-19-2015 12:42 PM
Thanks., I dont understand that my number 300 should be subtract from line of shift register?
05-19-2015 12:49 PM
subtract 2 from that number. Put the result in the shift register. You start with 300 by intializing the shift register with that value.
05-19-2015 12:54 PM
I should do this?
05-19-2015 12:57 PM - edited 05-19-2015 12:57 PM
Almost.
Wire the constant 300 into the left hand shift register.
Then it is a question of how many times do you want the loop to run. Do you want it to run 300 times? (It would eventually get to -300.) Do you want to stop it at zero? Or something else?
And your subtracting is backwards. You said you wanted to subtract 2.
05-19-2015 01:04 PM
I did, but not get that every loop show the last value when it has been subtract from 2. I need run 300 times. Yes, stop at zero.