03-28-2022 06:59 AM
I want to add the data from array index 5 to 10. so I initialize the index from 5 and by using the for loop I am changing the index value and adding the data with previous data and it shows in sum. but problem when for loop is over the sum data is still adding with previous data history .Ii want to reset the sum after complete a for loop. same I want to substract the new sum data to previous sum data in the last section of this program. but the substract keep the previous history . How to solve it.
Solved! Go to Solution.
03-28-2022 07:20 AM
You can right-click on the Feedback Node and chose to "Move Initializer One Loop Out". This will allow you to reinitialize the values in the Feedback Node at the beginning of the loop.
03-28-2022 07:53 AM - edited 03-28-2022 08:25 AM
Thank you.
Ya, it is working for addition. now for the subtraction part, I want to subtract sum data which is present in sum with previous sum and it keep same result until the next sum data came.
03-28-2022 09:23 AM - edited 03-28-2022 09:24 AM
Looking at your comment, I conclude you do not even need the FOR loop. Just use Array Subset to get the array elements starting at your starting index and then use Add Array Elements to do the sum.
As far as your subtraction, I'm not completely sure what you are trying to do. But I think you are trying to find the difference in the sum between iterations of the loop. If that is the case, then you need to wire the sum to the input of the Feedback Node, not the subtraction result.
Additionally, you need a clean way to stop your loop instead of relying on the Abort button.

03-29-2022 12:31 AM
Thank you very much .
For loop is used to collect the data from the array.
How to synchronize the Part 1 means for loop to the outer part2 ,because the out part is little faster then part 1 . part 2 to is not able to subtract the data which is coming from the loop.
03-29-2022 12:39 AM
The nth value is coming and the (n-1)th value is subtracting with nth . then the indicator will show the subtract value. now the (n-1) value will update with nth value and again the new value will come in the nth place. and this will carry out for inf time. how to make this logic. please help me.
03-29-2022 06:31 AM
@SUMANSAURAV wrote:
The nth value is coming and the (n-1)th value is subtracting with nth . then the indicator will show the subtract value. now the (n-1) value will update with nth value and again the new value will come in the nth place. and this will carry out for inf time. how to make this logic. please help me.
The Feedback Node's output is your N-1 value.
03-29-2022 08:05 AM - edited 03-29-2022 08:07 AM
The feedback output value should be [ nth - (n-1)th ]. The (n-1)th term should update with nth term and the nth term will take the new data.
03-29-2022 08:29 AM
@SUMANSAURAV wrote:
The feedback output value should be [ nth - (n-1)th ]. The (n-1)th term should update with nth term and the nth term will take the new data.
No, the indicator should be [(nth - (n-1)th]. The Feedback Node is to hold the (n-1)th value, being updated with the nth value each iteration.