Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

WHILE Loop

  • Last UpdatedJul 13, 2023
  • 1 minute read

WHILE loop performs a function or set of functions within a script several times during a single execution of a script while a condition is true. The general format of the WHILE loop is as follows:

WHILE <Boolean_expression>

[statements]

[EXIT WHILE;]

[statements]

ENDWHILE;

Where: Boolean_expression is an expression that can be evaluated as a Boolean as defined in the description of IF…THEN statements.

It is possible to exit the loop from the body of the loop through the EXIT WHILE statement.

The WHILE loop is executed as follows:

  1. The script evaluates whether the Boolean_expression is true or not. If not, program execution exits the loop and continues after the ENDWHILE statement.

  2. The statements in the body of the loop are executed. The loop can be exited through the EXIT WHILE statement.

  3. Steps 1 through 2 are repeated.

WHILE loops can be nested. The number of levels of nesting possible depends on memory and resource availability.

QuickScript .NET Control Structures

TitleResults for “How to create a CRG?”Also Available in