Master Control Relay (MCR) in Siemens S7 PLCs: Practical Use

David Krause12 min read
HMI ProgrammingSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview of the Master Control Relay (MCR) Instruction in Siemens S7

The Master Control Relay (MCR) instruction in Siemens SIMATIC S7-300, S7-400, and S7-200 controllers is a program-control function that conditionally enables or disables a defined zone of ladder logic. The MCR zone is delimited by a pair of instructions: MCRA / MCRD activate and deactivate the MCR mechanism, while MCR( and )MCR mark the start and end of a stack-nested sub-zone. Inside an active MCR zone, the RLO (Result of Logic Operation) is written to the MCR stack. When the MCR bit is FALSE, every assignment inside the zone is forced off, timers do not run, counters freeze, and jump-distribution outputs are reset.

Although the S7-Help describes MCR in detail, the instruction is rarely required in modern applications. The majority of control logic can be written by adding an explicit enable condition to the rung instead of relying on a global relay. This article consolidates the operational behavior, a working ladder example, the documented safety limitations, and the recommended alternatives.

Safety advisory: MCR is not a substitute for a hard-wired Emergency Stop (E-Stop) relay, a fail-safe PLC, or a safety-integrated (F-CPU) architecture. Emergency Stop functions shall be implemented with a safety relay, a failsafe CPU, or a certified safety PLC linked via PROFINET/PROFIsafe to the standard controller. Treat MCR purely as a programming convenience for non-safety control zones.

MCR Stack Mechanics and the MCR Stack Pointer

The S7 CPU maintains a dedicated MCR stack that is one byte wide and up to eight levels deep. Every MCR( instruction pushes the current RLO of the master rung onto the stack; every )MCR pops the stack. The stack pointer increments with each MCRA / MCR( pair and decrements on MCRD / )MCR. Nesting depth is therefore limited to eight zones; exceeding this depth triggers a CPU fault (typically a "MCR stack overflow" diagnostic buffer entry on S7-300/400, OB121 priority-class error).

Instruction Mnemonic (STL) Effect
Activate MCR MCRA Switches on the MCR mechanism for the block in which it is executed.
Deactivate MCR MCRD Switches off the MCR mechanism.
Open MCR zone MCR( Pushes current RLO onto MCR stack; defines start of nested zone.
Close MCR zone )MCR Pops MCR stack; defines end of nested zone.

When the MCR bit (the RLO of the master control rung) is FALSE, the following rules apply inside the active zone:

  • All = assignments write a 0 to the assigned bit, byte, word, or double word.
  • All S (set) instructions are not executed; latched bits remain in their previous state.
  • All R (reset) instructions are not executed; latched bits are not cleared.
  • Timers (SP, SE, SD, SS, SF, SR) do not start; running timers stop counting but retain their current value.
  • Counters (CU, CD, CUD) are inhibited; no count pulses are accepted.
  • Jump functions (JMP to JMPN) inside the MCR zone are not executed.
  • Master control relays do not affect FC/FB calls or arithmetic instructions; only memory assignments are masked.

Distinguishing the Program Instruction from the Hardware Master Control Relay

The hardware Master Control Relay is a discrete device defined in IEC 60204-1 as a hard-wired contactor that removes power from the machine actuators when the E-stop, guard interlock, or thermal overload trips. It is independent of the PLC; it sits in series with the motor contactors and is reset by deliberate operator action. The MCR is part of the IEC 60204 "Stop categories" taxonomy:

Stop Category Action Reset
Category 0 Uncontrolled stop by immediate removal of power. Manual.
Category 1 Controlled stop with power maintained until stop is achieved, then power removed. Manual.
Category 2 Controlled stop with power retained to actuators. Manual or auto.

The software MCR instruction described in this article is a different artifact. It is a programming primitive that masks output writes, and it should never be confused with the hardware safety relay mandated by IEC 60204-1 clause 9.2.5.4.

