We want our component to keep ahold of its own state after it has been active. This data should be considered private, hidden from outside of the component and only accessible by the commands sent to the component.
There is only one efficient private method of storing data within a VI in LabVIEW and this is by using shift registers on a For Loop or While Loop structure. Figure 5.9 illustrates their use.
Shift registers are local variables that are primarily used for transferring values from one iteration of the loop to another. They have an important characteristic that we use, and that is persistence. By persistence we mean that the data held within the shift register is kept even after a VI has been run. This gives our components independence, which is essential for loose coupling, and data privacy, which is essential for information hiding.
Let's put it all together and make a dummy component structure.
Top |