Feedback: Ladder logic programming prevails for good reasons
“Ladder programming endures in the controls industry for good reasons, at least for PLC applications. While ladder originally was marketed as being a format designed to appeal to electricians familiar with traditional relay logic, this is only part of the story. Early PLCs did, and current models still do, execute sequentially in a scan mode. In effect, the PLC’s CPU is not designed to execute the program written by the user; instead, it executes a routine in firmware that scans a set of Boolean expressions stored in memory (even if entered and viewed as ladder rungs), one rung at a time, getting the data and storing results in a data table, and doing an I/O update once per scan. This simulates the execution of the user’s program, while not actually running it (a fine distinction, for sure).
“This scan philosophy made early PLCs deterministic and reliable in their program execution, and forced the user to use very small instruction sets and rigidly formatted program structure. In reality, this was nothing like the way an actual relay logic circuit works (wherein everything happens at once), and only the symbology used was copied from relay-ladder programming. This also made it easy for early systems to depict power flow in the logic for maintenance and debugging. No other structure would have been so easy to implement in PLC firmware, including competing systems using raw Boolean expressions using alphanumeric text (think early Texas Instruments PLCs), symbolic logic using AND and OR gate symbols, flowcharts, etc. It seems to me that the real benefits of a recurring scan philosophy remains as valid today as it did back in the early days of PLCs and computer-based automation. And if that is true, viewing the logic in terms of rungs executed in order helps the programmer to remain mentally within the scan philosophy. Try determining the execution order of logic‘drawn’ using AND and OR style symbolic logic, traditionally used for IC based digital logic. It does present problems harder to overcome than the ladder format. I have seen this concern realized during debugging of some DCS logic drawn in the symbolic logic style.
“Ladder logic remains in use more because it is practical, and, in a sense, almost necessary, than because it is a quaint holdover from the old days.”
— Edited by Mark T. Hoske, editor-in-chief, Control Engineering,