Prerequisites for Using MCR in S7-300/400

  1. STEP 7 V5.5 or TIA Portal V13 or later (MCR is available in both editors for S7-300/400 targets).
  2. The block being edited (OB, FC, FB) must contain both MCRA and MCRD; without the activation pair, MCR( and )MCR are ignored.
  3. CPU firmware must support the instruction set. All S7-300 CPUs (CPU 312 to CPU 319) and all S7-400 CPUs (CPU 412 to CPU 417) support MCR. S7-1500 CPUs do not support MCR; it has been removed from the TIA Portal instruction set for S7-1200/1500 targets.
  4. Project compilation should be checked for "MCR nesting too deep" warnings (STEP 7 emits a warning at nine or more nested zones).

Step-by-Step Ladder Example (FBD/LAD)

The example below implements a permissive-controlled discharge station. Output Q 0.0 (Conveyor Run) and timer T1 (Dwell Time) operate only when both the main enable I 0.0 and the zone permission I 0.1 are TRUE. Loss of either signal freezes the outputs without resetting the latched "Cycle Complete" flag M 10.0.

Network 1 — Activate MCR and define master rung

|  MCRA   |   -- Activate MCR mechanism
|  I 0.0  |   -- Main enable (TRUE = MCR bit = 1)
|  I 0.1  |   -- Zone permission
|  MCR(   |   -- Open nested zone (pushes RLO onto MCR stack)

Network 2 — Standard MCR-masked output

|  I 0.2  |   -- Run request
|  T1     |   -- Dwell done
|  =  Q 0.0   -- Conveyor run, MCR-masked assignment

Network 3 — Timer that stops when MCR is FALSE

|  I 0.3  |   -- Start dwell
|  SP T1  |   -- Pulse timer, MCR-masked
|  T#5s   |
|  )MCR   |   -- Close nested zone (pop MCR stack)
|  MCRD   |   -- Deactivate MCR mechanism

If I 0.0 drops, the MCR bit becomes FALSE. Inside the zone Q 0.0 is forced to 0 on every cycle, T1 stops counting, and any set latches (S M 10.0) are left untouched. When the MCR bit returns to TRUE, normal program execution resumes from the current state of the latches and the frozen timer value.

STL (Statement List) Equivalent

      A     I 0.0        // Main enable
      A     I 0.1        // Zone permission
      MCRA               // Activate MCR
      MCR(               // Open nested zone (RLO pushed)
      A     I 0.2        // Run request
      A     T1           // Dwell done
      =     Q 0.0        // Conveyor run (MCR-masked)
      A     I 0.3        // Start dwell
      L     S5T#5S       // 5 second pulse
      SP    T1           // Pulse timer (MCR-masked)
      )MCR               // Close nested zone
      MCRD               // Deactivate MCR

Why MCR Is Considered Misleading in Service Situations

