For Iterator
The control unit for the for-iterator subsystem.
blockType: ForIterator
Path in the library:
|
Description
Block For Iterator, placed in the block Subsystem, repeats the execution of the subsystem during the current time step until the iteration variable exceeds the specified iteration limit. You can use this block to implement a flowchart equivalent to a for loop in a programming language.
The output of the For Iterator Subsystem block cannot be a function call signal. Engee displays an error message when the model is updated.
Ports
Output
#
1:N
—
the value of the iterator variable during the step
scalar
Details
The value of the iterator variable during the step.
Dependencies
To use this port, check the box Show iteration variable.
| Data types |
|
| Complex numbers support |
Yes |
Input
#
Next_i
—
external value of the iterator variable
scalar
Details
Input port for connecting to an external source of iteration variables. The value of the input in the current iteration is used as the value of the iteration variable in the next iteration. The input port accepts data of mixed numeric types.
Dependencies
To use this port, check the box Set next i (iteration variable) externally.
| Data types |
|
| Complex numbers support |
Yes |
#
N
—
the external value of the iteration limit
scalar
Details
An input port for connecting to an external iteration limit source. The value on the port is used as the maximum number of iterations of the loop. The input port accepts data of mixed numeric types.
Dependencies
To use this port, set the parameter Iteration limit source in value external.
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main
#
States when starting —
description missing
held | reset
Details
description missing
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Iteration limit source —
source for the number of iterations
internal | external
Details
Select the source for the number of iterations.
internal — parameter value Iteration limit (N) defines the number of iterations.
external — the value of the signal on port N determines the number of iterations.
Dependencies
Choice internal displays and enables the parameter Iteration limit (N). Choice external adds an input port labeled N.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Iteration limit (N) —
specify the number of iterations
Int64 integer
Details
Specify the number of iterations. This parameter supports storage classes.
-
5— Repeat the blocks in the For Iterator Subsystem block 5 times. -
an integer— specify an integer or a named constant variable.
Dependencies
To use this parameter, set for the parameter Iteration limit source meaning internal.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Set next i (iteration variable) externally —
control of the input port display
Logical
Details
Control the display of the input port:
-
if the checkbox is not checked, the input port Next_i is not displayed.
-
If this option is selected, the input port Next_i is used to connect to an external source of iteration variables. The value of the input in the current iteration is used as the value of the iteration variable in the next iteration.
Dependencies
To use this option, check the box for the option Show iteration variable.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Show iteration variable —
control of the output port display
Logical
Details
Control the display of the output port:
-
if the box is not checked, then the input port is 1:N is not displayed.
-
if the box is checked, the input port is 1:N is displayed.
Dependencies
To use this option, check the box Set next i (iteration variable) externally.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Index mode —
specify the initial iteration number
Zero-based | One-based
Details
Specify the indexing mode as Zero-based or how One-based.
For Zero-based Indexing index 0 sets the first element of the input vector. Index 1 defines the second element and so on.
For One-based Indexing index 1 sets the first element of the input vector. Index 2, specifies the second element, and so on.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Iteration variable data type —
type of output data
Int32 | Int16 | Int8 | Float64
Details
Set the data type to output the iteration value from the iteration number port.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |