Flow Control Statement
Structured Text like most high level languages uses execution control statements, so if you've programmed with Pascal, C, or Java most of what you see will be familiar. Most procedural programming languages have some kind of control statements, and there is often overlap among languages.
Structured Text have few flow control methods that simplifies and improve the code complexity when trying to read the code.
-
Iterration / Looping
In most programming applications you'll need to do the steps over and over again. This process is known as iteration. It is also frequently referred to as looping, because it usually involves setting up the program so that it will loop back and repeat itself.
Depending on how a program is written, it can easily get stuck in the loop and keep on repeating itself forever causing the controller to reach its watchdog limit and to generate major fault that will halt the execution of your program.
For this reason, there is usually some way to get out of the loop, where by keeping track of just how many times the loop is supposed to repeat itself, or by looping until a condition changes.
Looping in Structured Text is a big step in Automation Programming. This task was also achievable with Ladder Logic except that, in Structured Text it is much simpler and very flexible.
|