There is a capacitor on the CPU module that will maintain the RAM memory for as much as a half hour while the battery on the power supply is disconnected. Some CPU modules also have a plug where you can attach a battery directly.
Some CPU modules have flash memory and some support EPROM memory.
In any case it will be in your best interest to make a backup copy including the values of all variables before you change the power supply.