User-defined instructions are flexible and reusable blocks of code, useful for simplifying and speeding logic development.
Programmable logic controllers (PLCs), prized for their ruggedness and real-time performance, have formed the industrial automation backbone of operational technology (OT) systems since the late 1960s. While traditional PLC programming methods were historically less sophisticated than solutions developed for the information technology (IT) industry, the situation has been steadily improving. This Automation World April 2026 article by AutomationDirect’s Tim Ensminger, titled Bringing Object-Oriented Thinking to PLC Programming, explains how object-oriented programming (OOP) techniques are helping OT developers speed up their coding efforts while reducing the risk of errors, resulting in more maintainable results.
Ladder Logic versus OOP
Since their inception, PLCs have largely been programmed using ladder logic, which is a visual language modeled on electrical schematics, providing familiarity for the engineers and electricians working with these systems. While ladder logic is effective for simple machines, this language becomes increasingly difficult to manage as applications scale. Large programs often suffer from duplicated logic, poor navigability, and a heightened risk of subtle, hard-to-detect errors.
An OOP approach, long used in IT software development, offers a practical way to address these challenges in PLC environments. OOP organizes related data and behavior into reusable “objects,” enabling engineers to define logic once and instantiate it many times. When applied correctly, this approach promotes consistency, reduces errors, and simplifies maintenance across complex systems. Some PLCs have offered various forms of OOP support for years, but new tools and improvements continue to make OOP more accessible for OT applications.
OOP in action
AutomationDirect’s Productivity Suite provides a concrete example of how OOP concepts can be adapted for OT through user-defined structures (UDSes) and user-defined instructions (UDIs). UDSes allow programmers to group related data elements into structured types, while UDIs encapsulate reusable blocks of ladder logic with defined inputs, outputs, and internal memory. Each UDI instance behaves like a built-in PLC instruction, but with its own dedicated data, empowering developers to reuse proven logic without copy-paste duplication.
For example, a temperature sensor UDI can handle scaling, diagnostics, and alarm logic internally, presenting a clean interface to the rest of the program. A UDS could be used in conjunction with the UDI, so that a single data element contains all related sub-elements. Encapsulation not only reduces repetition but also improves readability by hiding implementation details behind well-defined instruction blocks. Optional password protection further safeguards proprietary logic, an important consideration for OEMs.



Developers can take advantage of this single-level reuse, and the Productivity Suite supports nested UDIs, enabling hierarchical system modeling. Low-level device UDIs can be combined into mid-level assemblies—such as pump skids—and further aggregated into higher-level systems like tanks or process units. This layered abstraction keeps even large ladder programs approachable, while still allowing engineers to “drill down” when troubleshooting or extending functionality.
Both UDIs and UDSes bring the benefits of object-oriented thinking to PLC programming without abandoning ladder logic.
Programs that separate logic into appropriate levels of abstraction require less mental effort to understand and modify, enabling developers to work more efficiently with a lower risk of making errors, especially in complex programs with multiple subsystems.
All these OOP benefits ultimately translate into cost savings and improved efficiency, advantageous for projects of any size and complexity. Check out the entire portfolio of AutomationDirectProductivity programmable controllers here, and see how you can put OOP to work in your projects!

