Summary
In this chapter, we explored IF
and CASE
statements, which are the backbone of flow control for any ST PLC programming environment. More importantly, we learned what flow control is and how to design programs that have many branches using a combination of pseudocode and flowcharts. In all, understanding how to control the flow of a program is one of the most basic and important skills a PLC programmer can have. As such, feel free to reread this chapter until you are comfortable with the material. Then, come back to it later when you’re in the field working on a real-world project in ST.
Now, the IF
statements in the CASE
block are what are known as nested IF
statements; essentially, that means that they are inside of another control structure. Also, it should be noted that the IF
statements were structured in a less-than-ideal way. A more appropriate configuration would have been what’s known as an IF-ELSE-IF
configuration, which is a concept we haven’...