LadderLogicOnline

Learn › Tutorials

Tutorial: the start/stop seal-in circuit

Press Start and a motor runs. Let go and it keeps running. Press Stop and it stops. This one rung, the seal-in circuit, is the most important pattern in ladder logic, and in this tutorial you'll build it and run it on a conveyor.

The problem it solves

Industrial push buttons are momentary: they're only "on" while your finger is on them. If you wire a Start button straight to a motor output, the motor runs only while the button is held, which is fine for a jog but useless for a conveyor that should run all shift.

The circuit needs a memory: once Start has been pressed, it should remember that the motor is supposed to run, until Stop is pressed. In the days of relay panels, electricians did this with an extra contact on the motor starter that "sealed in" around the Start button. Ladder logic copies the same idea, which is why it's still called a seal-in (or holding, or three-wire control) circuit.

What you need

Open the Playground. The conveyor scene's starter program is this exact circuit, so you can either study it or press New and build it yourself. These are the pieces:

TagTypeUsed for
StartBOOLGreen push button, normally open
StopBOOLRed push button, normally open (we'll change this later)
MotorBOOLThe conveyor's Forward bit

In the simulator, place two push buttons and a conveyor. Give the green button the tag Start and the red one Stop, both set to Normally open (on while pressed). Select the conveyor and type Motor as its Forward bit. Add a box spawner on the first cell of the conveyor with an auto-drop interval of a few seconds, so you have something to watch.

Step 1: Start and Stop

Start with the obvious part: the motor should run when Start is pressed and Stop is not.

 |   Start        Stop                       Motor   |
 |----] [---------]/[--------------------------( )----|
Not finished: the motor only runs while Start is held.

XIC Start is true while the button is pressed. XIO Stop is true while the Stop tag is off, that is, while nobody is pressing Stop. The two in series make an AND: Start pressed AND Stop not pressed. Run this and you'll see the conveyor only moves while you hold Start down.

Step 2: Seal it in

Now add the memory. Put a branch around the Start contact and, on the lower branch, an XIC Motor:

 |   Start        Stop                       Motor   |
 |----] [----+----]/[--------------------------( )----|
 |   Motor   |                                        |
 |----] [----+                                        |
The finished seal-in circuit.

To build the branch, select the Start contact and add a Branch (or press B), then drop an XIC on the new branch and type Motor as its tag. Make sure the branch closes back into the rung before the Stop contact, not after it.

How it works, scan by scan

  1. Idle. Start is off and Motor is off, so neither branch passes power. Motor stays off.
  2. You press Start. The top branch is true, Stop isn't pressed, so the rung is true and OTE Motor turns Motor on.
  3. The next scan. Now the XIC Motor on the lower branch is true too, because Motor was turned on in the last scan. The rung has two paths to power.
  4. You let go of Start. The top branch goes false, but the lower branch still passes power through Motor's own contact. The motor holds itself on. That's the seal.
  5. You press Stop. XIO Stop goes false, which breaks the rung no matter which branch has power. Motor turns off, so on the next scan its own contact is false too, and the seal is broken. Releasing Stop doesn't restart anything.

Notice that Stop wins if both buttons are pressed at once, because the Stop contact is in series with everything. That's deliberate: in a real machine, stop should always beat start.

The order the PLC solves things in is what makes this work. The output written on one scan is what the contacts read on the next. If that's fuzzy, read How a PLC scan cycle works.

Making Stop fail-safe

The circuit works, but real control panels wire the Stop button normally closed. Its contacts are closed (the input is on) when nobody touches it, and pressing it opens them. The reason is safety: if the wire to a normally open Stop button breaks, pressing Stop does nothing and the machine can't be stopped. If the wire to a normally closed Stop breaks, the input goes off, which looks exactly like pressing Stop, so the machine stops. A failure makes things safer, not more dangerous.

Try it: select the red button and change it to Normally closed (off while pressed). Run the program. The motor won't start at all, because the Stop tag is now on whenever the button isn't pressed, and XIO Stop is false.

The fix is to change the contact, not the wiring. Double-click the XIO Stop and type XIC:

 |   Start        Stop                       Motor   |
 |----] [----+----] [--------------------------( )----|
 |   Motor   |                                        |
 |----] [----+                                        |
With a normally closed Stop button, Stop is examined with XIC.

This trips up a lot of beginners. XIC and XIO don't describe the physical button; they describe what state of the tag lets power through. A normally closed button's tag is on when it's healthy and not pressed, so you examine it for on. There's more about this in XIC and XIO.

Try it in the Playground

  1. Open the Playground with the conveyor scene and press Run.
  2. Click the green Start button once. Boxes start moving and keep moving after you let go.
  3. Click Stop. The belt stops with the boxes on it. Watch the rung's highlighted power flow change as you press each button.
  4. Hold Start and Stop together and confirm that Stop wins.

Extensions to try

Common mistakes