The 3rd edition of the IEC 61131-3 standard enables the usage of Object Oriented Programming, OOP. With Object Orientation one can make many additional choices in the way the program is structured and decomposed, providing a different look & feel to the users especially across the different systems and platforms, creating different training guidelines and differences in maintenance.
To support the right choices and to add to the training programs, PLCopen started an OOP Guidelines initiative, in order to create a more homogeneous method. This activity helps to understand to make the right choice upfront, and to create consistent programs with long-term support.
PLCopen was already involved in OOP with the definition of PLCopen compliant function block libraries, which included both object orientation and classical programming (procedural). With the specification on communication via OPC UA, other OOP aspects come in. And with the security aspects within a system more OOP technology will arrive at the controller level.
This does not mean that the classical programming will be replaced: due to the upwards compatibility both programming styles can cooperate in parallel and be used in those areas that they serve best.
When one starts using OOP, several choices need to be made. For instance: are all function blocks in one Class? Think about the PLCopen Motion Control function blocks as an example, do we need then the AxisRef as the reference to the axis or even the MC_ as part of the FB name? How do they contain the methods? And will we use only methods, or also direct access to variables? Is the state machine for the axis controlled by the methods? Are all axes’ objects with methods, and we access them only via these methods? How about interfaces? And do we prefer composition above inheritance?
All these choices give a different look & feel to the users across the different systems, different training guidelines and differences in maintenance and its costs. And this is where PLCopen wants to help and give guidance to create a more homogeneous programming methodology.
Overall, there is little information on how to use OOP for industrial control or the operation technology (OT). The goal of this group is to help here with the following recommendations:
- Guidance to using OOP in addition to the “classical” way.
- Provide the same look & feel in using OOP across the different platforms and implementations.
- Create generic design patterns for industrial control programming.
- The classical programming way should be possible to be used in addition to the OOP way (e.g. this can mean that we have to extend the classical FBs with interfaces, methods, properties, and maybe input and outputs).
As an example, a boiler demo was used to represent the different forms of programming, moving from a classical approach, via a harmonized look & feel towards OOP.
The first document “PLCopen Guidelines for usage of Object-Oriented Programming” version 1.0 can be downloaded from our website.
It is an additional document within the framework of the PLCopen Software Construction Guidelines:
- Coding Guidelines
- Creating PLCopen Compliant Libraries
- Structuring with SFC – do’s & don’ts
- Guidelines for Object Oriented Programming
New is the document Application Examples for Motion Control - Porting "Function blocks for motion control" into OOP version 0.99 which is now available as Release for Comments until August 31, 2022. Comments can be made directly in the pdf file and sent back to PLCopen.