Book Image

Mastering PLC Programming

By : Mason White
Book Image

Mastering PLC Programming

By: Mason White

Overview of this book

Object-oriented programming (OOP) is a new feature of PLC programming that has taken the automation world by storm. This book provides you with the necessary skills to succeed in the modern automation programming environment. The book is designed in a way to take you through advanced topics such as OOP design, SOLID programming, the software development lifecycle (SDLC), library design, HMI development, general software engineering practices, and more. To hone your programming skills, each chapter has a simulated real-world project that’ll enable you to apply the skills you’ve learned. In all, this book not only covers complex PLC programming topics, but it also removes the financial barrier that comes with most books as all examples utilize free software. This means that to follow along, you DO NOT need to purchase any PLC hardware or software. By the end of this PLC book, you will have what it takes to create long-lasting codebases for any modern automation project.
Table of Contents (25 chapters)
1
Part 1 – An Introduction to Advanced PLC Programming
6
Part 2 – Modularity and Objects
10
Part 3 – Software Engineering for PLCs
14
Part 4 – HMIs and Alarms
19
Part 5 – Final Project and Thoughts

Software Engineering for PLCs

Software engineering is a pivotal, yet often overlooked aspect of Programmable Logic Controller (PLC) programming. There is a core problem with automation engineering that stems from most PLC projects usually being viewed as hardware first. Many books, workshops, and so on are focused on PLC projects as hardware-first systems. Usually, programming is secondary to the overall hardware design of the system. In other words, the software is there to operate the hardware.

Many PLC programmers are not formally trained software developers and have backgrounds ranging from electricians to electrical and mechanical engineers. Though there is nothing wrong with a PLC developer not being a formally trained programmer, there are techniques that are usually taught in programming classes that are often lost when a non-formally trained programmer tries to program a PLC. This book aims to teach and apply software engineering practices to PLC programming. By learning these techniques, PLC developers can utilize the full gamut of the IEC 61131-3 standard and create advanced software faster and cleaner.

The hot topic in today’s fast-paced industrial world is Artificial Intelligence (AI) and automation. In short, machines are getting smart, and a major component of that is the software that controls the systems. The first PLC was introduced around the late 1960s and early 1970s; as such, PLCs (and by extension, automation) are nothing new. However, what has changed is the complexity of the systems that PLCs control. With the lower costs and rising computing power of PLCs, the applications that PLCs control are now becoming more complex seemingly by the day. The days of PLC programmers getting through the day with basic programming techniques and ladder logic are quickly becoming a thing of the past. To survive and be competitive in today’s market, a new way of thinking about PLC code is needed. Today’s world now needs PLC programmers that can function as software engineers.

In this chapter, we’re going to cover the following topics:

  • Software engineering for PLCs
  • The IEC 61131-3 standard
  • Ways of programming a PLC
  • CODESYS
  • A ladder logic Hello, World! program to test the installation of CODESYS