MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Why the PLC loses its program after a power cut - and how to make it never happen
HomeModels
Table of contents

On this page

Fault Diagnosis & Standards (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

Why the PLC loses its program after a power cut - and how to make it never happen

Program loss after an outage is not bad luck; it is storage physics. RAM, flash and EEPROM behave differently, and the battery discipline decides whether RAM-based CPUs survive.

1. How it works

Where the program lives decides the outcome. RAM loses everything without power and depends on a backup battery or supercapacitor - when the battery dies, one outage wipes the memory. Flash retains the program but a power cut during a download can corrupt the file. EEPROM cards hold forever but suffer oxidised sockets. Identify your case from the CPU model and card type: RAM-based machines must treat the battery alarm as a fault, flash-based ones need a stable supply during writes.

2. Practice and pitfalls

Battery discipline in detail: lithium cells last 3~5 years, halved at 50C inside a hot cabinet; below the alarm threshold (around 2.9~3.0V on a 3.0~3.6V cell) the CPU warns while data survives days to a few weeks - the last window to change. Replace with the CPU powered up, per the maker procedure; swapping it dead means wiping it yourself. Record the date and roll the schedule forward. Supercapacitor types hold only hours to days - upload before any long shutdown. The permanent cure: flash storage or a memory card, retentive areas plus the backup regime, and an online UPS for 15~30 minutes of ride-through that also protects programs mid-write.

3. Program retention quick table

Storage typeOn power lossMaintenanceRisk
RAM plus batteryLost when battery diesHot-swap cells, 3~5 year cycleOne outage wipes it
RAM plus supercapHours to days of holdUpload before long stopsProgram evaporates on holiday
Flash memoryRetainedStable supply during writesCorruption if interrupted
EEPROM cardRetainedCheck socket and ageingOxidised contact failures
UPS plus any typeRides through dipsQuarterly discharge testDead UPS battery equals nothing

4. Notes

Know the storage type, watch the battery, compare after every outage. Treat the cell like a contactor - a consumable on a schedule - and pair the hardware with the backup regime so loss becomes impossible rather than unlikely.

5. References

The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Memory and retention requirements per GB/T 15969.2 (IEC 61131-2), UPS systems per the GB/T 7260 series, machinery electricals per GB/T 5226.1. Always check the device datasheet and the product design file for ratings and derating.

6. Cautions

⚠️ Three common pitfalls:
① Swapping the battery with the CPU unpowered: that erases the program by hand - hot-swap per the procedure with power on
② Ignoring the battery alarm as a mere hint: the hold window is days to weeks, then one outage finishes it - act within the week
③ Installing a UPS and never testing it: an aged battery gives zero seconds - discharge-test it every quarter

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL