Learn PLCs free
PLC FundamentalsIntermediateImportant
2 min read
Updated 2025-11-10
Intermediate

Retentive Memory

Retentive Memory

Retentive memory means PLC data memory that preserves its value across power cycles, processor restarts, and program transitions to STOP mode. Battery-backed RAM or non-volatile flash holds the data; non-retentive memory is cleared on power-up.

Key Takeaways

  • Retentive memory means PLC data memory that preserves its value across power cycles, processor restarts, and program tra...
  • Intermediate-level topic in PLC Fundamentals
  • Commonly used in: Industrial process control, Machine automation

Detailed Definition

Retentive memory in a PLC is battery-backed or flash-based memory that preserves stored values when the PLC loses power or goes through a power cycle. When power returns, retentive variables resume with their last-known values instead of resetting to defaults. Non-retentive memory, by contrast, resets all values to zero or initial state on every power-up.

**Why Retentive Memory Matters:** Without retentive memory, a PLC would lose critical data every time power is interrupted — production counts would reset, recipe parameters would disappear, and machine positions would be unknown. Retentive memory ensures operational continuity.

**What Should Be Retentive vs Non-Retentive:**

| Make Retentive | Keep Non-Retentive | |---------------|--------------------| | Production counters & batch totals | Temporary calculation variables | | Recipe parameters & setpoints | Bit flags for one-shot logic | | Alarm acknowledgment states | Timer accumulators (usually) | | Machine calibration offsets | Outputs and output coils | | Hour meters & maintenance counters | Intermediate math results | | Last-known positions | Sequencer step flags (depends on application) |

**Retentive Memory by PLC Brand:**

- **Allen-Bradley (Logix5000):** All controller-scoped tags are retentive by default. Program-scoped tags can be set retentive or non-retentive. Use the 'Retentive' checkbox in tag properties. C-type bits (counters) and timers use the .ACC (accumulator) value retentively. - **Siemens (TIA Portal / S7-1200/1500):** Use 'Retain' keyword in Data Block variable declarations. Merker (M) memory can be configured as retentive in hardware configuration. DB variables default to non-retentive unless marked otherwise. - **CODESYS:** Add the 'RETAIN' keyword before variable declarations: `VAR RETAIN totalParts : DINT := 0; END_VAR`. For variables that must survive even a warm restart, use `VAR PERSISTENT`. - **Schneider (EcoStruxure / Unity Pro):** Configure retentive memory areas in the Memory Configuration tab. %MW variables can be assigned to retentive zones.

**Common Mistakes with Retentive Memory:** 1. Making everything retentive 'just in case' — this wastes battery-backed memory and can cause stale data bugs after maintenance. 2. Forgetting to make production counters retentive, causing data loss on power blips. 3. Not accounting for retentive memory during PLC firmware updates or program downloads — some platforms clear retentive memory on full download. 4. Confusing 'retentive timer' (RTO/TONR) with retentive memory — an RTO timer retains its accumulated time, but that is a timer function, not a memory classification.

Why It Matters

Understanding Retentive Memory is important in PLC programming and industrial automation. This concept plays a vital role in:

  • Industrial process control
  • Machine automation
  • System monitoring and diagnostics
  • Data processing and management

Mastering this important concept will enhance your ability to design, implement, and troubleshoot industrial automation systems effectively.

Real-World Use Cases

Retentive Memory is applied across various industrial automation scenarios:

Industrial process control

Machine automation

System monitoring and diagnostics

Data processing and management

Practical Examples

Here are real-world examples of how Retentive Memory is implemented in industrial settings:

1

Using Retentive Memory in a packaging machine control system for product handling and quality inspection

2

Implementation of Retentive Memory in HVAC control for optimizing energy consumption and comfort

Pro Tip: These examples demonstrate common implementation patterns. Adapt them to your specific application requirements and PLC platform.

Common Questions

What is Retentive Memory?

Retentive memory means PLC data memory that preserves its value across power cycles, processor restarts, and program transitions to STOP mode. Battery-backed RAM or non-volatile flash holds the data; non-retentive memory is cleared on power-up.

When should I use Retentive Memory?

Retentive Memory is particularly useful in scenarios such as Industrial process control and Machine automation. Consider implementing it when you need reliable, efficient solutions for these types of applications.

What are related concepts I should learn?

To fully understand Retentive Memory, you should also familiarize yourself with PLC (Programmable Logic Controller), Scan Cycle, and CPU (Central Processing Unit). These concepts work together in industrial automation systems.

Was this helpful?

Let us know if this glossary term helped you understand Retentive Memory better.

Your feedback helps us improve our glossary and create better content for the PLC programming community.

Quick Info

Difficulty
Intermediate
Tier
Important

About PLC Fundamentals

Core concepts and hardware components of programmable logic controllers

Total Terms:35
Difficulty:Beginner to Intermediate

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch real machine scenarios react. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →