HangerSearch
Sign in

Article

How do you read a PLC program you didn't write? Answers from a public r/PLC thread

How do you read a PLC program you didn't write? What practitioners said in a public r/PLC thread: understand the process first, start at the output that won't turn on and cross-reference back, table the sequence, document as you go. Credited quotes, with limits.

The machine came from an OEM that no longer exists. The program was uploaded from the PLC, so the rung comments are thin or missing, and one output is not coming on. Somebody has to open the ladder logic and work out what the original programmer meant, without the original programmer.

In February 2026, a user on Reddit's r/PLC forum asked the same question in general form, and more than 20 people replied with how they actually do it. This post collects those answers, credited to each commenter, and sorts them into the questions a technician or new graduate is likely to ask. The comments are forum posts by individual practitioners. They are not HangerSearch advice, and they are not a standard.

Short answer (our summary of the thread): Most replies start outside the code: understand the process, talk to operators, watch the machine run, and collect the drawings. Then, for a fault, they start at the output that won't come on and cross-reference backwards to the input or interlock that is holding it off. Larger changes get written down as a sequence table or flow chart.

Applies to: Shop-floor technicians, maintenance engineers and new graduates opening an existing PLC program, usually ladder logic. Several replies refer to Rockwell Studio 5000 (AOIs), and one each to Siemens TIA Portal and Codesys; the methods themselves are not tied to one brand. Last verified: 24 Nov 2026. Author: Muhammed Fahiz

What was the question?

The thread is What is your method to understand existing PLC programs?, posted by u/Particular_Fan588 in February 2026. The original post asks what methods people use "From initial PLC program upload or upon receiving OEM PLC code", and lists four things the poster found hard to follow:

  • Complex interlocks
  • Nested AOI or instruction calls
  • Program execution order (calls, jumps)
  • Output tag dependencies (complex conditions for outputs)

It ends: "Are you just cross referencing? Manually Diagraming? Or just pure talent and know how?"

The answers below are quoted word for word (with curly quotes straightened) from comments we read on the thread page on 24 Nov 2026. Where we paraphrase, we say so.

Where do experienced people start: the code or the machine?

The most repeated answer was: not the code.

u/NaGaBa's whole reply was "Step 1: Understand the process it is controlling. Understand it well." When the original poster asked what to do if the process is beyond them and the change is minor, u/drbitboy answered: "if you don't understand the process then you should not be changing the code that controls it."

Others described how they build that understanding:

  • Talk to the people who run it. u/DeadlyShock2LG starts with "a narrative (operator and maintenance interview) of the machine and any drawings or documentation I can find," then asks questions such as "What purpose do each output serve? What feedback do each input provide?"
  • Watch it run. u/joeh4384 learns "A lot by connecting and watching it run," and, asked how long, said "15-60 minutes. It also good to get a feel of how the operator works the machine normally." u/Additional-Custard24 called that "critical" and described spending time in the code first, then talking with operations about how they interact with the process.
  • Get the drawings before the logic. u/Loco_Buoyo wrote: "If there are design documents available, focusing solely on the logic is a mistake. I start with the wiring and whatever documentation exists." The reply lists loop drawings and MCC drawings ("these will tell you what the I/O is and what it does"), P&IDs for context, and operations or maintenance documents, then checking the cabinet wiring for anything added or deleted.

u/Loco_Buoyo's reason for that last step is a story worth repeating as told: during a DCS upgrade, the wiring was still connected to the DCS, but the function had been replaced by a PLC in the operations shack at a truck dump station. "We found the PLC during loop testing." The same reply admits "you'll be lucky to find all the documentation that I mentioned above," but "everything that you can find will help."

If the documents are the missing piece, our earlier post on finding the manual for an old machine covers where to look when the OEM has gone.

How do you read ladder logic when an output won't come on?

For troubleshooting, the replies converge on one move: start at the output and work backwards.

u/GreenMustang91: "If just troubleshooting ladder, work backwards from the output that won't turn on." The same reply adds a second place to look: the permissive section of the program, if it has one, where the commenter looks for a tag named "LineRun" or something like it (our paraphrase).

u/MostEvilRichGuy gave the most structured version:

