MCR instruction.

Elcan

Lifetime Supporting Member
Join Date
Apr 2008
Location
NC
Posts
935
Hello All,
I would like your thoughts about the MCR instruction. I mean, do you use it? Do you think there are better alternatives to it?

I don't use it in particular (but I've seen it used in some old programs at my job place), and the other day I heard a programmer (not from my company) saying that the MCR is "old school". I'm just being curious.

Thank you!

PS: I use RSLogix 500 and 5000.
 
I have not used it and never seen it used. My guess someone saw it in the manual and thought that is the way it's supposed to be done.

If you want to kill power to something then hardwire it.
 
I have never used it it 25 years. I think it is a holdover from the earlier days of ladder logic. There's nothing wrong in using it, except that it gets abused. I think it's much harder to debug code using a MCR beacause you always have to worry if your in the MCR zone or not and whether it's active. Just my $0.02.
 
I only used MCRs in Allen Bradley once. It was in my intro to PLCs course back in college. The instructor showed us how to use it to make a step sequence similar to Step 7 Graph. Each "Step" was contained in an MCR, which had a bit that was Latched true by conditions from the previous Step's MCR zone. Some reset and first scan logic was required to set the conditions for the first zone.

All in all, it wasn't that hard to follow, and looked pretty good in the end. It was just a lot of logic for a simple sequence.

I learned logic initially that way, but I have never used them in any real life programs.
 
I would like your thoughts about the MCR instruction.
I think that the MCR (Master Control Relay) was an effort to simulate in software what electrical designers were doing in hardware: creating a relay safety device that kills all output power when it is OFF. Maybe they thought the MCR instruction could take the place of hard-wired master relays.

In retrospect, Allen Bradley and other PLC developers could have saved the cost of the effort. If designers, engineers, and safety regulators trusted software programs to control critical safety items, then they would not have needed external safety devices. But they don't, and now with newer safety rules, the MCR program instruction is even more of a dodo bird, a curiosity from an earlier, simpler time.
 
I have only ever used it once. It was in a PLC that did not support subroutines at that time.

This day and age the use of subroutines is probably a better solution.

I echo the sentiment that it can make debugging difficult if you are not aware they are in the program.
 
It's used to stop the PLC from scanning a group of ladder logic rungs.

WRONG !!

sorry to be blunt, but that is a total misunderstanding of what MCR does.

MCR instructions are used in pairs, the first will be a conditional rung that is used to "enable" the MCR "zone", the second will be unconditional, to terminate the MCR zone.

Inside the "zone", your rungs of code will always be executed, but when the zone starting rung is false, the rungs are executed with the power rail false.

That means that all non-retentive outputs (OTE's) are turned off.

But it also means that TONs are reset, RTOs will freeze, and TOFs will start timing !!

And you get it blind - none of the software packages has the ability to show you that the power-rail is turned off by a false MCR rung, so it's hard to see what is happening.

When I was with a Systems Integrator, I banned the use of MCR completely.
 
You ever read a thread and see something stated incorrectly and keep reading and reading hoping someone will correct it? Thanks Daba!!

It is a common misunderstanding that the MCR "skips" rungs. I always explain it as:

"It makes the rung false regardless of the actual conditions. The outputs do, whatever it is they normally do when they are false. What does a latch do when it is false? Nothing. What does an OTE do? it turns it's bit off."

And I explain the timers much as Daba did.

MCRs can be handy for disabling an entire section or "zone" of logic. I can program a sort of kill switch or dead-man switch that can instantly take down a piece of equipment and essentially override it's normal logic. For example, I can program a kill switch and when that switch is triggered, a piece of equipment will shut down and even if the operator tries to restart it, the kill switch overrides it.

Using subroutines I have to be very aware of the "last state" condition and program for it. By default, if I stop calling a subroutine, the outputs in that subroutine remain in their last state. I have to make sure in my program that I program it so those outputs reset.

Now, as mentioned, the MCR can be a troubleshooting nightmare as there is nothing in the display that tells you that that code you are looking at is within an MCR zone. But, the same could be said for a subroutine. When looking at logic in a subroutine, nothing tells you that the subroutine is being scanned or skipped.

Frankly I think both subroutines and MCRs (as well as JMP/LBL) can cause headaches when troubleshooting. I think that these days, most programmers are inclined to go the subroutine route.

Just keep in mind that NOT calling a subroutine is very different than what the MCR does.

OG
 
Actually, Mitsubishi MCR's do show the lefthand rail broken if the MCR is inactive. And I think (think) that the MCR normally open on the rail follows you down as you scroll to remind you that you are still in the MCR zone.
 
You ever read a thread and see something stated incorrectly and keep reading and reading hoping someone will correct it? Thanks Daba!!

It is a common misunderstanding that the MCR "skips" rungs. I always explain it as:

"It makes the rung false regardless of the actual conditions. The outputs do, whatever it is they normally do when they are false. What does a latch do when it is false? Nothing. What does an OTE do? it turns it's bit off."

And I explain the timers much as Daba did.

MCRs can be handy for disabling an entire section or "zone" of logic. I can program a sort of kill switch or dead-man switch that can instantly take down a piece of equipment and essentially override it's normal logic. For example, I can program a kill switch and when that switch is triggered, a piece of equipment will shut down and even if the operator tries to restart it, the kill switch overrides it.

Using subroutines I have to be very aware of the "last state" condition and program for it. By default, if I stop calling a subroutine, the outputs in that subroutine remain in their last state. I have to make sure in my program that I program it so those outputs reset.

Now, as mentioned, the MCR can be a troubleshooting nightmare as there is nothing in the display that tells you that that code you are looking at is within an MCR zone. But, the same could be said for a subroutine. When looking at logic in a subroutine, nothing tells you that the subroutine is being scanned or skipped.

Frankly I think both subroutines and MCRs (as well as JMP/LBL) can cause headaches when troubleshooting. I think that these days, most programmers are inclined to go the subroutine route.

Just keep in mind that NOT calling a subroutine is very different than what the MCR does.

OG

Hi OG, I assume that part of this was directed towards me. Although I never said that the function of of MCR is identical to that of not executing a subroutine I can see where you might have got that impression after re-reading what I posted. So yes, I agree with everything you say above. In the only Instance I ever used one, it was simply to pause the execution of an integer based sequencer I had without putting an interlock in each and every network. In the context of how the code was written, It did what it needed to do. I believe I programmed it with some sort of hand held device, it was a long time ago.

And I liked it so much, that I never used it again.
 
Damian, I was actually referring to David90's comment and a common misunderstanding of what the MCR does.

Your comments were more about the application of the MCR, which was what the OP asked about, and I agree completely with what you've said.

OG
 
Last edited:

Similar Topics

Hello, I need some help to convert PMCR instruction from Omron CQM1H that using CQM1H-SCB41 to CJ2M using CJ1W-SCU4, The problem is on the old...
Replies
1
Views
848
What instruction does CCW use for the MCR instruction from RSLogix500? I read in numerous places that CCW does not have an instruction like the MCR
Replies
10
Views
2,743
I've upgraded an older RSLogix project from v19 to v32. It seems v32 is a little more picky about the old code. I have 1 error that states "MCR...
Replies
3
Views
1,784
I've encountered what , to me, is a programming oddity/rarity. In a small Micrologix program, the OEM programmer has user an MCR at the start and...
Replies
5
Views
2,236
where we are using the MCR INSRTUCTION PLEASE PROVIDIE THE SAMPLE PROGRAM IN RS LOGIX 500
Replies
1
Views
1,457
Back
Top Bottom