06-04-2012 12:26 PM
Hi everyone,
Does anyone know on the block diagrams, in the function palette, if there is such an operator that adds a previous data value to the present data value?
For example, if you were to get a value of 5 as a value before and then you get a value of 3. How would I be able to loop it where it keeps adding the previous data to the present data? So the total would be 8 and then if it were to loop again then 8 would be added onto the upcoming solution. Thanks!
06-04-2012 12:27 PM
And this could loop for an unspecified amount of time....depending on the loop. Thanks!
06-04-2012 12:42 PM
Would it be possible to use a Compound Arithmetic to add this somehow? The problem is that the input is a string function....
06-04-2012 12:42 PM
Add a shift register to your loop. Place your value in it. Then wire your new value to it inside the loop. The next iteration will have the last value that was wired to it.
06-04-2012 12:59 PM
Thanks Mark! I'll give that a try. Appreciate the help!
06-04-2012 01:47 PM
@JonRod wrote:
The problem is that the input is a string function....
You cannot "add" strings, you need to scan them into a numeric value first. Then use a feedback node as suggested.