"The best method is to find your physical outputs, and backtrace each thing that triggers them. If you have to look several layers deep, stop at 2 or 3 levels back and move on to the next output. Then move on to soft outputs (timers, counters, interlocks, etc)"

That reply goes on: investigating the outputs shows you every action the machine takes, which lets you "draw conclusions about the inputs," and then you trace the physical inputs and "attack it from both angles."

u/binary-boy framed a fault report as a black box with inputs and outputs. The complaint usually arrives as "usually when I do X, Y happens, but it won't do Y, it does Z." X is the input and Y the desired output: "Locate those in your program with a good confidence. Chase (cross reference) the signals inward until you find the disconnect." Two practical points from the same commenter:

  • If the operator can point at a button on the HMI, "you can track that forward." If it is a physical button or output, "now you need schematics," and speed depends on how good those schematics are.
  • The PLC may not be the problem at all. In the commenter's words, the black box "is rarely the problem, just a window to the solution," and a motor that won't turn on does not mean the program is bad. "Quickly finding out that the PLC is telling the motor to run can shortcut all that right out, and you go right to the starter or VFD to find out what the problem is there."

u/Smorgas_of_borg made a related point about scope: you don't always need to understand the whole program. "If you're just trying to fix something being run by a program that hasn't changed in years, then it isn't the program's fault." The advice: focus on the piece related to what you are fixing.

How long does it take? Only individual estimates were given. u/binary-boy said "maybe 5 to 30 minutes for a program problem. But some problems are just complicated."

Ink line drawing of an open industrial control cabinet with a PLC rack of input and output modules on a DIN rail, terminal blocks and bundled wiring running through cable ducts

What about sequences, nested AOIs and execution order?

These were the harder items in the original question, and the answers were more varied.

Write the sequence down as a table. u/inen117 separated small changes from large ones. For a simple change: "i just try to understand the code from the output to the conditions to the inputs." For a major one, the sequence goes into a spreadsheet: "step number or flag, step description, conditions to jump to other step, outputs being activated, etc..." Asked how long that takes, the commenter described changing the CIP sequence of an HTST to save water, acid and soda, a job where safety meant double-checking everything ("a pump on with a path closed"). Working from the PLC program, the HMI application and the P&ID in the office, it took "like 2 days" to read the code, build the sequence table with descriptions, conditions and activations, make the changes in the spreadsheet and then in the PLC code, review the interlocks and update the HMI; in total about 16 hours in the office, 4 hours of travel and about 6 hours at the factory, with about an hour to copy, paste and edit the code online. A simpler change on a test fixture with no safety concerns took about 3 hours with the same method. The same reply ends: "Of course i use a lot of cross reference to understand the code."

Flow charts for sequences only. u/modern-neanderathal, who does migrations, said "Go with individual IO points and trace the logic backwards," and "for some complex logic like a sequence draw a flow chart." In a follow-up: flow charts only for sequences, otherwise cross-referencing, and on migrations those flow charts become the documents used to FAT the sequences. Scoping the program and the vendor documents usually takes them two weeks, depending on the sequence.

Top down, then bottom up. u/Snoo23533 described a two-pass read after observing the system: first top down, to see "why are they solving the problems they are solving" (global variable lists, program call order, the high-level flow on the visualization), then bottom up, to see "how did they manage the details" (I/O names, operation logic and function calls).

Learn the instructions you meet most. u/drbitboy pointed to Rockwell's 1756-RM003 manual, which "has flow charts of compound instructions," and added: "Everything else is Boolean Logic or arithmetic. You will memorize the 20% of the instructions that compose 80% of the code; read the manual for the rest."

Put an unknown AOI on a test PLC. u/binary-boy: when you hit an AOI you don't understand, "you're just going to be forced to understand how it works. Which might require putting it in a test PLC and poking at it."

The hardest parts, per one veteran. u/5hall0p: "Pointers, For Next loops, and Subroutines with parameter passing are most challenging."

Tools differ. u/Robbudge argued that Studio 5000 has a depth limit and limited advanced programming, so it is "about the only IDE I don't mind reverse engineering logic in," while some advanced Codesys libraries "can get very deep." u/BumpyChumpkin reported that in one TIA Portal project the cross-reference view did not show where a tag was used, so they went through each program manually and took notes, adding "I'm not sure if it's just something I'm doing wrong." That is one user's experience on one project, not a documented limit of the software.

Should you rewrite it instead?

Some replies said yes, sometimes. u/Awbade cross-references "until I get so frustrated I delete the old code and re-write it usually." Pressed on what to do without full knowledge of the machine, the same commenter said they tell their managers they are "not 100% sure on my reverse engineering" and ask whether to spend more time researching or move forward, adding "I'm a retrofitter, so a lot of times it makes more sense for me to start from scratch." Another commenter agreed that some OEM code is badly enough written that a rewrite is faster (our paraphrase). u/Gimfo said that if they have to jump all over the program to see how one thing interacts with another, they are "most likely rewriting your code."

Others pointed out where that is not an option. u/Tota1pkg works in aseptic processing, where "making changes in the aseptic processing world is a big no-no so I don't rewrite the code," and learns the system by watching it run and taking one problem at a time. u/binary-boy, on modifications rather than fault-finding: "I don't rush that," and takes "However long it takes me to feel confident this won't rip somebody's arm off or anything like that."

If a rewrite is part of a retrofit, our post on retiring a Micromaster 440 for a G120 covers carrying the old fault history across. And if any of this work means going near a machine that is energized or under pressure, isolation comes first; our teardown of the Goodyear case study shows what a missed step in close-out can do.

Ink line drawing of a closed control panel door with a mounted operator panel frame, pushbuttons, a selector switch and a pilot light, and a closed laptop resting on a small shelf below it

What should you write down as you go?

The original poster kept asking each commenter whether they documented what they found. The answers:

  • Comment the program itself. u/5hall0p: upload the program, "comment the IO from prints, comment the SCADA / HMI tags if I had the development package, then comment the rest of the program as best I could," and "I add rung comments with what I think is going on as I go through it. After a few iterations of commenting it was good enough."
  • List every input and output, not only the wired ones. u/NeroNeckbeard lists I/O "Not just from IO list but also what get set from the HMI, possible reads and (god help us, writes) from other PLCs over the network."
  • A searchable printout. u/Loco_Buoyo: "print the entire configuration to pdf & make it searchable. You can also comment the pdf. For logic that is particularly tough, I have resorted to hard copy prints and multiple colours of high-lighter."
  • A cause and effect matrix and a control narrative. u/sussyb0t: "Literally a giant matrix that maps physical/serial inputs to outputs," with nuanced logic such as cascading PID loops explained in the control narrative document.
  • A block diagram. u/Snoo23533: "When im done try to leave behind a draw.io block diagram to show my thinking."
  • A deliverable spreadsheet. u/DeadlyShock2LG: personal notes are often "scattered notes if im honest with myself," but for a deliverable, "a spreadsheet based on ISA-88 best practices. Focus on the physical and procedural models."

A second r/PLC thread, How does your shop handle backing up/documenting PLC and HMI programs? (posted by u/Satej_2699, a student who had seen programs "living as renamed files on a shared drive"), adds one useful distinction. u/kryptopeg wrote: "Your backups are just backups, they're the What." Take them whenever a change is made, before any fault investigation, and on a yearly routine; a separate change control record is the "Why." For the problem of nobody knowing what old logic does after someone leaves, the same reply says: "What you need a is control philosophy/design spec for the PLC, including both I/O and Logic," with change control prompting updates to that documentation.

Whatever form the notes take, the point of leaving a trail the next tech can find is the same: the next person opening this program should not have to start from zero.

A one-page checklist from the thread

This is our summary of the replies above, not a procedure from any standard or vendor. Adapt it to your site's safety and change-control rules.

  1. Find out what the machine is supposed to do: operators, maintenance staff, any narrative or manual.
  2. Watch it run, if you can do so safely.
  3. Collect drawings: wiring, loop and MCC drawings, P&IDs. Check the cabinet against them.
  4. List the I/O, including HMI writes and network reads and writes from other controllers.
  5. For a fault: confirm whether the PLC is commanding the output at all. If it is, the problem may be downstream (starter, VFD, field device).
  6. If it is not: start at that output and cross-reference backwards. Check the permissive section if there is one. Stop after two or three levels and widen out if needed.
  7. For sequences: write them as a table (step, description, transition conditions, outputs) or a flow chart before changing anything.
  8. For unfamiliar instructions or AOIs: read the instruction manual, or try the block on a test PLC.
  9. Write down what you learned as you go: rung comments, an annotated printout, a cause and effect matrix.
  10. Take a backup before you change anything, and record why you changed it.

