PLC retentive memory preserves selected runtime values through defined events, such as a power interruption or a supported restart. It does not mean that every value survives every reset, download or controller replacement. The exact CPU, runtime, memory mechanism and application configuration determine what remains. Specify retention by variable and by event, then test the installed controller. A retained production total may be useful after power returns; a retained run request must not be assumed to authorize machine movement.
For a control-cabinet project, retention is an acceptance requirement connecting process data, maintenance and startup behavior. Treat it separately from a backup of the PLC program, because a project file and the latest operating values are different records.
The PLC cabinet overview places the controller within the wider panel, power and field-device arrangement. Retention requirements should be reviewed across that complete system.
Define what must survive and why
Start with the process consequence of losing each value. A batch identifier, accumulated volume, approved recipe or maintenance counter may need continuity. Temporary calculations, communications flags and current sensor readings often need to be refreshed. Retaining everything can preserve stale conditions that no longer represent the physical machine.
Write a variable register containing the tag name, meaning, units, valid range, owner and required lifetime. Identify who may change or reset it. For example, clearing a maintenance counter should be a deliberate recorded action rather than a side effect of a routine software update. A production total may need a separate business record even if the PLC retains its local copy.
The industrial PLC control cabinet is a relevant LINECOME product for discussing an automation specification. Its external construction does not establish the installed CPU, retained capacity, battery arrangement or startup program. Require those details in the cabinet’s approved component list and software documentation before accepting a retention promise.

Separate runtime data from the program backup
The application program describes what the controller does. Runtime data describes the current or accumulated state while it operates. An offline project can contain initial values without containing the latest total, recipe changes or batch progress. Restoring that project may therefore restore logic while losing the current operating context.
The PLC program backup guide covers the recovery package for software and configuration. Add a distinct runtime-data policy where the process requires one. Define how values are captured, how their age is identified, and who checks them before restoration. A backup that was valid last month may contain obsolete process values even when its program version still matches.
Also distinguish retention from logging. A retained variable may contain only the most recent value. It does not necessarily provide a history of who changed it, a timestamped event sequence or a recoverable previous version. If the customer requires audit records, specify the logging system and retention period explicitly rather than assuming the PLC’s retained memory provides them.
Use the controller’s event definitions
Power cycling, changing between STOP and RUN, resetting memory and downloading an application are different events. Their names and effects vary by platform. A successful ordinary power-cycle test should not be reported as proof that retained values survive a firmware update, reset to factory state or hardware replacement.
As a platform-specific example, the CODESYS data-persistence documentation distinguishes RETAIN from persistent variables and shows different responses to warm reset, cold reset and download. This illustrates why an event matrix is necessary. Apply the definitions and hardware requirements for the actual cabinet’s CPU and runtime; do not copy CODESYS behavior to an unrelated controller.
The physical retention mechanism also matters. A battery, nonvolatile memory, buffered memory or supported shutdown process may be involved. A battery shown in a parts list could serve a clock or another function. Verify what it actually supports, how health is reported, and what maintenance is required. Do not promise indefinite retention from an assumed storage mechanism.
Build a variable-by-event acceptance matrix
The table below is a project specification template, not a universal PLC behavior chart. Fill in the expected result using the exact controller manual and approved process design before testing.
| Variable group | Question for the designer | Evidence to record |
|---|---|---|
| Recipe or operator setpoint | Must the latest approved value survive a normal outage? | Before/after value, version and validation result |
| Production total | Is continuity required, and where is the independent record? | Total, units, timestamp and reconciliation rule |
| Sequence step | Can the physical process safely resume from this step? | Recovery decision and verified plant conditions |
| Run request | What fresh permission is required after startup? | Startup state and absence of unintended movement |
| Sensor value | When does the reading become fresh and valid? | Update event, quality status and initial handling |
| Communication status | How are stale remote data rejected? | Reconnection sequence and freshness check |
| Service counter | Who may clear or restore the counter? | Access control, reset action and resulting value |
For each group, add columns for the events that the contract actually requires: normal power loss, supported restart, approved application update and recovery from a replacement CPU. Do not perform destructive reset or update tests on production equipment without an approved recovery plan and authorization.
Keep stored state separate from permission to run
A saved sequence number says where the software previously was; it does not establish where every valve, axis or workpiece is now. During an outage, pressure can decay, material can move, a drive can coast and an operator can change the machine condition. On startup, the controller needs an approved method to reconcile stored information with actual inputs and process conditions.
The required response depends on the machine risk assessment. It may involve a recovery state, operator acknowledgement or a controlled reinitialization. Ordinary PLC retention must not replace a required safety function. The cabinet emergency-stop reset guide discusses restart prevention as a separate control requirement that remains relevant even when retained values are correct.
Similarly, a timer that retains its accumulated value does not by itself define how elapsed real time during an outage should be handled. Ask whether a process timer should pause, restart, expire based on a clock or force operator review. Those are process decisions. They cannot be inferred merely from the use of a retentive timer instruction.
Test without overwriting the evidence
Save the current application, parameter information and relevant data before testing. Identify representative variables and enter distinguishable, permitted test values in a controlled environment. Record the expected result for each event and include valid ranges and units. Avoid testing with zeros everywhere, because a reset-to-zero error would then appear to be a successful retention result.
After the planned interruption or restart, capture values before an HMI, recipe server or startup routine rewrites them. Otherwise, the test may accidentally demonstrate that an external device restored data rather than that the PLC retained it. Time-aligned records help distinguish initial memory state, initialization logic, remote writes and the first accepted sensor update.
Check outputs and process behavior as well as values. The software can preserve a number correctly while using it incorrectly during startup. Record whether motion remained inhibited until the required permission, whether stale readings were rejected and whether the operator received the expected recovery information. The acceptance result needs both data continuity and correct process response.

