Summary: To observe the use of shift registers and feedback nodes to hold data from previous iterations of a For Loop.
Feedback VI located in the
C:\Exercises\LabVIEW Basics I directory. The
front panel shown in Figure 1 is already
built.
![]() Figure 1 |
Tools
and Functions palettes.
![]() Figure 2 |
1 wired to the left terminals on the
For Loop initializes the Feedback
Node to 1.
The Wait Until Next ms Timer slows the
operation of the code. You also could use Highlight
Execution instead of the wait function to slow the
operation.
The same code is used twice in this block diagram with the
Feedback Node in a different portion of the
wire.
Feedback Node and passes this value to the
Multiply function.
The bottom section of the code reads the initialized
Feedback Node and passes this value to the
indicator. This Multiply function does not
execute until the next iteration of the loop.
Click the Highlight Execution button, shown in
3, to enable execution highlighting. Run
the VI again to observe the order of execution. Turn off
execution highlighting when you understand the execution
order. The VI continues executing at normal speed.
Feedback Node with a
shift register, as shown in Figure 3.
![]() Figure 3 |
Feedback Node and press
the <Delete key to delete it.
For Loop and
select Add Shift Register.
shift register by wiring
1 to the left shift register.
Shift
Register and the top indicator to Feedback
Node.
Feedback Node and the
shift register portions of the block diagram
have the same functionality. shift register to display the last
three iterations of the For Loop data, as shown
in Figure 4.
![]() Figure 4 |
shift register to three
elements. Right-click the shift register
and select Add Element from the shortcut
menu to add each shift register.
shift
register to 1.
shift
register and select
Create>>Indicator. Label each
indicator.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."