Summary
In this chapter, we explored pre-built function blocks such as the CTU
, TOF
, and TON
blocks. We have also explored the time data type and the syntax to create a time variable. The key takeaway for this chapter should be that there are a lot of prebuilt functionalities that can make life as a PLC programmer very easy. Another key takeaway should be that each function block has different inputs and outputs. This means that learning how to use function blocks will take a bit of research.
Thus far, all of our programs have flowed very linearly. That is, all our programs have flowed from top to bottom with no branches involved. Though we can add a lot of advanced functionality to our programs with function blocks, our programs will always lack any real intelligence due to the straight linear flow. As such, in the next chapter, we’re going to explore flow control and how we can control the output of our program based on certain inputs.