Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering PLC Programming

You're reading from  Mastering PLC Programming

Product type Book
Published in Mar 2023
Publisher Packt
ISBN-13 9781804612880
Pages 386 pages
Edition 1st Edition
Languages
Author (1):
Mason White Mason White
Profile icon Mason White

Table of Contents (25) Chapters

Preface 1. Part 1 – An Introduction to Advanced PLC Programming
2. Chapter 1: Software Engineering for PLCs 3. Chapter 2: Advanced Structured Text — Programming a PLC in Easy-to-Read English 4. Chapter 3: Debugging — Making Your Code Work 5. Chapter 4: Complex Variable Declaration — Using Variables to Their Fullest 6. Part 2 – Modularity and Objects
7. Chapter 5: Functions — Making Code Modular and Maintainable 8. Chapter 6: Object-Oriented Programming — Reducing, Reusing, and Recycling Code 9. Chapter 7: OOP — The Power of Objects 10. Part 3 – Software Engineering for PLCs
11. Chapter 8: Libraries — Write Once, Use Anywhere 12. Chapter 9: The SDLC — Navigating the SDLC to Create Great Code 13. Chapter 10: Advanced Coding — Using SOLID to Make Solid Code 14. Part 4 – HMIs and Alarms
15. Chapter 11: HMIs — UIs for PLCs 16. Chapter 12: Industrial Controls — User Inputs and Outputs 17. Chapter 13: Layouts — Making HMIs User-Friendly 18. Chapter 14: Alarms — Avoiding Catastrophic Issues with Alarms 19. Part 5 – Final Project and Thoughts
20. Chapter 15: Putting It All Together — The Final Project 21. Chapter 16: Distributed Control Systems, PLCs, and Networking 22. Assessments 23. Index 24. Other Books You May Enjoy

Examining interfaces

If you read a textbook on a traditional language such as Java or C#, you will see that interfaces are often referred to as contracts. When you opt to use an interface, you are telling CODESYS that you agree to, at the very least, implement all the methods prototyped in the interface. However, in my opinion, this is a little confusing.

Generally, when I describe an interface to a new programmer, I usually describe them as a model for something. For example, if we are building an airplane, we will need certain things such as wings, an engine, and a cockpit regardless of whether we are building a prop plane or an F-35 jet fighter. Obviously, for each type of plane, these parts are going to be different. As such, when we implement an interface, we are telling our function block that we are going to use the methods that are declared in the interface but those methods may have different implementations.

To demonstrate how an interface works, let’s implement...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}