As others have said it would be helpful if we knew who manufactured the PLC and what model it was.
Having said that some older units used batteries to keep power to the volatile memory that stored the program, while the power is off. These required regular replacement and may be the problem you are having.
If you can supply us with the details requested then we may be able to give a more definitive answer.
__________________
An elephant is a mouse built to government specifications.
It's important to know what kind of PLC do you use, because if you use an xc100 CPU from Moeller, after you transfer the program to PLC, it's mandatory to do "Create boot object" in PLC menu. If you do not this, your program will be erase when the power supply it's down.
Just measure the battery voltage level (if it there 10%!!! voltage drop try to replace the battery), reset the PLC. if the case is repeated see the PLC user manual for simple help. PLC is too reliable machine.
I agree with everyone else, it's important to know what brand of PLC you have.
Most PLCs use a combination of memory systems. EPROM is used for system memory and factory defaults, although some systems allow you to burn a custome EPROM chip (assuming you have an EPROM burner). But EPROM is too slow for decent PLC operation, so RAM is used for speed. RAM however is volatile, it loses it's state when power is removed so it must be kept active via a battery in the case of a power failure. As most people have mentioned above, a dead battery will be the likely culprit there. Many older PLCs had options for non-volatile EEPROM or newer ines use Flash memory, which will automatically load your program into the RAM on power-up. But if you didn't actively store the program to that EEPROM or Flash chip, it does no good (as noted above). So even if you have EEPROM or Flash memory, you still had to take action to store your program to it or it does no good. In some PLCs, such as the Allen Bradley SLC Series, you also had to set the hardware to pull memory from the EEPROM even if you had it and stored the program to it, otherwise it would have to be done manually after each shutdown.
__________________
** All I every really wanted to be, was... A LUMBERJACK!.**