Specifying the Number of Times Operations in For Loops Execute

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

A For Loop repeatedly executes the subdiagram inside it the number of times you wire to the count terminal.

Complete the following steps to specify the number of times an operation executes using a For Loop.

  1. Add a For Loop to the block diagram.

  2. Add objects inside the For Loop to create a subdiagram that the For Loop repeats.
  3. Determine how many times the For Loop iterates in one of the following ways:
    • Wire a numeric value to the count terminal .
    • Wire an array to an input tunnel on the loop border by auto-indexing the array.
    Note Note  A VI does not run if it contains a For Loop that does not have a numeric value wired to the count terminal or an auto-indexing input tunnel in which the size of the array determines the iteration count.

You also can add a conditional terminal to a For Loop to configure the loop to stop when a Boolean condition or error occurs. A For Loop with a conditional terminal executes until the condition you define occurs or until all iterations complete, whichever happens first.


Not Helpful