Field experience, particularly on S7-300 systems commissioned in the late 1990s and early 2000s, has highlighted several operational issues that make MCR undesirable for service technicians:

  • Hidden enable state: A rung whose conditions are all TRUE may still not set the output because the enclosing MCR is FALSE. The logic appears correct in the editor but behaves contrary to the visible inputs.
  • Asymmetric handling of set and reset: While = writes are forced to 0, S and R are inhibited, so latched bits do not follow the masked behavior. Engineers expect a "relay off" to clear latched bits; MCR does not.
  • No visibility in cross-reference: The MCR bit is typically held in a single shared flag (for example, M 0.0). Standard cross-reference tools do not propagate that flag into the affected rungs, so the impact of a faulty MCR is non-local.
  • Stack corruption from block boundaries: If MCRA is in OB1 and MCRD is inside a called FC, the stack is left dirty when the FC returns. This produces intermittent "MCR stack overflow" faults in the diagnostic buffer that are difficult to reproduce.
  • Defensive program scan cost: Each MCR( pushes an entry that the CPU must monitor on every scan, increasing execution time on larger zones.

Modern Alternatives to MCR

For S7-300/400 projects that have not yet been migrated, and for new S7-1200/1500 developments, the following patterns replace MCR cleanly:

Use case MCR approach Recommended replacement
Zone enable / disable MCR( / )MCR around outputs Add the enable bit as a series contact in every rung or use a global "Zone_OK" tag that gates an FC.
Conditional output reset Rely on MCR forcing = to 0 Use explicit R (reset) coil driven by the enable bit, or write := 0 in an FC.
Conditional timer start SP timer inside MCR zone Place the enable contact in series with the timer's enable input.
Selective skip of large sections Wrap whole FC in MCR Use CALL conditional on the enable, or use jump labels JMP / JMPN.
Migration to S7-1500 Convert MCR( / )MCR Use GRAPH or the new "Enable" input on FB instances; TIA Portal does not synthesize MCR.

Safety Architecture: Why E-Stop Must Not Use MCR

  1. Single-channel dependence: MCR is software-only; a CPU fault, a memory corruption event, or a watchdog reset can leave the MCR bit in an undefined state.
  2. Common-cause failures: The same CPU, backplane, and program that run production also evaluate the MCR. A short circuit, a programming error, or a firmware bug disables the safety function in parallel with the controlled process.
  3. Diagnostic coverage: A standard PLC does not perform cross-checking of its own I/O, its program flow, and its memory. Safety-integrated CPUs (S7-1500F, S7-300F, ET 200S F-modules) execute a second, diverse program on a redundant channel and detect discrepancies within the required proof-test interval.
  4. Reset semantics: IEC 60204-1 clause 9.2.5.8 requires that the reset of a safety stop shall not initiate a restart. MCR does not prevent a downstream rung from restarting the machine when the MCR bit returns to TRUE.

The accepted architecture is to install a hardware E-stop relay (for example, a Pilz PNOZ s4, Sick UE10, or Siemens Sirius 3SK1) that physically interrupts the contactor coils. For larger installations with many E-stops, a dedicated safety PLC such as the Siemens SIMATIC F-CPU (S7-1500F), a Sick Flexi Soft, or a Pilz PMCprotego S-Link exchanges safety telegrams over PROFINET/PROFIsafe or PROFIsafe-over-PROFIBUS with the standard CPU. Two-channel E-stop contacts are wired directly to the safety inputs of the safety PLC, and a single PROFIsafe bit is then published to the standard program for indication. This eliminates the daisy-chain wiring of E-stops and gives the safety controller full diagnostics of each device.

Field Commissioning Checklist for MCR Zones

If MCR is retained in a legacy S7-300/400 project, verify the following during commissioning:

  1. Confirm MCRA / MCRD are paired within the same block; cross-check the cross-reference for unbalanced pairs.
  2. Watch the diagnostic buffer online with STEP 7 "Monitor/Modify" and verify there are no MCR-stack overflow entries (event ID 0x2542 on S7-300, 0x4570 on S7-400).
  3. Force the MCR bit FALSE and verify every masked output, timer, and counter behaves as expected. Document the results in the commissioning report.
  4. Verify that the MCR bit is not derived from any safety-relevant input (E-stop, guard interlock, two-hand control, muting lamp). If it is, redesign the safety chain.
  5. Confirm the nesting depth never exceeds 8, including the implicit level created by MCRA.
  6. Ensure latched bits inside the zone are explicitly reset on the MCR recovery transition, otherwise production will resume with stale state.

Troubleshooting Matrix for MCR-Related Faults

Symptom Diagnostic buffer entry Root cause Corrective action
Output never sets despite TRUE conditions None MCR bit is FALSE; enclosing MCRA not activated or master rung is FALSE Add the enable bit explicitly to the rung instead of relying on MCR.
CPU goes to STOP on first scan 0x2542 / 0x4570 (MCR stack overflow) More than 8 nested MCR( instructions Reduce nesting or refactor to series enable conditions.
Latched outputs re-energise on power-up None MCR zone masks R instructions; bits retain last value Insert explicit R outside the MCR zone on startup.
Timer freezes mid-count None Timer is inside an MCR zone and the MCR bit dropped Move timer enable to a series contact.
Intermittent OB121 errors after block call OB121 programming error Unbalanced MCRA/MCRD across block boundary Keep both instructions in the same block, or remove MCR entirely.
Cross-reference does not list a clearly-affected output None Cross-reference does not follow MCR bit to downstream rungs Use the "Program Structure" view or add the MCR bit as a series contact.

Migration Path: S7-300/400 to S7-1500

When an S7-300/400 program is ported to an S7-1500 (or any S7-1200) target, TIA Portal flags every MCRA / MCRD / MCR( / )MCR as "instruction not available". The conversion tool offers no automatic replacement. The recommended migration pattern is:

  1. Search for MCRA / MCRD with the cross-reference tool; mark every MCR zone in the source project.
  2. For each zone, identify the MCR enable bit and add it as a series contact on every affected rung, or move the gated logic to a separate FC that is called conditionally.
  3. Convert SP/SE/SD/SS timers inside the zone to the new IEC timer TP / TON / TOF with an explicit enable input.
  4. Replace CU/CD/CUD counters with CTU/CTD/CTUD IEC blocks that take the same enable condition.
  5. Run the TIA Portal "Consistency Check" and download to the new CPU; verify against the original commissioning report.

Reference to Official Documentation

The MCR instruction is described in the STEP 7 "Programming with STEP 7" manual and the S7-300/400 system manuals. For SIMATIC controllers and the Rockwell FactoryTalk Design Studio instruction set, the public reference page is Master Control Reset (MCR) in FactoryTalk Design Studio which documents the equivalent MCR concept for Allen-Bradley Logix Designer. The functional-safety perspective is documented in the IEC 60204-1 "Safety of machinery — Electrical equipment of machines" standard, available from IEC, and in Siemens application notes for the S7-1500F / ET 200SP F modules.

FAQ

What is the MCR instruction in Siemens S7 PLCs?

The MCR (Master Control Relay) instruction is a program-control primitive in S7-300/S7-400 CPUs that conditionally masks all output assignments, timer starts, counter pulses, and jumps inside a defined zone. It is bracketed by MCRA / MCRD and can be nested up to eight levels with MCR( / )MCR.

Can MCR be used to implement an Emergency Stop in a Siemens PLC?

No. MCR is a non-safety software function on a standard CPU. Emergency Stop shall be implemented with a hardware E-stop relay, a fail-safe CPU (S7-1500F / S7-300F), or a dedicated safety PLC exchanging PROFIsafe telegrams over PROFINET or PROFIBUS. MCR must never be the only element between an E-stop button and a contactor coil.

Why do outputs inside an MCR zone not reset when the MCR bit goes FALSE?

MCR only forces = (write 0) assignments; it inhibits S and R instructions, and it leaves latched bit memories untouched. Any "stuck-on" condition is therefore caused by a set latch inside the zone, not by MCR itself. Use explicit reset coils outside the MCR zone to clear latches on deactivation.

Is MCR supported on S7-1200 and S7-1500 CPUs?

No. MCR was removed from the S7-1200/1500 instruction set in TIA Portal. Programs migrated from S7-300/400 must be refactored to use explicit enable contacts, conditional FC calls, or jump labels. TIA Portal will flag any leftover MCRA as "instruction not available" during the consistency check.

What is the maximum MCR nesting depth, and what happens if it is exceeded?

The MCR stack is eight entries wide, so up to eight nested MCR( / )MCR pairs are allowed inside an active MCRA / MCRD block. Exceeding this depth on S7-300/400 raises an OB121 programming error (diagnostic buffer event 0x2542 on S7-300, 0x4570 on S7-400) and may stop the CPU. Reduce nesting or replace MCR with explicit enable conditions.

Back to blog