Passing Multiple Values to the Next Loop Iteration

You can create stacked shift register terminals on the left side of a loop to remember multiple previous iterations and carry those values to the next iterations. This technique is useful for averaging data points.

Complete the following steps to configure a shift register to carry over more than one previous value to the next iteration.

  1. Create a shift register.
  2. Right-click the left or right shift register terminal.
  3. Select Add Element from the shortcut menu to create an additional terminal on the left side of the loop.

Stacked shift registers can occur only on the left side of the loop because the right terminal transfers the data generated from only the current iteration to the next iteration, as shown in the following block diagram.

IterationEnd Value
Top Left Shift RegisterBottom Left Shift RegisterRight Shift Register
0011
1101
2112
3213
4325

If you add another element to the left terminal in the previous block diagram, values from the last two iterations carry over to the next iteration, with the most recent iteration value stored in the top shift register. The bottom terminal stores the data passed to it from the previous iteration.