PLC CPU Goes to STOP With a Red Error LED: Reading the Diagnostics

The machine stops, the CPU shows STOP and ERROR. Before downloading anything, read what the controller already told you.

The symptom

The machine halts. The CPU's RUN LED is off, STOP is on, and ERROR (or SF) is red. Restarting the CPU works for an hour, then it stops again.

Rule one: read before you reset

The controller records why it stopped. A power cycle or a fresh download often clears the evidence. Connect first.

  • Siemens S7-1200/1500: Online & diagnostics → Diagnostic buffer. The newest entry is at the top; the cause is usually the entry just before Transition to STOP.
  • Rockwell Logix: Controller Properties → Major Faults, with type, code and the routine/rung where it happened.
  • CODESYS / TwinCAT: the PLC log and the exception information shown when you log in.
  • Write down the exact text and, if shown, the block and instruction address.

    Common causes

    Cycle time exceeded (watchdog)

    A scan took longer than the maximum cycle time. Causes: a WHILE loop that never ends, a FOR loop over a very large array, or heavy communication inside the cyclic task. Fix the loop exit condition and move slow work into a lower-priority task or spread it over several scans.

    Array index out of range

    Data[Index] with Index outside the declared bounds. Siemens may go to STOP if no error OB or local error handling is present; Logix raises major fault type 4, code 20. Clamp or check indices before using them:

    IF Index >= 1 AND Index <= 100 THEN
        Value := Data[Index];
    END_IF;
    

    Division by zero and invalid REAL

    Usually produces an invalid value rather than a STOP, but downstream code may then index an array with it. Guard divisions.

    Missing or failed hardware

    A rack module removed or failed, with the configuration requiring it, can stop the CPU on startup. Check module LEDs and the hardware diagnostics view.

    Missing error-handling blocks

    Older Siemens CPUs go to STOP when an event occurs and its organisation block (for example OB82 diagnostic interrupt, OB86 rack failure, OB121 programming error) is not loaded. Adding the OB stops the CPU from halting, but handle the fault in it — an empty OB just hides the problem.

    Intermittent stops

    Note the time of every stop. Correlation with a shift start, a recipe change or a specific product points to the code path. Correlation with a large motor starting points to the power supply — see finding 24 V supply dips.

    Afterwards

    Record the cause and the fix in the machine log. Recurring STOPs with the same entry mean the root cause was not fixed. Practise safe loops in the Structured Text reference.

    Frequently asked questions

    Where do I find why my PLC went to STOP?

    In the diagnostic buffer (Siemens), Major Faults in Controller Properties (Rockwell) or the PLC log (CODESYS/TwinCAT). Read it before resetting or downloading.

    What causes a PLC cycle time exceeded fault?

    A scan that runs longer than the watchdog time, usually from an endless WHILE loop, a very large FOR loop or slow work in the cyclic task.