Adding a While Loop

Add a While Loop to continuously generate the signal and check the generation status until you click the Stop button.

  1. Display the VI block diagram, and select the While Loop on the Structures palette.
    Tip You can use the Search button on the Functions palette to find the Structures palette.
  2. Enclose the niRFSG Check Generation Status VI in the While Loop, as shown in the following figure.
    Figure 7. The niRFSG Check Generation Status VI Enclosed in the While Loop

    1378

  3. Right-click the While Loop tunnels, and select Replace with Shift Register.
  4. Select the Or function on the Boolean palette. Place the function inside the While Loop.
  5. Wire the output of the Or function to the conditional terminal of the While Loop.
  6. Select the Unbundle by Name function on the Cluster, Class, & Variant palette. Place the function inside the While Loop.
  7. Wire the error out output of the niRFSG Check Generation Status VI to the Unbundle by Name function.
  8. Wire the output of the status element to an input of the Or function.
  9. Right-click the unused input of the Or function, and select Create » Control to create a Boolean control.
  10. In the VI front panel, right-click the Boolean control created in step 9, and select Replace » Modern » Boolean » Stop Button to create a Stop button.
    Figure 8. While Loop with Stop Button

    1378