I agree with others, You use a relay output to one shot a hard timer relay (TOF) Time delay off that will switch of the power supply to the PLC for about 5 seconds and then change contact state back to normally closed.
To answer your question how it would turn back on, you use a TOF relay that takes a one shot trigger (the output from the PLC). So the trigger just tells the relay to change contact state immediately and then back after 5 seconds, and the relay still has external power for its internal control circuits. You can even use the same power supply used to power the PLC, just wire it to the relay power line and also to the contact the shuts off power to the PLC. If you want a wiring diagram just ask and I will write one up.
____________________________________________
Controls Engineer -CompTIA A+ Certified, Cisco CCNA Certified
SMP - S*X, Money, and PLC