Y_YA_ForLoopControl_Template
The
Y_YA_ForLoopControl_Template
function block provides sample code that shows how a FOR loop can be split into batches. This will help prevent a large FOR loop to attempt a run in one task interval starving other tasks.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| V | circle | Yt_YA_XYArray | Structure containing the parameters being evaluated in the FOR loop | |
|
VAR_INPUT
|
||||
| B | Execute | BOOL | Upon the rising edge of the Execute input, all other inputs are read and the function block becomes operational. If an input needs to be modified, the value will have to be changed and the Execute input will have to be re-triggered. | FALSE |
| V | LoopSize | INT | Desired number of times the FOR loop should run in one update cycle | INT#10 |
| VAR_OUTPUT | ||||
| B | Done | BOOL | The Done output is set to TRUE when the commanded action has completed successfully. If another function block takes control before the action is completed, the Done output will never become TRUE. This output is reset when Execute becomes FALSE. | |
| B | Busy | BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) | |