Home » Should I learn object-based programming?
Should I learn object-based programming?
ControlDesign.com
Keywords: object oriented programming, factory automation systems, industrial automation, process automation, automation engineering and control systems
What are the advantages and downsides of becoming functional in object-based programming, and how hard is it to learn? Check out The Answer to this problem here.
QUESTION:
I'M WHAT SOME of your articles have referred to as a “bit banger.” I’m a PLC ladder logic guy who knows he needs to get more current. I need a grounded understanding of what advantages I can get from becoming functional in object-based programming. I know reusability is a big plus, but can a few of you summarize its major advantages? How hard is it to learn, by comparison? Any downsides?
– From August 2005 Control Design
ANSWERS:
Not Sure I Get It
I, too, am a ladder person, but the rest of the world does things differently. I don’t see block programming as efficient regarding scan times. My experience is that the push for higher machine speeds could be a problem for the PLC. I looked at a foreign PLC program that I downloaded onto my computer. The only thing I saw was the ladder logic and I think it originally was in object form. It was very confusing and in my opinion not efficient. A programmer might see an input point in a rung a couple of times like I did. If done too much the scan time will go up.
This question reminds me of machine language vs. structured programming. If the program gets too complicated, the program would be hard to follow in machine language. However, if the ladder PLC program can be broken up into subroutines, the overall program has a good chance of having a shorter scan time.
I haven’t programmed in block language, but I can see it advantages and disadvantages.
ADVERTISEMENT
Don A Klinger, Marvel Manufacturing Co., Oshkosh, Wis.
Focus on Key Benefits
The usefulness of object-based programming to PLC developers is a longstanding question, particularly given the large investment necessary to become fluent with object-based development concepts. Until the IEC 61131-3 standard was established, object-based programming hasn’t been particularly beneficial to the overall PLC population. The standard, which provides guidelines for well-structured PLC software development, puts strong emphasis on the concept of function blocks. Based on some basic concepts from object-based development, function blocks provide a method to package part of a control program, and describe both the data structure and the data algorithm or behavior.
Function blocks are useful as a way to easily reuse code in different parts of one program or in different projects. Also, using function blocks encourages a well-defined software structure, whether it’s from the top-down or bottom-up, which ultimately will result in better code and conceptually, faster development. Because the IEC standard also includes block interface definition, any function block, no matter who its developer is, will be easily integrated into any application, opening the door for non-vendor-defined libraries of function blocks that will run on any platform.
Becoming familiar with the basic concepts of object-based development certainly will allow you to introduce function block development into your projects and effectively leverage this new concept, without a massive time investment.
That being said, the field of object-based development is enormous, with many intricacies that don’t transfer to function blocks. For example, while the concepts of data encapsulation and methods are crucial to function-block development, polymorphism and inheritance, two powerful features of object-based development, aren’t currently part of the IEC 61131-3 function block definition. Spending the time necessary to conquer the entire object-based programming paradigm, while an excellent academic exercise, would be wasteful from the PLC-development perspective. Focus rather on key concepts, such as software encapsulation, user-defined type development and method implementation, and you’ll see a solid return on your investment. Looking to the future, as adoption of IEC 61131-3 grows, your familiarity with object-based design basics will continue to prove useful.
However, there are limits to object-based development, and therefore to function blocks, which are a concern for those developing large, distributed systems. Object abstraction, the concept of encapsulating data and algorithm into one portable object, doesn’t account for execution concurrency in a system, or allow for any timing specification. Precise control of code execution and timing between distributed nodes is vital, and this limitation, which can be overcome with hardware timing connections, will prove problematic for some users today and for many more in the future.
In addition, actor-based development, an established approach in which individual code pieces execute independently—often through a dataflow paradigm—and communicate via asynchronous events, features the same reuse, program architecture and rapid development benefits of object-based programming. Actor-based development also meets the needs of those that require execution concurrency and software timing control. As the number of large-scale applications requiring better distributed intelligence increases in the industrial control market, look for greater adoption of actor-based language.
Sponsored Links
- Featured White Papers
- White Papers by Topic

Print page