EXIT Statement
Help Contents
- Fernhill SCADA
- Help
- IEC 61131-3 Scripts
- Structured Text (ST)
- EXIT Statement
Introduction
The IEC 61131-3 ST EXIT statement stops a loop before it has completed:
- A FOR Loop is stopped before the loop variable reaches its target value.
- A WHILE Loop is stopped before the condition becomes false.
- A REPEAT Loop is stopped before the condition becomes true.
Examples
-
Use an EXIT statement to stop a FOR loop before it completes:
For Index:= 0 To 10 Do
If Item[ Index ] != 0 Then
Exit;
End_If;
End_For;
Standards Compliance
IEC 61131-3 Second Edition: Table 56.9.
IEC 61131-3 Third Edition: Table 72.10.
Further Information
Structured Text
For other Structured Text (ST) statement types.
Glossary
For the meaning of terms used in Fernhill SCADA.