Account for downloads and changes to data structure
Persistent data can depend on a compatible declaration or stored-data layout. Changing a variable name, type or structure may affect restoration. The CODESYS persistent-variable reference documents implementation details and limitations, including why pointer-based persistent data requires special care. These are platform examples, not instructions for every controller.
For an application update, define a migration plan: which values are carried forward, which are deliberately reset, how values are checked against the new version and how an unsuccessful update is recovered. A pressure setpoint valid for the old instrument range may be wrong after a sensor change even when the stored numerical value is perfectly preserved.
The engineering team should record the software version and data-schema version together where migration matters. Keep the update procedure clear enough that a maintenance engineer can tell whether a value was restored, initialized or rejected. Silent substitution of a default may keep the program running while hiding a process configuration error.
Investigate unexpected loss methodically
Begin with the event timeline. Was there an ordinary power outage, a brownout, a cold reset, a download, a CPU replacement or a storage mismatch? Ask whether all retained variables changed or only one group. Examine startup code, HMI writes and remote recipe downloads before concluding that the memory hardware failed.
Review the power path if the evidence points to unstable supply. The PLC cabinet 24 V voltage-drop guide addresses measurement locations and load effects. A memory-retention investigation and a power-quality investigation may overlap, but one does not establish the other. Preserve diagnostics and the original application before changing the retention configuration.
If a buffer device or storage component needs maintenance, follow the exact manufacturer’s procedure. Replacement may have conditions concerning supply state, data preservation and approved parts. A generic battery-changing instruction can destroy the very data the team wants to protect. After authorized maintenance, repeat the relevant acceptance cases and update the service record.
Specify retention in the cabinet enquiry
Provide a variable list with required events, process consequences and acceptable recovery behavior. Ask the supplier to identify the CPU and runtime, available retained capacity, configured usage, storage mechanism, health indications and relevant maintenance instructions. Include update and replacement scenarios where continuity is business-critical.
The handover should include the completed event matrix, before/after evidence, version information, permitted reset actions and the runtime-data recovery procedure. Operators need to know what a recovery warning means and when to stop for engineering review. Maintenance needs a tested procedure rather than a broad statement that the cabinet “remembers everything.”
Further learning: PLC hardware and memory
The RealPars lesson below introduces PLC components, including the CPU and memory. It helps explain where program execution and data fit in a controller; the installed CPU manual and the project’s acceptance matrix determine actual retention behavior.
Video by RealPars. Watch What are the Different Parts of a PLC? on YouTube.
Frequently asked questions
Is a latched bit automatically retained through power loss?
No. A latch describes program behavior; power-loss retention depends on the variable’s storage and controller configuration. Check the exact platform and test the required event rather than relying on the instruction’s name.
Does retentive memory replace a PLC backup?
No. Retained runtime values and a recoverable program package serve different purposes. Hardware damage, resets or incompatible changes can still require independent software and data recovery records.
Should a PLC retain the last run command?
That decision belongs to the approved machine control and risk assessment. A stored request must not be treated as sufficient permission for hazardous movement. Verify the required startup checks, interlocks and fresh operating authorization.





