Unlocking the Power of Flow Control
So far in this book, we’ve only explored programs with a linear flow. That is, all the programs that we explored have started at the top and ended at the bottom. No matter what, this is the natural flow of all software. However, the route we take to get to the bottom will often vary.
Typically, a program will have no one defined path to the bottom. A program will usually branch off into multiple paths to get to the bottom. These paths will have different logic that will be executed, which will alter the program’s behavior depending on which path it takes. To conceptualize this, consider the logic that turns on a motor. The type of VDF a customer chooses will often dictate a start sequence. A quality program will either detect the motor brand or allow the operator to input the motor brand, and the program will run the proper logic based on the selection.
Flow control is a very important topic in both traditional and PLC programming...