Programming Practices that make your blood boil

brstilson

Member
Join Date
Jul 2012
Location
Michigan
Posts
241
Obviously every instruction is in a PLC for a reason, and there are situations in which using them is needed.

But I cannot stand it when people use the MCR (Master Control Reset) instruction in a SLC/Logix program. I understand their use and how powerful they are, but I've found they trip me up more often than not. Especially when you have multiple MCR sections in a ladder file. I'd rather use a rung with all of my "Okay to run" conditions in series, and then use that internal register to enable each individual output rung. It's not that big of a deal, but it can cost you a few minutes if you're trying to figure out why the OTx instruction isn't lighting up even though the rung is true and it's not a double coil.
 
I tend to agree. The MCR instruction strikes me as a solution seeking a nonexistent problem. I've never felt the need to use an MCR, and I don't think that the trade-off of strange timer behavior for the ability to render outputs false within a "zone" is a good bargain. It might have made sense back in the old days when the typical PLC had very scant memory resources available and one was required to squeeze their logic down to the bare minimum in order to remain within memory limitations. That just isn't the case any longer with modern PLCs.
 
I'd agree, that the difficulties with MCR's limit their merit. Personally, a very simple solution that I cannot believe that AB is not implemented, is to simply highlight the left side of the rung in red, or grey out the section or similar if a section of ladder is not being scanned. Then I would use MCR's a lot.
 
I agree with the MCR, also jumps and labels, and conditional returns within ladders. Pretty much anything that stops select rungs of a ladder from ever being executed. As Bit_bucket said, I understand their use on PLCs with limited resources, but the whole idea defeats the very basic PLC scan operation I learned in school and just seems wrong to me.

I was taught how to make sequence logic in RSLogix 500 by using a set of MCRs for each step and creating "zones" that were only active when the step was active. It worked, and since it was my first ever PLC instruction I thought that was the way to do it. My first project in the real world my boss told me "No." and showed me a different way to do it.

I don't care from conditional subroutine jumps, but I have used them and do accept them more than the other methods. I don't ever use JSR outside of the main ladder.
 
I remember the first time I used a conditional subroutine jump. Imagine my surprise when the outputs stayed on even though the rung was "disabled." That was the day my notion that a PLC program acts like an electrical circuit died.

The worst thing about MCR in my opinion is that it's called "MCR." It gives the false impression that a PLC can be a safety device. An inexperienced programmer will see that and think "Oh, it's a Master Control Relay built right into the program! I don't have to make a hardwired safety circuit!"
 
Last edited:
I agree with the MCR, also jumps and labels, and conditional returns within ladders. Pretty much anything that stops select rungs of a ladder from ever being executed. As Bit_bucket said, I understand their use on PLCs with limited resources, but the whole idea defeats the very basic PLC scan operation I learned in school and just seems wrong to me.

I was taught how to make sequence logic in RSLogix 500 by using a set of MCRs for each step and creating "zones" that were only active when the step was active. It worked, and since it was my first ever PLC instruction I thought that was the way to do it. My first project in the real world my boss told me "No." and showed me a different way to do it.

I don't care from conditional subroutine jumps, but I have used them and do accept them more than the other methods. I don't ever use JSR outside of the main ladder.

I like using an integer as an indexer when I do step-by-step cycles. It tells me right away, no matter where in the program I am, where I'm stuck.
 
OH, and I can't stand bit shifts. At least when they're used in an application that doesn't need them. I can see their need in an application like a car wash or a machine that has more than one part going through the cycle at the same time. Otherwise, in my opinion you're just writing a "Look what I can do!" program.
 
Using absolute addressing (instead of symbolic) to access temporary local variables in Siemens S7
 
The MCR actually still evaluates the preceding conditions, prior to reaching the output on the rung, the only thing different here is that the outputs are forced off. It does in a sense have a similarity to an actual master control relay device where if that relay is denergized all devices in that circuit go off, so I can see why they called it an MCR, but it can definitely throw you off if your debugging code and your wondering why the outputs are not on when the permissives are true. It can probably be useful for debugging or testing when you want certain outputs off instead of like using an AFI instruction
 
OH, and I can't stand bit shifts.

I understand the frustration with MCR, been there, but why bit shift :confused:, although I have been using less of it now a days, - tends to stick with word shift, as it allows me to convey a lot of data with a word.

Regards
 

Similar Topics

Hello colleagues, Some time ago I started my adventure with programming. With your help and the courses, things are starting to come together...
Replies
13
Views
599
I've been doing PLC programming for about 15 years now but all of my experience has been with Allen-Bradley PLC's. A few months ago I started a...
Replies
5
Views
3,116
I'll start. Name coils with their true state. For example, if the photo eye is light operate, make the coil PE Clear. That way, when you see the...
Replies
72
Views
24,997
Hi All - I have a system that I am setting up with about 50 axes of motion. There are 10 stations total where 9 of them are exactly the same. I...
Replies
0
Views
1,373
If I have a program that requires 10 different PID loops should I 10 different period tasks (using RSLogix5000)?
Replies
4
Views
2,333
Back
Top Bottom