PLC OOP Programming Language Examples
Learn By Doing IEC-61131-3 OOP Programming Examples In CODESYS
About The Object-Oriented Programming Language in PLCs
OOP is a way to package computer code or PLC (Programmable Logic Controller) instructions into reusable blocks or "objects" that can be used multiple times in a program or in other programs. OOP is a way to add structure to a program and keep program sections separate from one another so that the program does not end up with "spaghetti code" where multiple instructions affecting multiple elements are all mixed up together. OOP is not a new programming language in-and-of-itself, but rather a way to package code to make programs more efficient, reusable, and modifiable. High-level computer languages like C and C++ have used OOP for years, and recently OOP has crept into the programming of PLCs and has been added to IEC-61131-3 OOP.
OOP is not a specific programming language, it is a methodology. Another PLC Object-Oriented Programming example is the one the PLC programming software uses itself. The learner from this course will be well familiar with dragging a timer instruction onto the output of a rung of logic. That timer instruction dragged is an object class, and the resulting copy on the rung is an instance(copy) of that class. It is encapsulation in object-oriented programming.
To learn more see and share the OOP Programming in the PLC tutorial.
What you will learn by doing in the above tutorial?
- PLC OOP Introduction
- About Programming a Class
- Adding Properties to a Class
- Adding Methods to a Class
- Encapsulation Programming
- Programming Inheritance
- Passing Parameters to a Method
- Access Modifiers
- Polymorphism of a Class Examples
- Multi-class Interface Examples
Comments