Unleashing Built-In Function Blocks
As a PLC programmer, whether you’re a professional, student, or hobbyist, you’ve almost certainly run into situations where you needed to copy and paste a series of instructions in multiple places. In programming, having code in more than one location is a terrible practice that should only be exercised in extenuating circumstances. This can lead to a catch-22; on one hand, you may legitimately need the functionality, but on the other, it’s a sloppy practice to have the same functionality in more than one location. In that case, what should one do?
A core tenet of any modern programming system is a concept known as code reusability. To accomplish this, entities known as functions and function blocks are employed. Functions and function blocks are complex topics that are core to a quality program architecture. All modern programming languages support some type of “built-in” functionality that is packaged in either...