Replace the battery when the programmable controller is powered off.
For example, for the FX3U/FX3UC series, data will be held for about 20 seconds after being powered off.
Replace the battery within this time.
Please note that battery replacement operations differ depending on the type of the programmable controller used.