Technical Article

PLC CPU Modes Explained: Run, Stop, and Program

September 18, 2023 by David Peterson

A PLC can be placed in Run or Stop, or occasionally Program mode, usually through physical or virtual methods. But what do these modes mean, and when should they be used?

Programming a PLC is a tricky business, no doubt about that. Setting the ladder logic, memory addressing, and communication protocols aside, there is a separate matter of actually downloading and executing the program on the CPU. While performing those steps, the PLC may toggle itself between running modes, but why do we have these different modes, and why/when would you need to manually change the mode yourself?

 

Loading Programs to Memory (Stop Mode)

Downloading and executing are two different processes entirely, even if they seem to be done at the same time. When overwriting the existing memory of the PLC with a new program, it can be done in its entirety (the whole program is loaded, regardless of how small the revisions might be) while a more efficient process compares the loaded program and new program, then only updating the parts with changes. Regardless of which process is used, the execution of the program presents a challenge.

 

PLC with only Run and Stop modes

Figure 1. A PLC with only Run and Stop modes as physical switch options. Author’s image

 

A PLC devotes its working execution memory to three tasks: reading the input registers, comparing and calculating the logic processes in the text or ladder rungs, and then finally updating the output registers. To load a program, there must be a temporary halt in reading the program while the new information is loaded, and for this process, the CPU places itself into Stop mode.

 

What Does Stop Mode Actually Do?

When the CPU is in Stop mode, it will continue to register input signals being energized. You will still see the input module LEDs illuminating when a sensor/button is energized. You will also see any input instructions in the ladder logic reflecting their real-world state as long as a monitoring function is enabled. However, in stop mode, the CPU is not executing the logic, and it is not updating any outputs. In other words, it’s just watching and waiting, it’s not doing anything.

Do not confuse Stop mode with either Off or Pause. The PLC is certainly still running, and when placed back in run mode, it will restart the logic and initialize any variables/tags as if it were being powered up.

 

Faults (Stop Mode)

A number of fault conditions can place the CPU in Stop mode. Not all faults can initiate a stop, but all CPU-related major faults will force a stop. If the CPU does not detect an I/O module, this may simply be an I/O fault and will not force a stop, but most events which will trigger a red “fault” LED on the processor will likely also be reflected in a stop event. Once faults are cleared, the PLC may require a manual rest back to Run in order to begin executing the program again.

 

Executing Logic in Run Mode

If the previous section about the Stop mode makes sense, understanding the next mode should be easy. Since the running mode can usually be toggled with either the software or a switch, it is important to understand when you can, and when you cannot perform each action.

The manual switch on the CPU will always place the PLC in Stop mode, no matter what the software says – sort of like an emergency stop button. Placing the switch back into run mode will be effective, but only if the software is also placing the program into run mode.

 

Online vs operating mode selections

Figure 2. Online/offline connections (green) differ entirely from the operating mode selection (red). Author’s image

 

Can’t I just Go Offline to Stop the PLC?

Changing the mode remotely from the software requires being online with the PLC. If you “disconnect” from the PLC, it will NOT place the PLC in Stop mode. Furthermore, you will no longer be able to change modes remotely at all until the connection is re-established. Going offline will absolutely not stop the PLC from executing commands.

 

Are There More than Three Operation Modes?

Not all PLCs have the same two operating modes; Rockwell PLCs, in particular, are known for their three-mode selection options appearing on the physical CPU toggle switch: Prog, Run, and Rem (remote run). However, Rockwell’s Studio and Logix Designer environments have a different set of three modes (see Fig 2): Program, Run, and Test… But what do toggling those actions mean?

 

Run mode as contrasted to remote run mode

Figure 3. Run, Rem, and Prog allow the user to lock out or allow online edits, or to place the PLC in stop mode. Author’s image

 

So far, we have been calling Stop mode Program mode. This allows the PLC to have the program loaded, but also stops execution of the program inside the CPU. In other words, Prog is the same as Stop for other brands.

 

What is Different Between Run and Remote Run Modes?

By selecting either the toggle switch (smaller CompactLogix) or key (ControlLogix) on the front of the Rockwell CPU, system engineers can determine whether or not the CPU is locked from any remote changes or online edits. Run mode restricts the CPU to not allow online editing of the program. More often than not, the PLC should be left in Rem mode which will still execute the program, but won’t allow edits from the online connection. Monitoring of tags and logic may still be done in Run mode.

If the PLC is functioning correctly, via an established online connection, but you are unable to make any program edits, then verify that the key/switch is in Rem mode.

Another point to note, the software IDE in this case will show Run mode, regardless of whether the key/switch is in Run or Prog on the actual PLC itself.

This can appear under other terminology as well. For example, on some Direct Logic PLCs, the switch allows a Term position, or “remote terminal,” which allows online edits, while Run provides a read-only mode for monitoring, but with no changes.

 

Terminal or 'term' mode to program online

Figure 4. Term mode means the same as Rem, which allows the PLC to accept online edits. Author’s image

 

What is Different Between Program and Test Modes?

Test mode can be thought of as a combination of program mode (where the outputs are not energized, but mixed with run mode), where the logic is actually executed. If you energize the real-world input devices, the ladder rungs will execute, but the outputs will not energize.

This mode is not the same as a simulator, as any subsequent rungs that require the output to energize will not execute properly since, well, those outputs never actually energized. It is good for testing and verifying one rung at a time before running the machine.

 

Other PLC Modes and Functions

Some PLCs offer a third option where the switch on the CPU is not an operation mode itself, but rather a reset function to clear faults or to install parameters after major hardware updates. This is usually indicated with a Reset as a switch position (Mitsubishi Q-Series CPUs, for example).

 

Reset switch position on some PLCs

Figure 5. A third Reset position, as shown on some PLCs. Author’s image

 

Although this guide to PLC modes is not comprehensive in its coverage of every operating mode available to PLCs, it should be sufficient to define the major operation modes of commonly specified PLCs. Regardless, equipped with these basics, systems engineers and operators can apply best practices to troubleshoot and prevent downtime that comes from programming PLC correctly the first time.

 

Featured image (modified) used courtesy of Adobe Stock