PLC object orientation guidelines published
PLCopen started an object-oriented programming (OOP) guidelines initiative in order to create a more homogeneous method.
The 3rd edition of the IEC 61131-3 standard enables the usage of object-oriented programming (OOP). With object orientation, users 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).
The first document “PLCopen Guidelines for usage of Object-Oriented Programming”, as version 1.0. has been published.
– Edited from a PLCopen press release by CFE Media. PLCopen is a CFE Media and Technology content partner.