FB_BA_Iterator

The function block implements an iteration mechanism for external data sources. It allows for index-based iteration over a defined range of values with an adjustable step size, either forward or backward.
Syntax
FUNCTION_BLOCK FB_BA_Iterator
VAR_OUTPUT
bIsActive : BOOL;
nIndex : DINT;
END_VAR
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
bIsActive |
BOOL |
Iteration status: TRUE if iteration is active, FALSE if stopped. |
|
nIndex |
DINT |
Current index value during the iteration. |
Methods
Name | Definition location | Description |
|---|---|---|
Local | Starts an inactive iteration or resumes an active iteration. | |
Local | Ends the current iteration and resets the index to the min. value. |
Properties
Name | Type | Access | Definition location | Description |
|---|---|---|---|---|
IsMaxLimit | BOOL | Get | Local | Indicates whether the current index has reached the upper limit. |
IsMinLimit | BOOL | Get | Local | Indicates whether the current index has reached the lower limit. |
Size | DINT | Get | Local | Size of the iteration range (nMaxBound - nMinBound + 1). |
Valid | BOOL | Get | Local | Indicates whether the iterator has been initialized correctly (nMin < nMax). |