Jump to content

Shift register: Difference between revisions

From LabVIEW Wiki
m punctuation
m made internal links to singluar (instead of plural)
Line 4: Line 4:
* on subsequent calls, is equal to the value that flowed into the right terminal of the shift register, on the previous call of the loop.
* on subsequent calls, is equal to the value that flowed into the right terminal of the shift register, on the previous call of the loop.


This behavior means that the shift register can be used to store some data that will be remembered from one call of the loop to the next.  This technique is used for creating [[functional globals]] (a.k.a. [[LV2-style globals]]).
This behavior means that the shift register can be used to store some data that will be remembered from one call of the loop to the next.  This technique is used for creating [[functional globals|functional global]] (a.k.a. [[LV2-style globals|LV2-style global]]).

Revision as of 15:48, 7 April 2007

An uninitialized shift register is a shift register of either a While Loop or For Loop that has no input data wired to the shift register's left terminal from the outside of the loop. Since the shift register is not initialized, the data that flows out of the shift register:

  • on the first time the loop is called, is equal to the default value of the shift register's data type, and
  • on subsequent calls, is equal to the value that flowed into the right terminal of the shift register, on the previous call of the loop.

This behavior means that the shift register can be used to store some data that will be remembered from one call of the loop to the next. This technique is used for creating functional global (a.k.a. LV2-style global).