About the Loop Adapter

You can use the Loop adapter to run subflows while incrementing a parameter’s value, to run subflows for array elements, to run subflows while iterating through values, to run subflows based on conditions, and to run subflows until conditions are met.

This page discusses:

See Also
Considerations When Using the Loop Adapter
About Parallel Loop Execution
Configuring the Loop Adapter

Loop Types

The Loop adapter consists of the following loop types, which differ in the way that conditions are expressed:

Loop Type Description
Do Until Runs subflows until a condition is satisfied. The number of executions is not constant.
For Runs subflows while continuously incrementing the value of a selected parameter.
For Array Executes subflows for each element of one or more arrays, and accumulates subflow results into one or more arrays.
For Each Runs subflows while iterating through a list of values for a selected parameter.
While Runs subflows if a specified condition is met.

For Array Loop

A For Array loop iterates once for each element of the array. The loop copies element 0 of the array into the associated subflow parameter and runs the subflow. The process repeats for each element in the array.

A For Array loop supports only one-dimensional arrays. However, it supports arrays of data types such as real, integer, string, and boolean.

In the subflow of a For Array loop, you can obtain the array index processed from the parameter R u n # . However, the run counter starts at 1, and the array indexes start at 0. To avoid confusion, you might want to include a calculator component in the subflow with the following expression:

N = R u n − 1
You can then map the parameter R u n # in the loop to R u n in the calculator.

Array parameters can vary in size at run time. If you include a resizable input or input/output array in a For Array loop, the simulation process uses the actual size at run time to determine the number of loops. If you include a resizable output array, the app adjusts its size at run time to match the number of loops.

The output arrays are assigned correct values from the subflow for both sequential and parallel execution. For information about how parameters other than the arrays behave for sequential and parallel For Array loops, see About Parallel Loop Execution.