ArticleslgStudy

science

Ladder logic

Ladder logic is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Ladder logic rather than just read about it. In short: Ladder logic was originally a written method to document the design and construction of relay racks as used in manufacturing and process control. Each device in the relay rack would be represented by a symbol on the ladder diagram with connections between those devices shown.

Ladder logic — main illustration
Ladder logic — illustration

Key takeaways

  • Ladder logic belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Ladder logic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Ladder logic from memory before moving on to harder problems.

Reference excerpt

Ladder logic was originally a written method to document the design and construction of relay racks as used in manufacturing and process control. Each device in the relay rack would be represented by a symbol on the ladder diagram with connections between those devices shown. In addition, other items external to the relay rack such as pumps, heaters, and so forth would also be shown on the ladder diagram. Ladder logic has evolved into a programming language that represents a program by a graphical diagram based on the circuit diagrams of relay logic hardware. Ladder logic is used to develop software for programmable logic controllers (PLCs) used in industrial control applications. 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 diagrams were once the only way to record programmable controller programs, but today, other forms are standardized in IEC 61131-3. For example, instead of the graphical ladder logic form, there is a language called Structured text, which is similar to C, within the IEC 61131-3 standard.

Overview

Ladder logic is widely used to program PLCs, where sequential control of a process or manufacturing operation is required. Ladder logic is useful for simple but critical control systems or for reworking old hardwired relay circuits. As programmable logic controllers became more sophisticated it has also been used in very complex automation systems. Often the ladder logic program is used in conjunction with a human–machine interface (HMI) program operating on a computer workstation. The motivation for representing sequential control logic in a ladder diagram was to allow factory engineers and technicians to develop software without additional training to learn a language such as FORTRAN or other general-purpose computer language. Development and maintenance were simplified because of the resemblance to familiar relay hardware systems. Implementations of ladder logic may have characteristics, such as sequential execution and support for control flow features, that make the analogy to hardware somewhat inaccurate. Ladder logic can be thought of as a rule-based language rather than a procedural language. A "rung" in the ladder represents a rule. When implemented with relays and other electro-mechanical devices, the various rules execute simultaneously and immediately. When implemented in a programmable logic controller, the rules are typically executed sequentially by software in a continuous loop, or "scan". By executing the loop fast enough, typically many times per second, the effect of simultaneous and immediate execution is achieved. Proper use of programmable controllers requires an understanding of the limitations of the execution order of rungs.

Syntax and examples The language itself can be seen as a set of connections between logical checkers (contacts) and actuators (coils). When a path exists from the left side of the rung to the output through asserted (true or "closed") contacts, the rung is considered true, and the output coil storage bit is set to 1 or (true). If no such path exists, the output is false (0), and the "coil" by analogy to electromechanical relays is considered "de-energized". This analogy between logical propositions and relay contact status was established by Claude Shannon. Ladder logic has contacts that make or break circuits to control coils. Each coil or contact corresponds to the status of a single bit in the programmable controller's memory. Unlike electromechanical relays, a ladder program can refer any number of times to the status of a single bit, equivalent to a relay with an indefinitely large number of contacts. So-called "contacts" may refer to physical ("hard") inputs to the programmable controller from physical devices such as pushbuttons and limit switches via an integrated or external input module, or may represent the status of internal storage bits which may be generated elsewhere in the program. Each rung of ladder language typically has one coil at the far right. Some manufacturers may allow more than one output coil on a rung.

Rung input Checkers (contacts) Rung output Actuators (coils) The "coil" (output of a rung) may represent a physical output which operates some device connected to the programmable controller, or may represent an internal storage bit for use elsewhere in the program. A way to recall these is to imagine the checkers (contacts) as a push button input, and the actuators (coils) as a light bulb output. The presence of a slash within the checkers or actuators would indicate the default state of the device at rest.

Logical AND

The above realizes the function: Door motor = Key switch 1 AND Key switch 2 This circuit shows two key switches that security guards might use to activate an electric motor on a bank vault door. When the normally open contacts of both switches close, electricity is able to flow to the motor which opens the door.

Logical AND with NOT

The above realizes the function: Door motor = Close door AND NOT Obstruction. This circuit shows a push button that closes a door and an obstruction detector that senses if something is in the way of the closing door. When the normally open push button contact closes and the normally closed (NC) obstruction detector is closed (no obstruction detected), electricity is able to flow to the motor which closes the door.

Logical OR

The above realizes the function: Unlock = Interior unlock OR Exterior unlock This circuit shows the two things that can trigger a car's power door locks. The remote receiver is always powered. The unlock solenoid gets power when either set of contacts is closed.

Industrial STOP/START In common industrial latching start/stop logic, we have a "Start" button to turn on a motor contactor, and a "Stop" button to turn off the contactor. When the "Start" button is pushed the input goes true, via the "Stop" button NC contact. When the "Run" input becomes true the seal-in "Run" NO contact in parallel with the "Start" NO contact will close maintaining the input logic true (latched or sealed-in). After the circuit is latched the "Stop" button may be pushed causing its NC contact to open and consequently the input to go false. The "Run" NO contact then opens and the circuit logic returns to its inactive state.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Ladder logic

Start with the simplest possible case. Write down what Ladder logic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Ladder logic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Ladder logic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Ladder logic

In research
Ladder logic appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Ladder logic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Ladder logic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Electronic design automation, Programmable logic controllers, Visual programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Ladder logic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Ladder logic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Ladder logic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Ladder logic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Ladder logic in simple terms?

Ladder logic was originally a written method to document the design and construction of relay racks as used in manufacturing and process control. Each device in the relay rack would be represented by a symbol on the ladder diagram with connections between those devices shown.

Why does Ladder logic matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Ladder logic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Ladder logic.

Tags

  • Electronic design automation
  • Programmable logic controllers
  • Visual programming languages

Keep exploring