<< Click to Display Table of Contents >> Iteration with Repeating Loops |
|
Probably one of the most powerful features in Structured Text is the ability to make loops that repeat lines of code. In relation to TeslaSCADA2 programming loops can be used for many different purposes. You might have a function or a set of statements that you want to execute a certain amount of times or until something stops the loop. In Structured Text for TeslaSCADA2 you will find 2 different types of repeating loops:
• FOR
• WHILE
Common for all the types of loops is that they have a condition for either repeating or stopping the loop. The condition in FOR and WHILE loops decides whether the loop should repeat or not.