What this doesn't tell you

  • These are forum comments. Each answer is one practitioner's account of their own method. None was verified by us, and the thread is not a survey: it does not tell you how most plants work.
  • The times are anecdotes. "15-60 minutes," "5 to 30 minutes," "2 weeks" and the HTST figures are individual estimates for individual jobs.
  • Brand mix. Many replies refer to Rockwell tools (AOIs, Studio 5000, the 1756-RM003 manual). Comments about Siemens TIA Portal and Codesys are single opinions.
  • What we read. We read the main thread page as displayed on 24 Nov 2026 after expanding replies; three short reply chains stayed collapsed and are not quoted. One reply was deleted and one was in Spanish; neither is quoted. Comments are quoted only where we read them in full. For the second thread, only the original post and u/kryptopeg's top comment are used.
  • Ladder basics are not taught here. This post covers reading an existing program. It does not explain contacts, coils and instructions from scratch.
  • Search volume for "how to read plc ladder logic" is unknown; the phrase appears in search autocomplete, but no keyword tool was used.

Where does HangerSearch fit?

Several replies come down to the same gap: what the last person learned about a machine was never written where the next person could find it. Rung comments and spreadsheets help inside the program. The service reports written after each job are the other half of that record.

HangerSearch searches your team's finalized service reports where they already sit and cites the page each answer comes from. It does not read or edit PLC programs. See how we handle your reports.

Book a 20-minute demo: hangersearch.com

FAQ

How do you read PLC ladder logic in a program you didn't write? In the r/PLC thread, the common method for a fault is to start at the output that won't turn on and cross-reference backwards to the conditions holding it off. For larger changes, replies recommend understanding the process first and writing the sequence down as a table or flow chart.

How do you read a PLC ladder diagram for troubleshooting? One commenter's version: find the physical outputs, backtrace what triggers each one, stop two or three levels deep and move to the next, then look at soft outputs such as timers, counters and interlocks, and finally trace the inputs. Another adds: check first whether the PLC is commanding the output at all.

How does PLC ladder logic work? One experienced commenter put it this way: all any PLC user program does is read and write values of bits in memory. Those bits form a model of the process, and the logic implements a control strategy for that model. Most instructions are Boolean logic or arithmetic.

Should I rewrite PLC code I don't understand? The thread is split. Some retrofitters rewrite when the old code is unclear. Others, for example in aseptic processing, say changes are a big no-no, and one commenter said you should not change code if you don't understand the process it controls.

What should I document after reverse-engineering a PLC program? Replies mention rung and I/O comments, an I/O list that includes HMI and network writes, a searchable annotated PDF of the program, a cause and effect matrix, a control narrative, and a block diagram. A second thread adds: keep backups and a separate record of why each change was made.

Sources

  1. r/PLC, "What is your method to understand existing PLC programs?", posted by u/Particular_Fan588, February 2026. https://www.reddit.com/r/PLC/comments/1rbtmbi/what_is_your_method_to_understand_existing_plc/ (read on 24 Nov 2026 with replies expanded). Commenters quoted or paraphrased: u/Particular_Fan588, u/NaGaBa, u/drbitboy, u/DeadlyShock2LG, u/joeh4384, u/Additional-Custard24, u/Loco_Buoyo, u/GreenMustang91, u/MostEvilRichGuy, u/binary-boy, u/Smorgas_of_borg, u/inen117, u/modern-neanderathal, u/Snoo23533, u/5hall0p, u/Robbudge, u/BumpyChumpkin, u/Awbade, u/Gimfo, u/Tota1pkg, u/NeroNeckbeard, u/sussyb0t.
  2. r/PLC, "How does your shop handle backing up/documenting PLC and HMI programs?", posted by u/Satej_2699. https://www.reddit.com/r/PLC/comments/1uthcwg/how_does_your_shop_handle_backing_updocumenting/ (read on 24 Nov 2026). Used: the original post and u/kryptopeg's comment.

Related

All posts