You can add a conditional terminal to configure a For Loop to stop when a condition occurs. A For Loop with a conditional terminal executes until the condition occurs or until all iterations complete, whichever happens first.
Complete the following steps to add a conditional terminal to a For Loop.
Right-click the loop border and select Conditional Terminal from the shortcut menu. A conditional terminal appears inside the loop and the count terminal appearance changes from the symbol to the symbol.
Wire Boolean data, such as a Boolean control or an output from a Comparison function to the conditional terminal. You also can right-click the terminal and select Create Constant or Create Control from the shortcut menu to create the Boolean object.
(Optional) By default, the conditional terminal is set to Stop if True. You can change the behavior of the conditional terminal by right-clicking the terminal and selecting Continue if True. When the conditional terminal is Continue if True, the loop executes until the terminal receives a FALSE value.
Wire a numeric value to the count terminal or wire an array to an input tunnel on the loop border. This determines the maximum number of times the For Loop iterates if the condition is never met.
You must wire Boolean data or an error cluster to the conditional terminal and wire numeric data to the count terminal or auto-index an input array.