4002

Nc retain data error (persistent data)

Beckhoff · TwinCAT 2 NC

What does 4002 mean?

An error occurred while loading the NC retain data, which stores persistent configuration and state information. This results in affected axes losing their reference (status flag 'Homed' set to FALSE) and can be caused by missing, expired, corrupt, or inconsistent retain data. Loss of this data means the machine will need to be re-homed and potentially re-configured.

Common Causes

  • Corruption of the non-volatile memory (NVRAM or flash) where retain data is stored.
  • Interrupted power supply or sudden power loss during an NC retain data write operation.
  • Incorrect shutdown procedure or power failure causing incomplete data writes to persistent storage.
  • Firmware bug affecting the retain data management or storage routines.
  • Attempting to load retain data saved with an incompatible or older firmware version.

Repair Steps & Checklist

Click steps to track your progress.

  1. 1

    1. Cycle power to the NC controller, ensuring a complete, controlled shutdown and restart.

  2. 2

    2. Check the NC controller's internal battery (if equipped) for NVRAM backup, measure voltage (e.g., 3.0VDC minimum).

  3. 3

    3. Re-initialize the NC retain data from a backup file (e.g., 'nc_retain.bak') if a compatible version exists.

  4. 4

    4. Re-home all affected axes manually after the NC reboots (e.g., execute G74 reference move command).

  5. 5

    5. Update NC firmware to the latest stable version to address potential data handling bugs.

  6. 6

    6. Verify NC parameters related to retain data storage and persistence (e.g., P9-10 'RetainSaveInterval').

Browse all codes in this manual (60)
Verified technical data. Last updated: March 2026

Related Faults