Fareed Mohmed← Project library

Engineering · PLC · Project 14 of 15 · Sequences · Level 3

Two-hand press control

A press only moves when both buttons are pressed together. Keeps hands out of the danger zone.

▶ Run it in the simulator

Virtual machine for Two-hand press control: buttons, lamps and the process it controls
Learning model only. This page teaches the program logic. A real machine needs a proper control panel with an isolator, fuses, motor protection and a hard-wired emergency stop. Mains and motor wiring is for qualified electricians. A PLC output never drives a motor directly.
Not a safety circuit. A two-hand control or light curtain on a real machine must use certified safety hardware (a safety relay or safety PLC), not an ordinary PLC program.

You will learn

Two-hand control forces the operator to use both hands. Both buttons must close within 0.5 s of each other and must be released before the next cycle. Real machines use a certified safety relay or safety PLC for this, not an ordinary one. This simulation only teaches the logic.

How it works

  • Hold Shift and click both buttons to keep them down. Or use two fingers on a touch screen.
  • The press descends only while both are held.
  • Press one, wait over 0.5 s, then the other: the sync fault lights and the press will not move.

In real life

Punch presses, guillotines and moulding machines. This lesson is for learning only; any real machine needs certified safety hardware.

Inputs, outputs and addresses

The same signals on seven PLC brands. Inputs and outputs are numbered in order; check your own hardware and software, because addresses depend on the model and module position.

NameWhat it isTypeSiemens
S7-1200
Allen-Bradley
CompactLogix
Mitsubishi
iQ-F FX5U
Delta
DVP / AS
Omron
CP2E
Schneider
M241
Inovance
H5U
LHLeft-hand buttonInput%I0.0Local:1:I.Data.0X0X00.00%IX0.0X0
RHRight-hand buttonInput%I0.1Local:1:I.Data.1X1X10.01%IX0.1X1
ESTOPEmergency stop (N.C.)Input%I0.2Local:1:I.Data.2X2X20.02%IX0.2X2
TOPSPress up sensorInput%I0.3Local:1:I.Data.3X3X30.03%IX0.3X3
BOTSPress down sensorInput%I0.4Local:1:I.Data.4X4X40.04%IX0.4X4
PRESSPress valveOutput%Q0.0Local:2:O.Data.0Y0Y0100.00%QX0.0Y0
SYNCSync fault lampOutput%Q0.1Local:2:O.Data.1Y1Y1100.01%QX0.1Y1

Ladder diagram (shown for Siemens, live state)

Green wires carry power in the moment captured below. Switch the brand and the language in the simulator.

Rung 1 Left alone for 0.5 sLH%I0.0RH%I0.1"T1"TONINPT T#500msQETET = 0 msRung 2 Right alone for 0.5 sRH%I0.1LH%I0.0"T2"TONINPT T#500msQETET = 0 msRung 3 Latch sync fault if not pressed togetherTimer 1 done"T1".QTimer 2 done"T2".QSSYNC%Q0.1Rung 4 Clear fault when both buttons are releasedLH%I0.0RH%I0.1RSYNC%Q0.1Rung 5 Press moves only with both buttonsLH%I0.0RH%I0.1SYNC%Q0.1ESTOP%I0.2PRESS%Q0.0

Structured text, Siemens SCL

(* Siemens S7-1200, CPU 1214C DC/DC/DC - TIA Portal - SCL *)
(* Rung 1: Left alone for 0.5 s *)
"T1"(IN := "LH" AND NOT "RH", PT := T#500ms);
(* Rung 2: Right alone for 0.5 s *)
"T2"(IN := "RH" AND NOT "LH", PT := T#500ms);
(* Rung 3: Latch sync fault if not pressed together *)
IF "T1".Q OR "T2".Q THEN "SYNC" := TRUE; END_IF;
(* Rung 4: Clear fault when both buttons are released *)
IF NOT "LH" AND NOT "RH" THEN "SYNC" := FALSE; END_IF;
(* Rung 5: Press moves only with both buttons *)
"PRESS" := "LH" AND "RH" AND NOT "SYNC" AND "ESTOP";

Structured text, Allen-Bradley

(* Allen-Bradley CompactLogix 5069 (L306ER) - Studio 5000 Logix Designer - Structured Text *)
(* Rung 1: Left alone for 0.5 s *)
Timer1.PRE := 500;   (* ms *)
Timer1.TimerEnable := LH AND NOT RH;
TONR(Timer1);
(* Rung 2: Right alone for 0.5 s *)
Timer2.PRE := 500;   (* ms *)
Timer2.TimerEnable := RH AND NOT LH;
TONR(Timer2);
(* Rung 3: Latch sync fault if not pressed together *)
IF Timer1.DN OR Timer2.DN THEN SYNC := TRUE; END_IF;
(* Rung 4: Clear fault when both buttons are released *)
IF NOT LH AND NOT RH THEN SYNC := FALSE; END_IF;
(* Rung 5: Press moves only with both buttons *)
PRESS := LH AND RH AND NOT SYNC AND ESTOP;

Try this

Parts to buy

The links open a search on each store, so you see what is in stock today. Check the model, voltage and price before you order.

#ItemBuy / compare
1Safety relay or safety PLC (real machines)Amazon.in · IndiaMART · Robu.in
22 buttons with guardsAmazon.in · IndiaMART · Robu.in
3E-stopAmazon.in · IndiaMART · Robu.in
4Valve and press cylinderAmazon.in · IndiaMART · Robu.in
← 13. Alarm with acknowledgeAll projects15. Roller door with safety beam →

This is a learning tool. It teaches the logic, not the exact keystrokes of each vendor’s software. Check the manual of your own PLC.