Fareed Mohmed← Project library

Engineering · PLC · Project 13 of 15 · Signals and alarms · Level 3

Alarm with acknowledge

A fault flashes a lamp and sounds a horn. Pressing ACK silences the horn; the lamp stays steady until the fault clears.

▶ Run it in the simulator

Virtual machine for Alarm with acknowledge: 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

The standard alarm states: normal, alarm (unacknowledged), acknowledged and back to normal. Edge detection (the P contact) makes the alarm start once when the fault appears, not on every scan.

How it works

  • Flip Process fault on. The lamp flashes and the horn sounds.
  • Press ACK. The horn stops and the lamp goes steady.
  • Flip the fault off. The lamp turns off and the alarm clears.

In real life

Every control room, boiler house and building management system.

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
FAULTFault contact (ON = fault)Input%I0.0Local:1:I.Data.0X0X00.00%IX0.0X0
ACKACK push-buttonInput%I0.1Local:1:I.Data.1X1X10.01%IX0.1X1
LAMPAlarm lampOutput%Q0.0Local:2:O.Data.0Y0Y0100.00%QX0.0Y0
HORNHornOutput%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 Alarm starts on the rising edge of the faultPFAULT%I0.0SALM%M0.0Rung 2 AcknowledgeACK%I0.1ALM%M0.0SACKED%M0.1Rung 3 Clear when the fault is gone and acknowledgedFAULT%I0.0ACKED%M0.1RALM%M0.0RACKED%M0.1Rung 4 Flasher off timeALM%M0.0ACKED%M0.1Timer 2 done"T2".Q"T1"TONINPT T#400msQETET = 300 msRung 5 Flasher on timeTimer 1 done"T1".Q"T2"TONINPT T#400msQETET = 0 msRung 6 Horn until acknowledgedALM%M0.0ACKED%M0.1HORN%Q0.1Rung 7 Lamp flashes, then steadyALM%M0.0ACKED%M0.1Timer 1 done"T1".QLAMP%Q0.0

Structured text, Siemens SCL

(* Siemens S7-1200, CPU 1214C DC/DC/DC - TIA Portal - SCL *)
(* Rung 1: Alarm starts on the rising edge of the fault *)
IF "FAULT" THEN "ALM" := TRUE; END_IF;
(* Rung 2: Acknowledge *)
IF "ACK" AND "ALM" THEN "ACKED" := TRUE; END_IF;
(* Rung 3: Clear when the fault is gone and acknowledged *)
IF NOT "FAULT" AND "ACKED" THEN "ALM" := FALSE; END_IF;
IF NOT "FAULT" AND "ACKED" THEN "ACKED" := FALSE; END_IF;
(* Rung 4: Flasher off time *)
"T1"(IN := "ALM" AND NOT "ACKED" AND NOT "T2".Q, PT := T#400ms);
(* Rung 5: Flasher on time *)
"T2"(IN := "T1".Q, PT := T#400ms);
(* Rung 6: Horn until acknowledged *)
"HORN" := "ALM" AND NOT "ACKED";
(* Rung 7: Lamp flashes, then steady *)
"LAMP" := "ALM" AND ("ACKED" OR "T1".Q);

Structured text, Allen-Bradley

(* Allen-Bradley CompactLogix 5069 (L306ER) - Studio 5000 Logix Designer - Structured Text *)
(* Rung 1: Alarm starts on the rising edge of the fault *)
IF FAULT THEN ALM := TRUE; END_IF;
(* Rung 2: Acknowledge *)
IF ACK AND ALM THEN ACKED := TRUE; END_IF;
(* Rung 3: Clear when the fault is gone and acknowledged *)
IF NOT FAULT AND ACKED THEN ALM := FALSE; END_IF;
IF NOT FAULT AND ACKED THEN ACKED := FALSE; END_IF;
(* Rung 4: Flasher off time *)
Timer1.PRE := 400;   (* ms *)
Timer1.TimerEnable := ALM AND NOT ACKED AND NOT Timer2.DN;
TONR(Timer1);
(* Rung 5: Flasher on time *)
Timer2.PRE := 400;   (* ms *)
Timer2.TimerEnable := Timer1.DN;
TONR(Timer2);
(* Rung 6: Horn until acknowledged *)
HORN := ALM AND NOT ACKED;
(* Rung 7: Lamp flashes, then steady *)
LAMP := ALM AND (ACKED OR Timer1.DN);

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
2Alarm lamp and hornAmazon.in · IndiaMART · Robu.in
3ACK buttonAmazon.in · IndiaMART · Robu.in
← 12. Bottle filling stationAll projects14. Two-hand press control →

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.