Fareed Mohmed← Project library

Engineering · PLC · Project 15 of 15 · Conveyors and doors · Level 3

Roller door with safety beam

Open, close and stop a roller door. If something breaks the beam while closing, the door reverses.

▶ Run it in the simulator

Virtual machine for Roller door with safety beam: 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.

You will learn

Limit switches stop the door at each end and the safety beam adds a reversing action. Up and down rungs block each other so the motor is never told to go both ways.

How it works

  • Press OPEN. The door rises to the top limit and stops.
  • Press CLOSE. The door lowers to the bottom.
  • Flip Obstacle while it closes: the door stops, reverses to the top, then waits.

In real life

Garage doors, warehouse shutters, factory gates.

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
OPENOPEN buttonInput%I0.0Local:1:I.Data.0X0X00.00%IX0.0X0
CLOSECLOSE buttonInput%I0.1Local:1:I.Data.1X1X10.01%IX0.1X1
STOPSTOP button (N.C.)Input%I0.2Local:1:I.Data.2X2X20.02%IX0.2X2
BEAMSafety beam (ON when clear)Input%I0.3Local:1:I.Data.3X3X30.03%IX0.3X3
TOPTop limit switchInput%I0.4Local:1:I.Data.4X4X40.04%IX0.4X4
BOTBottom limit switchInput%I0.5Local:1:I.Data.5X5X50.05%IX0.5X5
UPMotor upOutput%Q0.0Local:2:O.Data.0Y0Y0100.00%QX0.0Y0
DNMotor downOutput%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 Beam broken while closing sets reverseDN%Q0.1BEAM%I0.3SREV%M0.0Rung 2 Reverse ends at the topTOP%I0.4RREV%M0.0Rung 3 Door upOPEN%I0.0REV%M0.0UP%Q0.0STOP%I0.2TOP%I0.4DN%Q0.1UP%Q0.0Rung 4 Door downCLOSE%I0.1DN%Q0.1STOP%I0.2BOT%I0.5UP%Q0.0BEAM%I0.3REV%M0.0DN%Q0.1

Structured text, Siemens SCL

(* Siemens S7-1200, CPU 1214C DC/DC/DC - TIA Portal - SCL *)
(* Rung 1: Beam broken while closing sets reverse *)
IF "DN" AND NOT "BEAM" THEN "REV" := TRUE; END_IF;
(* Rung 2: Reverse ends at the top *)
IF "TOP" THEN "REV" := FALSE; END_IF;
(* Rung 3: Door up *)
"UP" := ("OPEN" OR "REV" OR "UP") AND "STOP" AND NOT "TOP" AND NOT "DN";
(* Rung 4: Door down *)
"DN" := ("CLOSE" OR "DN") AND "STOP" AND NOT "BOT" AND NOT "UP" AND "BEAM" AND NOT "REV";

Structured text, Allen-Bradley

(* Allen-Bradley CompactLogix 5069 (L306ER) - Studio 5000 Logix Designer - Structured Text *)
(* Rung 1: Beam broken while closing sets reverse *)
IF DN AND NOT BEAM THEN REV := TRUE; END_IF;
(* Rung 2: Reverse ends at the top *)
IF TOP THEN REV := FALSE; END_IF;
(* Rung 3: Door up *)
UP := (OPEN OR REV OR UP) AND STOP AND NOT TOP AND NOT DN;
(* Rung 4: Door down *)
DN := (CLOSE OR DN) AND STOP AND NOT BOT AND NOT UP AND BEAM AND NOT REV;

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
1PLCAmazon.in · IndiaMART · Robu.in
2Two limit switchesAmazon.in · IndiaMART · Robu.in
3Safety photo-eyeAmazon.in · IndiaMART · Robu.in
4Reversing contactorsAmazon.in · IndiaMART · Robu.in
← 14. Two-hand press controlAll projects

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.