Unlocking Advanced Control Statements
In the previous chapter, we took a deep dive into the world of flow control. If you found flow control confusing, you’re in good company because many students and programmers inexperienced in ST are in the same boat and find the concept equally confusing. However, what we explored in the last chapter was just the tip of the iceberg when it comes to flow control. Flow control is much richer, and there are a few add-on commands that can be employed to really spruce up your PLC program.
Often, a block of code will need multiple conditions to be satisfied for the block of code that it contains to run. For example, if you think back to the beer example that we’ve explored multiple times throughout this book, not only does a person have to be at least 21 to buy a beer in the United States but they must also have enough money to cover it. This is an example of a situation that needs multiple conditions to be true for a person to buy beer...