Talk:Ladder logic

Trends in Use
There is no information here about who uses ladder logic in the sense of engineer demographics, a geographic sense, or controls company. I would like to see some discussion on that topic here. I would argue that ladder is all but dead outside of the US and within the US its use perpetuated almost exclusively by controls engineers over the age of 40 that grew up with Allen Bradly. I base that claim on my work in the industry in Germany, Austria, US, China, and various Latin and South American countries with several controls platforms. I have only seen ladder logic come out of US OEMs (not just on AB hardware), with everywhere else using IEC Structured Text, ANSI C, or automatic code generation from SimuLink. Within the US, ladder seems to only be used if the customer or OEM is or was dealing heavily with AB products. In addition, young engineers (nearly all of them proficient in text based programming regardless of their degree) seem to universally dislike ladder, even years after becoming proficient with it. In the US, I've seen integrators (whose engineers tend to be younger) quote 20% more to write a project in ladder vs a text based language and OEMs pay it. In Europe I have seen customers walk away from US OEMs that won't program in IEC ST or ANSI C.

I think the days of programming like you're using relays and coils are just about over; the new blood hates it, it takes longer, and the old blood is retiring. Companies still generating ladder code are setting themselves up for support issues down the road when they have to train new engineers in a language no one uses anymore for machines that aren't really that old. 173.67.240.90 (talk) 16:12, 25 April 2011 (UTC)Felix
 * You know what to do. Cite it and write it. --Wtshymanski (talk) 17:36, 25 April 2011 (UTC)

