![]() |
![]() |
![]() |
![]() |
Loop
Synopsis
Periodically increment an output value.
Input Port
Parameters
Output Port
Description
Loop initializes its count output to its start value, and periodically increments it by incr. When the value reaches or exceeds the end value, the done flag is set unless cycle is nonzero, in which case the loop count is reset to the start value and another loop starts. If the increment is negative, the end test becomes whether the current count is less than or equal to the end value, so loops can go in either direction.
The value is updated whenever all other modules are done executing and the network reaches a quiescent state.
If cycle is 0, the final value is always exactly the end value, even if the increment plus the next-to-last value would have gone past the end value.
The loop can be interrupted at any time by setting run to 0.
Input
A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)
Parameters
UItoggle. When nonzero, the loop runs, incrementing as usual. When the loop reaches the end, the run parameter is automatically set to zero unless the cycle parameter is nonzero. If run is set to zero while the loop is running, it stops at the current value until run is set to one.
UItoggle. When nonzero, the loop runs in reverse, decrementing the count by the Increment value. When the loop reaches the beginning, the run parameter is automatically set to zero unless the cycle parameter is nonzero. If run is set to zero while the loop is running, it stops at the current value until run is set to one.
UItoggle. When nonzero, the loop increments the count by one Increment value and then resets Step to 0.
UItoggle. When nonzero, the loop decrements the count by one Increment value and then resets Step Back to 0.
UItoggle. When set to nonzero, the start value is loaded into the current count, but the loop does not stop running. It is automatically reset to 0 after the reset is done.
UIoptionmenu. When nonzero, this parameter controls how the the count is reset when it reaches the end. The values for the parmeter are:
1 = Cycle. The count is reset to the start , and the loop continues endlessly as long as run is nonzero.
2 = Bounce. When count reaches the end, the direction of the loop reverses and loop begins to decrement the count. When count reaches the beginning, the loop again reverses and loop begins to increment the count. The loop continues in this way as long as run is nonzero.
UIfieldTypein. The starting value for the loop. Reset causes this value to be stored into the loop count, and if cycle is nonzero it is reloaded each time the current value passes the end value.
Output Port
Note that this value does not count the number of loops executed, unless start is 0.0 and incr is 1.0; it accumulates the current value of the loop.
Example
File
See also related modules
![]() |
![]() |
![]() |
![]() |