PLC start/stop in Ladder (seal-in circuit)

The start/stop circuit is the "hello world" of PLC programming. A Start button switches a motor contactor on, it stays on after the button is released, and a Stop button switches it off. With relays this is the self-holding circuit. On a PLC the same logic is written as one Ladder rung, and the buttons and the contactor are only wired to inputs and outputs.

In this tutorial you wire a Siemens S7-1200 CPU 1214C in Virtuino Circuits, write the rung, and test it in simulation. The same steps work for LOGO!, S7-200 and Modicon M221: only the address spelling changes (see the table at the end).

Open the ready-made circuit in the simulator

Inputs and outputs

DeviceContactPLC address (S7-1200)
S0 StopNC push button%I0.0
S1 StartNO push button%I0.1
F2 OverloadNC contact 95-96%I0.2
K1 Motor contactorcoil%Q0.0
H1 Run lamplamp%Q0.1

Step 1: wire the PLC

  1. Place the PLC. Open the app, start a blank drawing, open the PLC group and place a PLC. In its properties choose S7-1200 CPU 1214C. The symbol shows the real terminal blocks and LEDs.
  2. Supply. Connect the supply terminals of the PLC to L1 and N (230 V AC).
  3. Input supply. The digital inputs need 24 V DC. Place L+ and M (24 V DC) and connect the input common 1M to M.
  4. Buttons. From L+, wire S0 (NC) to input .0, S1 (NO) to input .1, and the overload contact 95-96 to input .2.
  5. Outputs. The outputs are relay contacts. Connect the output common 1L to L1 (through a fuse), then output .0 to the coil of K1 and output .1 to lamp H1. Wire the other ends to N.
Why is Stop wired NC? If the wire to a NC stop button breaks, the input goes to 0, exactly as if Stop were pressed, and the motor stops. With a NO stop button a broken wire would make Stop impossible. This is called wire-break safety, and it is required for stop and emergency functions.

Step 2: write the Ladder rung

Double-click the PLC (or click Ladder program… in its properties) to open its Ladder editor. Draw this rung:

      %I0.1 Start          %I0.0 Stop   %I0.2 OL        %Q0.0 K1
 |-----| |-------+-----------| |-----------| |-------------( )---|
       |         |
      %Q0.0 K1   |
 |-----| |-------+

      %Q0.0 K1                                          %Q0.1 H1
 |-----| |---------------------------------------------( )---|
  1. Place a NO contact with address %I0.1 (Start).
  2. Below it, place a NO contact with address %Q0.0, and wire it in parallel with Start. This is the seal-in (latching) contact: the output keeps itself on.
  3. In series, place a NO contact %I0.0 (Stop) and a NO contact %I0.2 (overload).
  4. End the rung with a coil %Q0.0. Add a second rung with a NO contact %Q0.0 and a coil %Q0.1 for the lamp.
The Stop and overload contacts in Ladder are NO, although the buttons are NC. The Ladder contact checks the input signal, not the button: the input is 1 while Stop is not pressed, so a NO contact conducts. Using a NC contact here is the most common beginner mistake. The motor would then run only while Stop is held.

Step 3: simulate

  1. Press F5. Input LEDs .0 and .2 light, because S0 and the overload contact are closed.
  2. Click S1. Input .1 lights, the rung conducts and is drawn in red in the Ladder window, output .0 switches K1, and the motor contactor pulls in. Release S1: %Q0.0 keeps itself on through the seal-in contact.
  3. Click S0: input .0 goes to 0, the rung opens and K1 drops out.
  4. Change the Stop contact in Ladder to NC and try again, to see the mistake described above.

The same with Set and Reset

Instead of a seal-in contact you can use two rungs: %I0.1 → (S) %Q0.0 and NOT %I0.0 → (R) %Q0.0. Both are correct. Put the Reset rung last, so that Stop wins when both buttons are pressed: the PLC executes the rungs from top to bottom, and the last write in the scan decides the output.

Addresses on other PLCs

PLCStopStartMotor
S7-1200%I0.0%I0.1%Q0.0
S7-200I0.0I0.1Q0.0
LOGO! 8I1I2Q1
Modicon M221%I0.0%I0.1%Q0.0

LOGO! 230RCE inputs take 230 V AC instead of 24 V DC; the simulator reports a wrong input voltage if you mix them up.

Next steps

Open this circuit in the simulator