Must the operation of a PLC (programmable logic controller) be halted while its logic is being changed or can new logic be downloaded to it during runtime, without memory loss, giving a seamless transition from one operation cycle to other?
The function you are looking is called online change (e.g. Beckhoff Online Change), at least by some PLC Manufacturers. If you change a few blocks (in case of FBD) or a few contacts (in case of LAD) or a few lines of code (in case of IL or ST) you can do it online by most major PLC manufacturers. (Siemens, Beckhoff and the Codesys world has this functionality). Usually you can only change or add some blocks or owerwrite memory addresses. Adding new (large) program parts usually requires arestart. You can only use this functionality if you have the exact version of the PLC program which is running on the PLC.
The sequence is not exactly as you mentioned. You have to open the PLC Program in the IDE and go online (in monitoring mode) with the running PLC. Now you can change blocks and apply the changes. Diffrent PLCs from different manufacurers behave differently, but if you have to press "upload" (or dowload) to PLC button or similar in most cases it will loose data stored in volatile memory.
I would advise to always make a test first with that specific PLC and IDE (same version and firmware if possible) if memory is lost before attempting to change a live system (where critical data can be lost) this way!
Further example: Siemens S7-200 Edit in Run Mode:
Definitely possible on +90% of modern PLC's (example, Allen-Bradley compactlogix permits but Allen-Bradley micrologix 1500 does not) with some limitations. Normally just modifying existing logic is feasible, sometimes with a test mode, however modifying memory allocation or hardware configuration is locked until the plc is out of run state.
Normally online changes actually write the new module elsewhere in the controller memory and make the program jump over the old one. Over time the program can become fragmented, which usually has a negligible impact but limits the amount of online changes that can be done in a controller without a 'clean up' or 'rebuild all', finally requiring a plc stop and full download.