The analogy between logical propositions and relay contact status is due to Shannon I would say Mr. Bool (Boolean algebra) plus Mr. de Morgan (de Morgan's laws) would be here more appropriate.

...I put in a few extra details and had a bit of a hack around- let me know if you want me to expand it some more - Scampiandchips

Language or Tool?
Seems to me this is more of a programming tool than a language. It's about as much a programming language as a television remote.

if you want...
...I could take some screen shots of your logic as implemented in Rockwell programming software and post 'em here...

nand?
is this

---[\]---[\]---       X     Y

really X NAND Y ?

isn't it (NOT X) AND (NOT Y) which actually means X NOR Y?

''Yes, you're right. Fixed.''

standard contact symbols?
The article currently has a mix of contact symbols: --[ ]--    X

--| |--    Y

--][--   Z

They all mean the same thing, right?

Should we standardize on one type ? The  seems least likely to interfere with Wikipedia formatting (so we don't need   tags).

(Note that the  "coil symbol" at the right of the rung is *supposed* to look different -- it does mean something different).

--DavidCary 18:06, 25 Jun 2005 (UTC)

Agreed - I'll admit I was a bit confused by all the different symbols to begin with.--Rehnn83 14:10, 22 September 2006 (UTC)

Normally Open COIL?
What the heck does this mean? A coil is just an electomagnet. It can have contacts that are NO or NC but it can't be either. right? TomCerul 18:11, 3 August 2005 (UTC)
 * This is probably better called a "not" coil - if a not coil is energized by a rung, its normally-open contacts are open and its normally-closed contacts are closed (a regular coil will have NO closing and NC opening). I ran across this on a Reliance Automate 35, where it was extensively used to save memory - though it made the resulting programs very hard to read (especially so as there was no documentation or variable names displayed by the programming panel that could have alerted you to the weirdness). I had to write my own documentation software for that machine as we only had the one and the manufacturer didn't support anything better. I'll see if I can fix the text in the article. --Wtshymanski 17:41, 4 August 2005 (UTC)
 * I agree, it's a NOT coil. The proper use of NOT coils arises from the concept of "failsafe". One example is in machine tools. There is a circuit called an E-STOP string. All of the safety elements on the machine will have a set of NC contacts and be wired in series. The hydraulic pressure is NOT too low. The safety gates are NOT open. The drawbar that holds the cutter is NOT loose. If NO contacts were used, the control wouldn't be able to tell if a wire in the string were broken. In the old days, the string would control a relay. The output of that relay would go immediatly to another relay to be negated. Seán 03:51, 13 March 2006 (UTC)
 * Odd. We did failsafe design but we'd just use the other set of contacts on the relay. We ended up saying "Normally Open, Held Closed" a lot. TomCerul 21:36, 20 September 2007 (UTC)

I agree with TomCerul - a "normally open coil" is a misnomer. Coils are neither open or closed. It's the contacts that are normally open or normally closed.

I don't think the terminology in the present version of the "Example of Sample Ladder Logic Program" section is right. "Regular contact" to me is a "normally open contact" and the "not contact" is what I would call a "normally closed contact." I've never seen a not coil although that doesn't mean some LL version doesn't have it. I don't think RSLogic or Modsoft had one. There maybe places where such terminology is used by I haven't seen them. PhanuelB (talk) 16:06, 29 August 2010 (UTC)

Latch Example
Someone added something to the last example on latches, and it sounds contradictory. It should be fixed for consistency. I'm pretty sure the first start/stop button figure is accurate. - ninjayeti

I believe the -- (stop) button should be reversed: -(/)- otherwise it doesn't seem to make sense. 209.217.120.155 (talk) 20:11, 26 January 2009 (UTC)
 * Don't change it. Read the description. The physical button is wired on an NC contact. The PLC input is energized until someone pushes the button. When a thoughtful reader understands this, he/she will have gone a long way toward understanding what PLC programming is like. --Wtshymanski (talk) 21:21, 26 January 2009 (UTC)


 * The whole concept of ladder logic and the use of relay contact symbols in the logic ladder to "test" the state of the input the contact is representing is not the physical way the device is wired (as in the case of a normally closed STOP button) but how you want to test it. The test for a normally closed STOP button is an ON test and thus it passes the logic power when not pushed and breaks the logic when pushed OFF. I use the NO-ON method for which ladder contact to use, ie when testing for an ON or closed state of the field device it is an NO contact, -| |--, for ON or NOON for short. This works very well to remember the right contact to use - Ian Hamilton-Walker, Process/PLC Trainer, Saudi Arabia. 23 March 2010.


 * The "run" rung is incorrect for ladder logic, according to the description (it would be correct for relay logic, however). When the stop button is in the normal state, meaning the circuit is closed, the input of the PLC is on (under the assumption that the circuit is directly wired to the PLC's input).  This means that the stop contact should be shown as a normally open contact in the logic so that the stop button circuit must be opened, which turns off the PLC's input, in order to break the latch.  I'm drawing from years of experience as a PLC programmer...  Sept. 9, 2011

EDIT: I fixed this -- it's showing correctly now. — Preceding unsigned comment added by 174.52.215.172 (talk) 22:21, 9 September 2011 (UTC)
 * Fixed again. Four years on, and we still find the odd person not reading the hidden comments. Perhaps these changes come from poeple who've never been called at 1 AM to come troubleshoot a problem with a PLC...it's a brutal but effective form of training. (One soon learns it's hardly ever the program that broke.) --Wtshymanski (talk) 14:22, 15 January 2013 (UTC)

I just came to this page and since I am learning ladder logic for the first time, I was also initially confused by the NC stop switch.
 * I've found a specific section in the reference "Chapter 6: ladder logic" by Tony R. Kuphaldt that clarified my understanding. About 80% through the page (search for "reversal of logic") he describes the change to the external wiring and ladder logic when the design is changed from a NO stop switch to a NC stop switch.  The point is that ladder logic operates on the inputs to the PLC, not on the pressed or released state of the device.
 * I believe most of the confusion stems from naming the input "stop" whether it is connected to a NO switch or a NC switch. Naming the input "stop" or "stop pressed" makes sense when a NO switch is connected to the "stop" input, and the NC contact controlled by the "stop" input is in series with the run coil.  The name "not stop" or "stop released" is clearer for when a NC switch is connected to the "not stop" input and the NO contact controlled by the "not stop" input is connected in series with the run coil.
 * I think there is a learning opportunity here for future readers. I would like to attempt to add a short explanation to the motor start-stop example to explain why the ladder logic is correct as presented.  This might improve understanding of this concept and end the incorrect revisions.
 * I will monitor this talk page for further comments before I proceed. This will be my first significant contribution to Wikipedia.  I am open for suggestions.

Asimovfan (talk) 01:32, 4 February 2013 (UTC)
 * This is a great example precisely because so many people seem to think it's wrong. Consider green normally open start button on bit 1 of the PLC, red normally closed stop button on bit 2. With nobody pressing any buttons, you'd see only bit 2's light on. Looking at the PLC program you'd see the NO symbols for bit 1 turned off, and the NO symbols for bit 2 turned ON.  If you press the green button on bit 1, the NO symbol in the PLC program is true, and the rung goes true. It stays true after the green button is released, until you press the red button.  Then the PLC bit 2 input goes low, and the normally-open PLC symbol is off, interrupting rung continuity (and stopping whatever was driven by the rung).  You don't really understand PLC symbols till you can understand this example. --Wtshymanski (talk) 23:26, 20 April 2013 (UTC)

Graphics
Just made a few minor changes and additions. I can make graphical examples of the ladder logic shown in the article. However, this would increase the load on the servers, and the present ASCI graphics seem to be sufficent. Also, I am considering re-writing the article to be more streamined and organized. Thoughts?Dudecon 18:26, 4 April 2007 (UTC)
 * Decent SVG graphics (or at least PNG) would be appreciated. I wouldn't worry about the server load. If you feel like fixing the article, do it. You might want to see the PNGs on the Spanish and Italian versions of the ladder logic page. —Pengo 09:31, 24 July 2007 (UTC)

Orientation of ladder diagrams
''The name is based on the observation that programs in this language resemble ladders, with two vertical "rails" and a series of horizontal "rungs" between them. Ladder logic is popular in North America while in Europe it is more common to draw horizontal rails along the top and bottom of the page and vertical rungs sequentially from left to right.''

Really? PLC programming software is not different (text localization aside) for American and European markets, and all the systems I've used (in Europe) draw and print out programs in the same way, with vertical rails. Horizontal rails are perhaps more common for electrical schematics in Europe, but no-one cares that ladder is drawn in the other orientation. --DavidHopwood 23:44, 28 August 2007 (UTC)

merge "relay logic" into "ladder logic"
What do you think about merging "relay logic" into "ladder logic"?

The "relay logic diagram" on the relay logic page looks almost exactly like one of the "ladder logic diagrams" on the ladder logic page.

As far as I can tell, the subtle difference between the 2 heavily overlapping terms is:
 * "relay logic" implies that something really is built with physical relays (almost always designed using "ladder logic" diagrams).
 * "ladder logic" is a style of schematic diagram, standardizing the layout of "relay switches" and "relay coils". Any particular ladder logic diagram could be implemented with physical relays, but nowadays is more often emulated with a microprocessor interpreting the diagram and simulating the relays.

In this case, the thing, the diagram describing the thing, and something else that simulates that thing, seem closely related enough to cover all in one article.

--68.0.124.33 (talk) 16:47, 19 February 2008 (UTC)

I do not think it is a good idea to merge relay logic with ladder logic, since they are two distinct applications of control theory. Ladder logic is used primarily for PLC applications and represents one of four main programming methods for PLC. Ladder logic is restricted to very basic symbology for device representation (i.e. coils and contacts for outputs and inputs). Relay logic is used to graphically represent a control circuit schematic diagram and utilizes a much wider array of symbolic references (i.e. motors, solenoid valves, etc.) Carl142 (talk) 17:12, 25 February 2008 (UTC)

Retrieved from "http://en.wikipedia.org/wiki/Talk:Relay_logic"

If one is a restricted form of the other, then I think we should merge them -- in the same way that "hicube boxcar" is one kind of boxcar, and both are described in the same encyclopedia article. --68.0.124.33 (talk) 23:00, 24 March 2008 (UTC)

Relay logic is not a restricted form of ladder logic. They are completely different entities. One is a hardwired, traditional method of control interface, while the other is a software programming language requiring a microprocessor-based control system. There have been countless books written on this subject by authors such as Simpson, Stenerson, Petruzella, and every one of them concurs that relay logic and ladder logic are completely separate examples of control system technology. Merging them would not only create confusion, but it would be highly inaccurate.38chad (talk) 13:04, 26 March 2008 (UTC)

No merge. A computer language and logic family are different things. Ray Van De Walker (talk) 19:30, 3 April 2008 (UTC)

No merge. Agreed. Ladder logic != relay logic. I can write a program for an L63 processor, but I can't wire an enclosure. That's the difference in my eyes. You folk who actually know what you're doing can handle the relays and switches, us juniors can do the programming. Tarkaan (talk) 10:17, 11 May 2008 (UTC)

Absolutely agree with all of you guys above - don't merge. Just because they LOOK the same, doesn't follow that they MEAN the same!!! However, what _can_ be appropiate would be to add a note somewhere in relay logic saying that the syntax of the ladder language has been highly inspired by relay logic, or something like that, as that is really the case. Or just mention ladder under "See also" in that article. 130.237.57.80 (talk) 14:55, 16 May 2008 (UTC)

The "not" symbol
So far, in the examples on this page, you've been using --[\]-- as a NOT, when all the ladder packaged I have used (DirectSoft, AllenBradley..) use a forward slash, as in --[/]--. Even the example picture uses forward slashes for NOT. Should this be fixed? --Mainstreetmark (talk) 18:48, 20 May 2008 (UTC)

I have taken courses on the subject and ladder logic and relay logic are 2 different things it would be like comparing the programming language C+ to a circuit board —Preceding unsigned comment added by 209.53.64.16 (talk) 17:38, 13 March 2009 (UTC)

Example of a Simple Ladder Logic Program
I added a a couple of words to the descriptions of the normally open and normally closed contact instruction descriptions. Contact instructions are controlled not only by coil instructions whose addresses they bear, but by input signals as well. A minor addition, of course. —Preceding unsigned comment added by Jharris693 (talk • contribs) 16:09, 30 July 2010 (UTC)

Ladder logic symbols
Our resident edit warrior Wtshymanski keeps altering the diagram for the Industrial start/stop logic to the following (my red emphasis)

--+[ ]--+--- -[ ]- ---   |   start |   stop    run |        |                     +[ ]--+                          run ---[ ]--        run             motor

It is not clear why he keeps altering the the stop button symbol to that for a normally open contact. The edit summaries suggest that Wtshymanski believes that the "-[\]-" symbol is not the ladder logic symbol for a NC contact (he actually said so). There is also his alteration of the embedded comment where he reworded it to say, "If you change the NO stop to NC, the arrangement won't work. The stop button is physically wired as a closed contact". What does Wtshymanski believe that a 'normally closed' contact is if it is not wired as a 'closed contact'?

It would seem rather pointless to use the same symbol for both a NO and NC contact as that would mean that the diagram would be essentially useless, as no one would be able to figure out which contact was which. Although obvious in this example, it would not be so obvious on a very complex logic system using a large number of buttons. Ladder logic diagrams were developed in response to the increasing complexity of programmable logic devices, but the logic depicted could be implemented in relay logic if one felt the urge. Indeed the start/stop switch example is still often implemented using two push buttons and a relay (or contactor) using exactly the correct logic depicted below.

--+[ ]--+[\]   |   start |   stop    run |        |                     +[ ]--+                          run ---[ ]--        run             motor

Here: the stop button is correctly depicted as a normally closed contact, which is exactly what it has to be for the logic to work. Using Wtshymanski's normally open contact requires the operator to press both buttons to start the machine, but it will stop again the moment he releases the stop button.

Despite several editors restoring the correct version of the diagram, Wtshymanski went on to delete the statement in the text about the stop button being a normally closed contact with some cryptic edit summary about fixing the button to work with the program (?). The button was fine as it was. I B Wright (talk) 13:35, 4 July 2013 (UTC)


 * The good news is that instead of trying to re-insert his fringe pseudoscience with edit warring, he at least tried something else. It doesn't solve the basic problem, which is that Wtshymanski so often holds views that other editors -- sometimes a couple, sometimes dozens -- say is wrong and (this is important) he cannot find a source to support, but at least it isn't an immediately-blockable behavior like edit warring is.


 * Eventually this ongoing situation is going to result in some sort of administrator intervention, but until that happens the best thing you and I can do is to remain completely within Wikipedia guidelines and policies ourselves, I advise that anyone who deals with Wtshymanski carefully study Fringe theories and Requests for arbitration/Fringe science. Make sure that your own behavior is beyond reproach and encourage other participants to do the same. --Guy Macon (talk) 15:09, 4 July 2013 (UTC)


 * I do not see how producing a diagram using exactly the same symbols for operationally different devices can form any sort of 'fringe theory' (or have I missed something?). It is the equivalent of drawing a schematic for (say) a six transistor superhet receiver with just an empty rectangular box for every component in the set.  In this case, as far as I can see, Wtshymanski is just plain wrong.  It is not as though that has not happened before on more occasions than either of us care to count.  I B Wright (talk) 18:35, 4 July 2013 (UTC)


 * You might want to read Why Wikipedia cannot claim the earth is not flat for more insight on this. Just as we cannot say that the earth isn't flat, we cannot say that Wtshymanski's theories about the use of a normally open vs. normally closed pushbutton in that circuit are wrong. Instead we must treat them like we treat everything from Quantum Mechanics to Astrology; we evaluate how many reliable sources say that the circuit works as Wtshymanski claims it does (none found so far) and then we evaluate how widely-held the fringe theory is (apparently, nobody but Wtshymanski thinks that the circuit will work with a normally open stop button), apply Neutral point of view, and conclude that the theory has no place in Wikipedia. The burden is then upon Wtshymanski to either provide a citation to a reliable source that supports his theory, or a citation to a reliable source that shows that his theory is widely-held. This may seem strange, but that's how Wikipedia works, and with good reason; administrators who have no knowledge of ladder logic don't have to figure out who is right, just who has the consensus and who has the citations backing them up. --Guy Macon (talk) 21:46, 4 July 2013 (UTC)


 * I think the problem here is not so much anything to do with 'fringe theory' or anything like that, but more that Wtshymanski has not quite grasped what information the ladder logic diagram is really trying to convey. I think I can see what his thinking is.  Let my try to explain.


 * If we stick with the industrial start/stop example (as it is the one that is giving the problems), the START button interface with our programmable logic device (PLD) is easily created as follows (if my ASCII art works)

+V |  |            -   |            |   +---| |--+---| START |  |            -   |           | |  |     PLD R | | | | | |            -            |            |            -


 * Quite straight forward and using the normally open button switch shown in the original diagram. The STOP button is a NOT function and can be achieved either of two ways.

+V                                 +V |                                  |     |            -                  |            -   |            | ____                 |            |    +---|/|--+---| STOP                 +---| |--+--o| STOP |  |              or               |   | -  |                               -   |           | |  |     PLD                      | |  |     PLD R | | |                              | |  | | | |                              | |  |            -                                   -               |                                   |            |                                   |            -                                   -       (a)                                 (b)


 * In diagram (a) a normally closed button switch is used so that the (NOT STOP) input is held high until the button is pressed when the pull down resistor R pulls it low. That is: a logic true input to the (NOT STOP) is saying that we do not want the motor stopped.  An alternative configuration is shown at (b) where the STOP input to the PLD is made active low.  In this case, the pull down resistor R pulls the input low, until the button is pressed forcing it high.  In this case, the active low input means that when the input is low, we do not want the motor stopped (or taking it high stops the motor).   The NOT part of the function is thus obtained either from the choice of push button switch or the within the PLD itself by inverting the logic of the input.


 * Reading through much of the above, it seems that Wtshymanski may be treating the PLD as having an active low input which would therefore require a normally open push button switch (and is ammending the diagram to suit). It would also appear that Wtshymanski is not alone in this viewpoint as at least one other user (Asimovfan) has expressed a similar view.


 * The mistake here is to assume that the ladder logic diagram applies only to what is within the PLD itself and to ignore the outside world. This, of course, is not the case.  The ladder logic diagram (or indeed any logic diagram) serves to illustrate the complete logic system.  In this example the STOP function is a NOT STOP function and the diagram must reflect this if the guy implementing the design is to stand any chance of getting it right.  It is up to him to decide whether to implement it as in (a) or (b) above if there are no over-riding reasons why it should be one particular way.


 * To take the argument to a pedantic logical conclusion, the START function could be implemented like this.

+V |  |            -   |            | _____   +---|/|--+--o| START |  |            -   |           | |  |     PLD R | | | | | |            -            |            |            -
 * Here, the START input is now active low and thus a normally closed push button switch is required for the logic to work correctly. There is a NOT function in both the switch and the PLD.  They cancel each other and the system works correctly.  Using this argument, I could use the Wtshymanski logic and draw the full ladder diagram thus

---+---[/]---+---[ ]   |   start |   stop   run |        |                     +[ ]--+                          run ---[ ]--        run             motor


 * But this is just plain absurd and completely unclear as to what is going on. Although this simple diagram is easy to straighten out, a much more complex arrangement would be next to impossible.  DieSwartzPunkt (talk) 12:11, 5 July 2013 (UTC)


 * My only problem with your analysis is that one of the edit summaries made by Wtshymanski was, "wrong contact sense; the stop button is wired on a normally closed contact, so the PLC input is energized until you press the STOP button.". He was clearly thinking of your option (a) for the wiring of the stop button and therefore not the internal logic of the PLC.  It thus remains unclear why he kept substituting a normally open contact in the diagram when even his edit summary made it clear that he believed the contact was normally closed.  His embedded comment in the article of, "If you change the NO stop to NC, the arrangement won't work. The stop button is physically wired as a closed contact" does make it unclear what his thought process actually is.  I B Wright (talk) 12:38, 5 July 2013 (UTC)


 * In an ideal world, we would be able to discuss the above with Wtshymanski right here on the article talk page, figure out what he was thinking, and find a diagram/wording that everyone can agree on. Alas, as we have seen again and again, that isn't going to happen. Of course Wtshymanski could prove me wrong and start doing what WP:CONSENSUS tells us all to do, but I am not holding my breath. Because of this, when there is a clear consensus that Wtshymanski is wrong, our only option is to treat those particular edits the way the editors of our articles on astronomy treat contributions by an astrologer who refuses to discuss his edits. WP:FRINGE tells us what to in such a case. We must also take great care in case we are the ones who are wrong. Those cases are fairly easy to identify; when Wtshymanski is right, he provides citations to reliable sources backing up his theories. When he isn't, he fails to provide citations to reliable sources. There are a lot of sources that explain ladder logic. They all agree on how to diagram two momentary-contact pushbutton switches in series, they all agree on what the symbols are for normally-open and normally-closed, and the all agree on what happens when you wire two momentary-contact normally-open pushbutton switches in series and push one of them. Nothing happens. Thinking that something will happen is the phrenology of the ladder-logic universe. --Guy Macon (talk) 13:16, 5 July 2013 (UTC)

The door is always open for Wtshymanski to contribute to the discussion and present his supporting evidence. This will never change. However, to be fair to Wtshymanski, he has not been editing as regularly as he has in the past. It is therefore quite likely that he has not yet seen this thread and this could be why he has not responded. DieSwartzPunkt (talk) 14:43, 5 July 2013 (UTC)

A table
A rung of ladder logic. Let's simplify it. Remember, the button wired to start has a normally open contact, and the button wired to stop is using the normally closed contact.

--Wtshymanski (talk) 18:10, 6 July 2013 (UTC)


 * [I could not see why this all turned red, but I have managed to fix it.]


 * The problem here is that your table is incomplete, too complex but mostly wrong. As has been pointed out, both your altered logic and the above table gives the situation where it is necessary to press both buttons to start the motor, and it is necessary to hold the STOP button to keep it running.  The logic in your diagram above the table is mostly correct but with the RUN hold input missing.  But your table is not the truth table that goes with that diagram.  It is also completely unnecessary to document the inverse of the button presses.  It is also very necessary to consider the extra RUN input to see the complete operation. The correct diagram to consider is.

START   STOP  COIL --+--] [--+--]/[---  |       |   +--] [--+      RUN


 * And the correct table (with the switching sequence in chronological order) is.


 * You must remember that the STOP button contact being closed is the FALSE condition and its symbol is therefore "--]/[--" to indicate that NOT function from a closed contact being TRUE. I B Wright (talk) 10:45, 7 July 2013 (UTC)


 * No it's much simpler than that. I can see what Wtshymanski has done.  In his example above, he has inverted the logic of the STOP button twice.  Once where a normally closed contact has been used in the push button switch (this makes the STOP (as an input) TRUE when the button is released and FALSE when pressed).  But he has inverted it again in the truth table where he has considered the "Examine OFF --]/[--input 2" status as the inverse of the "Examine ON --] [-- input 2" and made the input FALSE when the button is not pressed and TRUE when pressed (the equivalent of using an active low STOP input so that a low input is NOT STOP).  The two inversions cancel each other out so his logic is

(START OR RUN) AND NOT (NOT STOP)     or     (START OR RUN) AND STOP


 * which is exactly what his truth table says but not what is required for the system to actually work. The '-]/[-' symbol means that the STOP function is inverted (or NOT STOP).  This can either be by use of a NC push button switch or by implementing an active low input (but not both).  Even if an active low input is used with a normally open push button switch, the symbol in the ladder rung is still '-]/[-' to indicate that the input has to be inverted somewhere.  The diagram is the logic of the functionality not necessarily the physical construction of the push button switches.


 * It should be noted that in this example, the use of "NOT STOP" does not necessarily mean that we want the system not stopped, but that, from the logic standpoint, the STOP input is FALSE when we do want it stopped. DieSwartzPunkt (talk) 12:02, 7 July 2013 (UTC)


 * Light bulb lights. That is a very good observation.  I looked at Wtshymanski's example above and immediately thought that something was obviously wrong with it, but totally failed to put my finger on it.  This was especially unforgiveable when I had actually provided the clue in my own post above when I provided a pedantic double inversion way of implementing the START function (redrawn for Wtshymanski's STOP here).

+V |  |            -   |            | ____   +---|/|--+--o| STOP |  |            -   |           | |  |     PLD R | | | | | |            -            |            |            - This will not work.


 * I believe that what confused me (and probably Wtshymanski as well) is the choice of STOP as the system variable for the stop function. It is immediately assumed that STOP=FALSE when the motor continues to run and STOP=TRUE when you want to stop it.  This might be the intuitive situation but not necessarily the situation in raw logic.  By having the STOP switch as a normally closed contact, the non intuitive STOP=FALSE when you want to stop the motor rules.  It might have been better to chose two arbitrary variable names such as (say) S1 and S2 where S1=START and S2=NOT STOP.  I B Wright (talk) 18:40, 7 July 2013 (UTC)

Consider the following (incorrect - it will not work) diagram:

START    STOP  COIL ---+---] [---+---] [------    |         | (Incorrect) +---] [---+        RUN

Assume that the three switches are physically normally open switches and that they are physically wired as shown.

Things to keep in mind:
 * ladder logic predates PLCs, and can be used to describe a system implemented with series connections, parallel connections, and relays.


 * An OR condition can be implemented with two switches going to two PLC inputs with the OR in the program, or the OR condition can be implemented with two normally-open switches in series going to one PLC input. The ladder logic describes the logic, not the implementation.

Looking at the (incorrect) diagram above, a key point is that the PLC has no way of knowing that a single button was pushed. You can make the PLC input low true or high true, and it will not change the basic fact that the input to the PLC stays the same when you push one button.

Now in the case where you use two PLC inputs and the OR is in software, you can make the system work properly by changing the software, but in that case you have an diagram that does not reflect what the system does unless you change it too. --Guy Macon (talk) 13:06, 7 July 2013 (UTC)


 * I think you might find that an OR function is implemented by two (or more) normally open switches in parallel. The same switches in series is an AND function.  Your fundamental point is entirely sound though.  I B Wright (talk) 18:40, 7 July 2013 (UTC)


 * (Homer Simpson voice) D'oh! You are right, of course. I think there is a rule that any time you write something and then carefully proofread it, it will contain a silly mistake that makes you look like an idiot. --Guy Macon (talk) 21:15, 7 July 2013 (UTC)
 * Now that we've wikified broadened the scope of the article to talk about wiring electromechanical relays as well as PLC programming, the description around the addition of the "emergency stop" button needs to be fixed to clarify what parts are software in the PLC and what parts are hardware. (If you are really concerned about a PLC stalling in mid-process, you would put your e-stop button as a hardware item between the contactor coil and its supply, not as just another bit in the PLC. If you have many contactors/outputs to de-energize in a hurry, you might have a hardware master control relay that controls power to the PLC outputs. This is far afield from the topic of this article, though.) We loosely speak of "contacts" as the examine on/examine off instructions in a PLC program, but if we're explaining hardware and software here, we need to be unambiguous between bits of metal clapping together and op-codes of a virtual machine.

We need a reference that the wiring for relay panels was called "ladder logic" before PLCs came along. I haven't read everything, but I don't recall reading this anywhere.

I also notice with delight that sacred consensus has finally agreed on the solution to XIC/XIO stop button PLC inputs that I suggested months ago; viz, get rid of the physical NC contact on the stop button. The system works! --Wtshymanski (talk) 16:42, 24 August 2013 (UTC)


 * The method of drawing the diagrams existed long before the term 'ladder logic' was coined to describe them. The symbols have evolved over the decades, but early diagrams using the method are recogniseably 'ladder logic' diagrams.  Because of this history, the diagrams are equally applicable to push button switches; relays and solid state logic devices.  DieSwartzPunkt (talk) 12:39, 25 August 2013 (UTC)

Text turning red on you?
See Help desk for an explanation. --Guy Macon (talk) 13:36, 7 July 2013 (UTC)


 * That explained thing - sort of. The text was black right up to where Wtshymanski added his section "A table".  There was nothing that I could see between the black text above his post and the red text in his post that would have made it red.  The only thing that sprung to mind was DieSwartzPunkt's sig being a red link but deleting it did not solve the problem.  Interestingly, deleting the " " from my ASCII art above turns all the subsequent text red (as expected) but only up to Wtshymanski's post which reverts to black (not expected).  Weird!  However using the suggested " " works.


 * I assume that Wtshymanski noticed it but also could not figure out how to correct it, otherwise he probably would have done so. I B Wright (talk) 18:54, 7 July 2013 (UTC)
 * I found another unclosed . Since is obsolete, I replaced it with font. I suspect the issue was caused by HTML Tidy attempting to fix the unclosed tags. --   Gadget850talk 19:15, 7 July 2013 (UTC)

Problems in section Industrial START/STOP
1. In this section, the narrative appears to refer to the parens as "inputs", where they are actually outputs, and are described as outputs in the earlier section defining the symbols. Example: 'When the "run" input becomes true the seal-in "run" NO contact in parallel with the "start" NO contact will'

2. The second diagram, at the end of the section, doesn't make sense. It's supposed to show a latching scenario, but to do so the contacts/input labelled "Run" would have to be controlled by the rung's output. However, unlike the first example in this section, the output is not labelled Run, it's labelled "Motor", so from a diagram point-of-view, has nothing to do with the Run contacts/input.

Gwideman (talk) 12:15, 10 July 2017 (UTC)

Additional Functionality Section - Statement in need of Clarification
Hi, I'm new here but I have a concern about one of the paragraphs under the "Additional Functionality" section. I think it may require further clarification.

The article states: "In this example, the system will count the number of times that the interior and remote unlock buttons are pressed. This information will be stored in memory locations A and B."

It then goes on to say: "Memory location C will hold the total number of times that the door has been unlocked electronically."

I believe that in this instance, it seems C will hold the total sum of the number of times that the remote unlock witch was closed, plus the total number of times that the interior unlock switch was closed.

If both switches must be simultaneously closed in order to open the door (not shown in example logic), then a counter to determine the number of times the door was opened would require different logic than just counting the sum of A and B...

To correct this, I would recommend including a disclaimer such as: "If both switches must be closed to electronically unlock the door, it should be assumed that the interior and remote locks are never switched closed independently from one another". Another solution would be to change the logic such that the counters are dependent on both switches being closed simultaneously, in which case, wouldn't it make more sense to just set a counter associated with the door unlock coil?

But then again, I could be very incorrect. I am just starting to learn about this (I currently have only read this wikipedia page for 5 minutes and skimmed over a description for a PLC Beginners E-Book)...