Wire each alarm feedback as a contact that is closed when healthy, copy the inputs into DB_IO in an input mapping FC, latch each fault in an alarm mapping FC into one bit of "DB_Alarm".Alarm (%X0, %X1 …) with a reset push button in the seal-in branch, and point each HMI discrete alarm at that word and bit. Analog alarms are triggered when a numeric tag crosses a configured limit. Assign each alarm to an alarm class that decides whether acknowledgement is required and how it is displayed, then place an alarm view on the screen with a permanent line for the highest priority message.
- Wire alarm feedbacks as NC (closed-when-healthy) contacts so a broken wire raises an alarm instead of hiding one.
- Use %I addresses only in the input mapping FC; alarm logic and HMI tags read DB members, never %I or %M.
- Put the reset contact in the latch branch so an alarm can only be cleared after its cause has gone.
- Group fault bits into words in the PLC so one HMI trigger tag can carry sixteen discrete alarms.
- Alarm text should name the device, the condition and the first thing to check, not repeat the tag name.
- Acknowledgement is a design decision: not every message needs it, and everything needing it must be visible until it is done.
How HMI Alarms Are Triggered
WinCC on a panel does not scan the machine. It watches tags. Everything therefore depends on how the PLC presents fault information.
The usual approach is a fault word: a WORD or DWORD in a data block where each bit represents one condition. In the worked example below, bits 0 to 4 carry human-safety feedbacks, bits 5 to 9 electrical-safety feedbacks and bits 10 to 14 system-safety feedbacks. The panel monitors the word, and each bit becomes a discrete alarm with its own message text.
This is far more efficient than one HMI tag per fault. One word covers sixteen alarms with a single connection, communication load stays low, and the numbering in the PLC matches the numbering in the alarm list, which makes fault finding much faster.
Build the fault word carefully. Latch conditions that must not disappear before an operator sees them, and keep a separate first-out bit that records which fault stopped the machine. The first-out register, and how the collective fault then blocks a restart, are programmed step by step in first-out fault capture in PLC interlocks and permissives.
Field Wiring for Discrete Alarms: NC (Fail-Safe) Feedback Contacts
Every discrete alarm on the panel starts as a contact somewhere on the machine. In this lesson fifteen feedback signals are grouped into three categories: HS (Human Safety), ES (Electrical Safety) and SS (System Safety). All fifteen are wired closed-circuit: the contact is closed while the device is healthy, so the PLC input reads 1 in normal running and drops to 0 on a fault.
Why NC contact wiring for alarm feedback
- Broken wire is a fault, not silence. A cut core, a loose terminal or a pulled connector opens the circuit and raises the alarm. With a normally open contact the same broken wire would hide the next real fault.
- Loss of field supply is visible. If the 24 VDC feeding the field contacts fails, the inputs drop and the machine stops in a known state instead of running blind.
- One rule for every device. "Input 1 = healthy" for all fifteen signals keeps tag names, ladder logic and troubleshooting consistent. Name the tags
_OKso the meaning is obvious in the watch table.
HS – Human Safety
- Emergency stop – main control panel
- Emergency stop – field operator station
- Safety door closed feedback
- Light curtain healthy
- Conveyor pull-cord switch
ES – Electrical Safety
- Main incomer MCCB healthy
- Control transformer healthy
- Single phase preventer (SPP) relay
- Surge protection device (SPD) healthy
- Motor MPCB healthy
SS – System Safety
- Overtravel limit switch – forward
- Overtravel limit switch – reverse
- Compressed air pressure switch
- Hydraulic oil level float switch
- Conveyor belt sway switch
I/O allocation and contact selection
Choose the contact on each device that is closed when healthy. For breakers this is usually the auxiliary contact that closes when the breaker is ON; where the device also has a separate trip-indication contact, wire both in series so "switched OFF" and "tripped" both raise the alarm.
| ID | Field device | Contact used (closed when healthy) | PLC input | PLC tag | Alarm bit |
|---|---|---|---|---|---|
| HS-01 | Emergency stop – main control panel | Safety relay auxiliary contact, closed when E-stop released and relay reset | %I0.0 | HS_EStop_Panel_OK | "DB_Alarm".Alarm.%X0 |
| HS-02 | Emergency stop – field operator station | Safety relay auxiliary contact (second E-stop channel group) | %I0.1 | HS_EStop_Field_OK | "DB_Alarm".Alarm.%X1 |
| HS-03 | Safety door closed – interlock switch | Door interlock switch monitoring contact, closed when door closed and locked | %I0.2 | HS_SafetyDoor_OK | "DB_Alarm".Alarm.%X2 |
| HS-04 | Light curtain healthy (safety relay) | Safety relay auxiliary contact following the light-curtain OSSDs | %I0.3 | HS_LightCurtain_OK | "DB_Alarm".Alarm.%X3 |
| HS-05 | Conveyor pull-cord switch | Pull-cord switch monitoring contact, closed when cord not pulled | %I0.4 | HS_PullCord_OK | "DB_Alarm".Alarm.%X4 |
| ES-01 | Main incomer MCCB ON / not tripped | MCCB auxiliary contact closed when ON, in series with trip-alarm contact closed when not tripped | %I0.5 | ES_MCCB_Main_OK | "DB_Alarm".Alarm.%X5 |
| ES-02 | Control transformer healthy | Transformer thermal switch (or secondary MCB aux contact), closed when healthy | %I0.6 | ES_Transformer_OK | "DB_Alarm".Alarm.%X6 |
| ES-03 | Single phase preventer relay healthy | SPP relay output contact, closed when all three phases are present and balanced | %I0.7 | ES_SPP_OK | "DB_Alarm".Alarm.%X7 |
| ES-04 | Surge protection device healthy | SPD remote-signalling contact, closed while the protection cartridge is intact | %I1.0 | ES_SPD_OK | "DB_Alarm".Alarm.%X8 |
| ES-05 | Motor M1 MPCB ON / not tripped | MPCB auxiliary contact closed when ON and not tripped | %I1.1 | ES_MPCB_M1_OK | "DB_Alarm".Alarm.%X9 |
| SS-01 | Overtravel limit switch – forward | Limit switch NC contact, opens when the axis overruns forward | %I1.2 | SS_OTL_Fwd_OK | "DB_Alarm".Alarm.%X10 |
| SS-02 | Overtravel limit switch – reverse | Limit switch NC contact, opens when the axis overruns reverse | %I1.3 | SS_OTL_Rev_OK | "DB_Alarm".Alarm.%X11 |
| SS-03 | Compressed air pressure switch | Pressure switch contact closed above set pressure | %I1.4 | SS_AirPressure_OK | "DB_Alarm".Alarm.%X12 |
| SS-04 | Hydraulic oil level float switch | Float switch contact closed above minimum oil level | %I1.5 | SS_HydOilLevel_OK | "DB_Alarm".Alarm.%X13 |
| SS-05 | Conveyor belt sway switch | Belt sway switch NC contact, opens when the belt runs off-track | %I1.6 | SS_BeltSway_OK | "DB_Alarm".Alarm.%X14 |
| RESET | Alarm reset push button on panel door | Normally open, momentary | %I1.7 | Reset_PB | – |
Good practice on the panel side: feed the field contacts from a dedicated, fused 24 VDC circuit, ferrule and number every core to its X1 terminal, and route field cables away from motor power cables. Because a single loss of the field supply will drop all fifteen inputs at once, many projects add one extra "field 24 V OK" input so the operator sees the root cause first rather than a flood of alarms. For hardware setup and tag creation, see Siemens PLC device configuration and tag creation.
PLC Program Structure: IO Mapping, Input Mapping FC and Alarm Mapping FC
The PLC side is built in three layers so that physical addresses live in exactly one place. The PLC tag table (the IO mapping page) names the inputs. FC_InputMapping copies each input tag into a global data block DB_IO. FC_AlarmMapping then reads only DB_IO members and writes the latched faults into "DB_Alarm".Alarm. From the input mapping onward nothing uses %I or %M: every operand is a symbolic DB member, the reset push button included.
Why an IO mapping layer between PLC tags and alarm mapping
- One place to change hardware. If a signal moves to another terminal or a DI card is replaced, you edit one network in
FC_InputMapping; the alarm logic and the HMI do not change. - One place to watch. During commissioning a single watch table on
DB_IOshows every field signal by name, and the alarm FC can be tested from it. - No hidden addresses. M memory can collide between programmers and, for a Word, hides a byte swap (
%X0ofMW20is physicallyM21.0). Optimized DB members have no absolute address, so slice access.%X0is the only way to reach a bit and PLC and HMI numbering always agree.
Step 1 – IO mapping page: PLC tags and their DB_IO members
Declare only the physical inputs in the PLC tag table, each with a symbolic name and comment. The same table is your input mapping list: every PLC tag has exactly one DB_IO member written by one network of FC_InputMapping.
| FC10 network | PLC tag | Address | DB_IO member (Bool) | Comment |
|---|---|---|---|---|
| 1 | "HS_EStop_Panel_OK" | %I0.0 | "DB_IO".HS_EStop_Panel_OK | HS-01 Emergency stop – main control panel |
| 2 | "HS_EStop_Field_OK" | %I0.1 | "DB_IO".HS_EStop_Field_OK | HS-02 Emergency stop – field operator station |
| 3 | "HS_SafetyDoor_OK" | %I0.2 | "DB_IO".HS_SafetyDoor_OK | HS-03 Safety door closed – interlock switch |
| 4 | "HS_LightCurtain_OK" | %I0.3 | "DB_IO".HS_LightCurtain_OK | HS-04 Light curtain healthy (safety relay) |
| 5 | "HS_PullCord_OK" | %I0.4 | "DB_IO".HS_PullCord_OK | HS-05 Conveyor pull-cord switch |
| 6 | "ES_MCCB_Main_OK" | %I0.5 | "DB_IO".ES_MCCB_Main_OK | ES-01 Main incomer MCCB ON / not tripped |
| 7 | "ES_Transformer_OK" | %I0.6 | "DB_IO".ES_Transformer_OK | ES-02 Control transformer healthy |
| 8 | "ES_SPP_OK" | %I0.7 | "DB_IO".ES_SPP_OK | ES-03 Single phase preventer relay healthy |
| 9 | "ES_SPD_OK" | %I1.0 | "DB_IO".ES_SPD_OK | ES-04 Surge protection device healthy |
| 10 | "ES_MPCB_M1_OK" | %I1.1 | "DB_IO".ES_MPCB_M1_OK | ES-05 Motor M1 MPCB ON / not tripped |
| 11 | "SS_OTL_Fwd_OK" | %I1.2 | "DB_IO".SS_OTL_Fwd_OK | SS-01 Overtravel limit switch – forward |
| 12 | "SS_OTL_Rev_OK" | %I1.3 | "DB_IO".SS_OTL_Rev_OK | SS-02 Overtravel limit switch – reverse |
| 13 | "SS_AirPressure_OK" | %I1.4 | "DB_IO".SS_AirPressure_OK | SS-03 Compressed air pressure switch |
| 14 | "SS_HydOilLevel_OK" | %I1.5 | "DB_IO".SS_HydOilLevel_OK | SS-04 Hydraulic oil level float switch |
| 15 | "SS_BeltSway_OK" | %I1.6 | "DB_IO".SS_BeltSway_OK | SS-05 Conveyor belt sway switch |
| 16 | "Reset_PB" | %I1.7 | "DB_IO".Reset_PB | Alarm reset push button, NO, panel door |
Step 2 – DB_Alarm: the alarm word and reset bits
| DB_Alarm member | Data type | Written by | Comment |
|---|---|---|---|
Alarm | Word | FC_AlarmMapping | Discrete alarm word for HMI, bit = 1 means fault latched (%X0–%X14; %X15 is spare here and is used for the motor M1 contactor feedback trip) |
Reset_Cmd | Bool | FC_AlarmMapping | Combined reset: DB_IO.Reset_PB OR HMI_Reset |
HMI_Reset | Bool | HMI RESET button | Set while the panel button is pressed |
Any_Fault | Bool | FC_AlarmMapping | Collective fault for tower lamp and start interlock |
HMI_AckAll | Bool | HMI ACK ALL button | Set while ACK ALL is pressed on the panel |
PLC_Ack | Word | FC_AlarmMapping | PLC acknowledgement word for the HMI: copy of Alarm while ACK ALL is pressed, else 0 |
Create both data blocks as global, optimized DBs and keep Accessible from HMI/OPC UA ticked on the members the panel needs (Alarm, HMI_Reset, HMI_AckAll, PLC_Ack, Reset_Cmd and Any_Fault). For data block basics see Siemens block types: OB, FB, FC and DB.
Step 3 – FC_InputMapping: PLC tag to DB_IO
Keep this FC deliberately simple: one normally open contact and one coil per network, no logic. The input is copied as it is, so DB_IO keeps the "1 = healthy" meaning of the NC wiring.
Step 4 – FC_AlarmMapping: fault latch with reset push button
- Fault branch: a normally closed contact instruction
-|/|-on the mappedDB_IObit. The bit is 1 when healthy, so this contact passes power only when the field contact has opened. - Seal-in (latch) branch:
"DB_Alarm".Alarm.%X0in series with a normally closed"DB_Alarm".Reset_Cmdcontact, connected in parallel with the fault branch. Once set, the bit holds itself until Reset is pressed. - Why reset goes in the latch branch: while the E-stop is still pressed the fault branch keeps the coil on, so pressing Reset cannot clear an alarm whose cause is still present. Use a momentary push button, never a maintained switch.
- Comments: title every network "HS-01 E-stop main panel → Alarm.%X0" so the wiring drawing, both FCs and the HMI alarm list share the same ID.
The same latch as one line of SCL, useful if you later move alarm handling into a function (see the SCL vs ladder comparison):
// HS-01 E-stop main panel → DB_Alarm.Alarm bit 0
"DB_Alarm".Alarm.%X0 := NOT "DB_IO".HS_EStop_Panel_OK
OR ("DB_Alarm".Alarm.%X0 AND NOT "DB_Alarm".Reset_Cmd);
| FC20 network | ID | Fault contact | Latch coil | Network comment |
|---|---|---|---|---|
| 1 | – | "DB_IO".Reset_PB OR "DB_Alarm".HMI_Reset | "DB_Alarm".Reset_Cmd | Combined alarm reset command |
| 2 | HS-01 | -|/|- "DB_IO".HS_EStop_Panel_OK | "DB_Alarm".Alarm.%X0 | HS-01 Emergency stop – main control panel: 1 = fault latched |
| 3 | HS-02 | -|/|- "DB_IO".HS_EStop_Field_OK | "DB_Alarm".Alarm.%X1 | HS-02 Emergency stop – field operator station: 1 = fault latched |
| 4 | HS-03 | -|/|- "DB_IO".HS_SafetyDoor_OK | "DB_Alarm".Alarm.%X2 | HS-03 Safety door closed – interlock switch: 1 = fault latched |
| 5 | HS-04 | -|/|- "DB_IO".HS_LightCurtain_OK | "DB_Alarm".Alarm.%X3 | HS-04 Light curtain healthy (safety relay): 1 = fault latched |
| 6 | HS-05 | -|/|- "DB_IO".HS_PullCord_OK | "DB_Alarm".Alarm.%X4 | HS-05 Conveyor pull-cord switch: 1 = fault latched |
| 7 | ES-01 | -|/|- "DB_IO".ES_MCCB_Main_OK | "DB_Alarm".Alarm.%X5 | ES-01 Main incomer MCCB ON / not tripped: 1 = fault latched |
| 8 | ES-02 | -|/|- "DB_IO".ES_Transformer_OK | "DB_Alarm".Alarm.%X6 | ES-02 Control transformer healthy: 1 = fault latched |
| 9 | ES-03 | -|/|- "DB_IO".ES_SPP_OK | "DB_Alarm".Alarm.%X7 | ES-03 Single phase preventer relay healthy: 1 = fault latched |
| 10 | ES-04 | -|/|- "DB_IO".ES_SPD_OK | "DB_Alarm".Alarm.%X8 | ES-04 Surge protection device healthy: 1 = fault latched |
| 11 | ES-05 | -|/|- "DB_IO".ES_MPCB_M1_OK | "DB_Alarm".Alarm.%X9 | ES-05 Motor M1 MPCB ON / not tripped: 1 = fault latched |
| 12 | SS-01 | -|/|- "DB_IO".SS_OTL_Fwd_OK | "DB_Alarm".Alarm.%X10 | SS-01 Overtravel limit switch – forward: 1 = fault latched |
| 13 | SS-02 | -|/|- "DB_IO".SS_OTL_Rev_OK | "DB_Alarm".Alarm.%X11 | SS-02 Overtravel limit switch – reverse: 1 = fault latched |
| 14 | SS-03 | -|/|- "DB_IO".SS_AirPressure_OK | "DB_Alarm".Alarm.%X12 | SS-03 Compressed air pressure switch: 1 = fault latched |
| 15 | SS-04 | -|/|- "DB_IO".SS_HydOilLevel_OK | "DB_Alarm".Alarm.%X13 | SS-04 Hydraulic oil level float switch: 1 = fault latched |
| 16 | SS-05 | -|/|- "DB_IO".SS_BeltSway_OK | "DB_Alarm".Alarm.%X14 | SS-05 Conveyor belt sway switch: 1 = fault latched |
| 17 | – | "DB_Alarm".Alarm <> 0 (CMP Word) | "DB_Alarm".Any_Fault | Collective fault for tower lamp and start interlock |
| 18 | – | -| |- "DB_Alarm".HMI_AckAll → MOVE "DB_Alarm".Alarm | "DB_Alarm".PLC_Ack | ACK ALL: acknowledge every active alarm from the PLC |
| 19 | – | -|/|- "DB_Alarm".HMI_AckAll → MOVE 0 | "DB_Alarm".PLC_Ack | Clear the acknowledgement word when ACK ALL is released |
Step 5 – Call order in OB1
OB1 Network 1 CALL "FC_InputMapping" // %I tags → DB_IO OB1 Network 2 CALL "FC_AlarmMapping" // DB_IO → DB_Alarm.Alarm
Calling the input mapping first means the alarm logic always works on inputs from the current scan. "DB_Alarm".Any_Fault then feeds the red tower lamp and blocks the start command, as built in the start/stop seal-in with the Any_Fault interlock, which continues this project with a conveyor motor, a contactor feedback trip on %X15 and first-out capture.
Configuring Discrete Alarms in the HMI (WinCC)
Open HMI alarms → Discrete alarms in the project tree and add one row per fault bit.
| Column | What to enter |
|---|---|
| ID | A unique number; keep it aligned with your PLC fault numbering |
| Alarm text | Device, condition and first check, in plain language |
| Alarm class | Errors, Warnings or a class you have defined |
| Trigger tag | The fault word from the PLC data block |
| Trigger bit | The bit position inside that word |
| Acknowledgement tag | Optional word written back to the PLC when acknowledged |
Writing alarm text that helps
Compare two messages for the same bit. "M1_FLT true" tells the operator nothing. "Conveyor 1 motor overload tripped, check thermal relay in panel MCC-2" tells them the device, the condition and where to go. Text is where alarm systems succeed or fail.
You can embed live values in a message using output fields inside the alarm text, which is useful for showing the measured value that caused a trip.
HMI tags for the alarm word and reset
Drag the members from DB_Alarm into the HMI tag table rather than typing addresses. TIA Portal creates DB_Alarm_Alarm (Word) connected to "DB_Alarm".Alarm and DB_Alarm_HMI_Reset (Bool) connected to "DB_Alarm".HMI_Reset, both with symbolic access. Set the acquisition mode of DB_Alarm_Alarm to Cyclic continuous so alarms are detected even when no screen is displaying the tag. As in the PLC, no HMI tag points at %I or %M.
Alarm classes for HS, ES and SS
Create three user-defined alarm classes under HMI alarms → Alarm classes so the operator can tell the category at a glance and filter the alarm view by it.
| Alarm class | Acknowledgement | Suggested colour (came) | Alarm bits |
|---|---|---|---|
| HS_Safety | Required | Red | %X0 – %X4 |
| ES_Electrical | Required | Orange | %X5 – %X9 |
| SS_System | Required | Yellow | %X10 – %X14 |
The fifteen discrete alarms
Add one row per bit in HMI alarms → Discrete alarms. Leave the trigger mode on the rising edge, because the PLC bit goes to 1 when the fault latches. Prefixing each text with its HS/ES/SS ID ties the panel message back to the wiring drawing and the ladder network comment.
| ID | Alarm text | Alarm class | Trigger tag | Trigger bit |
|---|---|---|---|---|
| 1 | HS-01 Emergency stop pressed at main control panel – release E-stop, then press RESET | HS_Safety | DB_Alarm_Alarm | 0 |
| 2 | HS-02 Emergency stop pressed at field operator station – check station, release, RESET | HS_Safety | DB_Alarm_Alarm | 1 |
| 3 | HS-03 Safety door open – close and lock the guard door before reset | HS_Safety | DB_Alarm_Alarm | 2 |
| 4 | HS-04 Light curtain interrupted – clear the protected zone, then RESET | HS_Safety | DB_Alarm_Alarm | 3 |
| 5 | HS-05 Conveyor pull-cord operated – find the pulled cord, re-arm the switch | HS_Safety | DB_Alarm_Alarm | 4 |
| 6 | ES-01 Main incomer MCCB OFF or tripped – check incomer feeder in main panel | ES_Electrical | DB_Alarm_Alarm | 5 |
| 7 | ES-02 Control transformer fault – check transformer temperature and secondary MCB | ES_Electrical | DB_Alarm_Alarm | 6 |
| 8 | ES-03 Single phasing / phase failure – check incoming supply and SPP relay | ES_Electrical | DB_Alarm_Alarm | 7 |
| 9 | ES-04 Surge protection device failed – replace SPD cartridge in incomer panel | ES_Electrical | DB_Alarm_Alarm | 8 |
| 10 | ES-05 Motor M1 MPCB tripped – check motor current and MPCB setting | ES_Electrical | DB_Alarm_Alarm | 9 |
| 11 | SS-01 Forward overtravel limit reached – jog axis back in manual mode | SS_System | DB_Alarm_Alarm | 10 |
| 12 | SS-02 Reverse overtravel limit reached – jog axis back in manual mode | SS_System | DB_Alarm_Alarm | 11 |
| 13 | SS-03 Compressed air pressure low – check compressor and FRL unit | SS_System | DB_Alarm_Alarm | 12 |
| 14 | SS-04 Hydraulic oil level low – top up oil, check for leakage | SS_System | DB_Alarm_Alarm | 13 |
| 15 | SS-05 Conveyor belt sway – belt running off-track, check alignment | SS_System | DB_Alarm_Alarm | 14 |
Acknowledge and reset on the HMI
Add a RESET button to the alarm screen and, on its Press event, use the system function SetBitWhileKeyPressed on DB_Alarm_HMI_Reset. Keep the two operator actions separate in training: acknowledge confirms on the panel that the operator has seen the message, while reset clears the latched bit in the PLC once the device is healthy. In the alarm view an unacknowledged active alarm shows I (incoming), an acknowledged active alarm IA, and an alarm that has gone but is still waiting for acknowledgement IO; once it is both gone and acknowledged it leaves the active list. For button events and status lamps see HMI buttons, lamps and auto/manual mode.
Interactive HMI Alarm Test: Simulate Wiring, Latch, Acknowledge and Reset
Use this simulator to rehearse the whole chain before touching real hardware. Click a field device to open its NC contact (fault or broken wire), watch the input drop in DB_IO, the latch set in "DB_Alarm".Alarm, and the message arrive on the HMI alarm view. Then close the contact, acknowledge on the panel and press RESET, either the field push button or the HMI button. The rung monitor shows power flow through the selected FC_AlarmMapping network in real time.
| No. | Time | Status | Class | Alarm text |
|---|
Build the Same HMI Screens in TIA Portal: Connect, Configure and Design Step by Step
Follow these steps in order and the panel will look and behave like the simulator above. The colours, grid and hierarchy behind these screens are explained in HMI screen design best practices. The design targets a 7-inch TP700 Comfort panel (800 × 480 pixels) with WinCC Comfort in TIA Portal V17 to V19; menu names can differ slightly between versions. Every object is listed with its name, position, size, animation and event, so a student can rebuild the screens exactly. The numbers ① – ⑰ in the layout figures match the object tables.
Part A – Add the HMI and connect it to the PLC
- In the project tree choose Add new device → HMI → SIMATIC Comfort Panel → 7" Display → TP700 Comfort and pick the device version that matches your panel firmware.
- In the HMI device wizard, under PLC connections, browse and select your CPU. Click Finish (the screens are built manually below, so the wizard's default screens are not needed).
- Open Devices & networks → Network view. Check that the CPU and the panel sit on the same PROFINET subnet (green line, e.g. PN/IE_1) and that the Connections tab lists
HMI_Connection_1. If not, select Connections → HMI connection and drag from the CPU interface to the panel interface. - Set IP addresses in the same subnet: CPU
192.168.0.1, panel192.168.0.2, subnet mask255.255.255.0. On the real panel, enter the same address under Control Panel → Network and Dial-Up Connections and enable PROFINET in Transfer settings. - In
DB_IOandDB_Alarm, make sure Accessible from HMI/OPC UA is ticked for the members used below. With S7-1200/1500 inside one TIA project the integrated connection is symbolic, so PUT/GET access is not needed. - Compile the PLC (Software, rebuild all) so the HMI can see the DB members.
Part B – HMI tags
Open HMI tags → Show all tags, create a tag table Alarm_Tags, and drag DB_Alarm and DB_IO from Program blocks into it. TIA Portal names the tags DB_Alarm_Alarm, DB_IO_HS_EStop_Panel_OK and so on and connects them symbolically. Then set the acquisition modes and add the internal tag HMI_Filter.
| HMI tag | Data type | Connection / PLC tag | Acquisition | Used by |
|---|---|---|---|---|
DB_Alarm_Alarm | Word | HMI_Connection_1 → "DB_Alarm".Alarm | Cyclic continuous, 100 ms | Discrete alarm trigger tag, objects ⑭ ⑮ |
DB_Alarm_PLC_Ack | Word | → "DB_Alarm".PLC_Ack | Cyclic continuous, 100 ms | PLC acknowledgement tag of every discrete alarm (ACK ALL) |
DB_Alarm_HMI_Reset | Bool | → "DB_Alarm".HMI_Reset | Cyclic in operation | RESET buttons ⑨ ⑰, lamp ⑯ |
DB_Alarm_HMI_AckAll | Bool | → "DB_Alarm".HMI_AckAll | Cyclic in operation | ACK ALL button ⑧ |
DB_Alarm_Reset_Cmd | Bool | → "DB_Alarm".Reset_Cmd | Cyclic in operation | Lamp ⑯ |
DB_Alarm_Any_Fault | Bool | → "DB_Alarm".Any_Fault | Cyclic in operation | Tower lamp ③, lamp ⑯ |
DB_IO_HS_EStop_Panel_OK … DB_IO_SS_BeltSway_OK (15 tags) | Bool | → "DB_IO".<member> | Cyclic in operation | Field status lamps ⑫ |
HMI_Filter | Int | Internal tag (no connection) | – | Filter buttons ⑤, visibility of ⑥ and ⑦ |
Part C – Alarm classes, discrete alarms and runtime settings
- HMI alarms → Alarm classes: add
HS_Safety,ES_ElectricalandSS_System, each with acknowledgement required. Set the incoming background colours to light red (#FEE2E2), light orange (#FFEDD5) and light blue (#E0F2FE), and keep the status texts I, O and A. - HMI alarms → Discrete alarms: create the fifteen alarms from the table above: trigger tag
DB_Alarm_Alarm, trigger bit 0 – 14, matching class and text. - For each discrete alarm open Properties → Acknowledgement and set the PLC acknowledgement tag to
DB_Alarm_PLC_Ackwith the same bit number as the trigger bit. This is what makes ACK ALL work: while the button is held, FC_AlarmMapping copies the alarm word intoPLC_Ack, and every active alarm is acknowledged from the PLC. - Runtime settings: set the start screen to
Alarm_Screenand, under Alarms, enable the use of alarm class colours so the alarm view rows show the class colours.
Part D – Screen template and Alarm_Screen
- Screen management → Templates: rename
Template_1toTpl_Mainand draw objects ①, ②, ③ and ⑪. Placing them in the template makes the header, tower lamp and navigation identical on every screen. - Screens → Add new screen
Alarm_Screen, select templateTpl_Main, background #E9EEF3. - Draw objects ④ – ⑩ from the toolbox (Controls → Alarm view, Elements → Button, Basic objects → Text field) and enter the values from the table. Use Properties → Properties → Layout for exact X, Y, width and height.
- Build the filter in this order: place
AV_Alland itsBtn_Ack_All, configure both, then copy and paste three times, rename, change the enabled alarm class and the visibility range. Keep all four views and ACK buttons at exactly the same position.
| # | Object type and name | Position X,Y · Size W×H | Key properties | Tag / event |
|---|---|---|---|---|
| ① | Rectangle Hdr_Bar + Text field Hdr_Title (in screen template) | 0,0 · 800×48 | Background #0D2B45; text white, bold 17 pt | Title text set per screen |
| ② | Date/time field DT_Clock (template) | 560,12 · 160×24 | Display system time, date and time | – |
| ③ | Two circles Lamp_Red, Lamp_Green (template) | 740,14 and 766,14 · 20×20 | Appearance animation, type Range: 0 → grey, 1 → red with Flashing = Yes (red lamp); 0 → green, 1 → grey (green lamp) | DB_Alarm_Any_Fault |
| ④ | Alarm view AV_Line | 0,48 · 800×40 | Current alarm states; 1 row; column headers, toolbar and scroll bar off; columns Time and Alarm text; latest alarm first | – |
| ⑤ | 4 buttons Btn_FilterAll, _HS, _ES, _SS | x 8 / 124 / 240 / 356, y 94 · 110×30 | Text All / HS_Safety / ES_Electrical / SS_System; appearance animation on HMI_Filter = 0/1/2/3 → background #0D2B45, text white | Click: SetValue HMI_Filter = 0 / 1 / 2 / 3 |
| ⑥ | 4 alarm views AV_All, AV_HS, AV_ES, AV_SS placed exactly on top of each other | 8,132 · 784×248 | Current alarm states; columns No., Time, Status, Alarm class, Alarm text; toolbar off; enabled alarm classes: all / HS_Safety / ES_Electrical / SS_System | Visibility animation on HMI_Filter: range 0–0 / 1–1 / 2–2 / 3–3 → visible |
| ⑦ | 4 buttons Btn_Ack_All, _HS, _ES, _SS, stacked like the views | 8,388 · 100×40 | Text ACK; same visibility animation as the matching alarm view | Click: AlarmViewAcknowledgeAlarm, screen object = matching alarm view |
| ⑧ | Button Btn_AckAll | 116,388 · 110×40 | Text ACK ALL | Press: SetBit DB_Alarm_HMI_AckAll; Release: ResetBit |
| ⑨ | Button Btn_Reset | 234,388 · 110×40 | Background #B91C1C, text RESET white | Press: SetBit DB_Alarm_HMI_Reset; Release: ResetBit |
| ⑩ | Text field Txt_Legend | 356,404 | Status: I = incoming · IA = acknowledged · IO = gone, not acknowledged | – |
| ⑪ | Buttons Btn_NavAlarms, Btn_NavField on a dark rectangle (template) | 0,436 · 800×44; buttons 120×32 and 140×32 | Appearance animation optional for the active screen | Click: ActivateScreen Alarm_Screen / Field_Status |
Why four alarm views instead of one: a single WinCC Comfort alarm view cannot change its alarm-class filter at runtime, so each filter button simply makes a different preconfigured view visible. Each view has its own ACK button because AlarmViewAcknowledgeAlarm acknowledges the alarm selected in one specific view.
Part E – Field_Status screen
- Add screen
Field_Statuswith templateTpl_Main. - Build one signal row (white rectangle, lamp ⑫, two text fields ⑬), configure the lamp animation, then group, copy and paste it for all fifteen signals and change the tag and texts. Column headings use the HS / ES / SS colours.
- Add the alarm-word block ⑭ and ⑮: configure
Bit_X0once, then copy it fifteen times and change only the bit number in the animation. - Add the status lamps ⑯ and the RESET button ⑰.
| # | Object type and name | Position X,Y · Size W×H | Key properties | Tag / event |
|---|---|---|---|---|
| ⑫ | 15 circles Lamp_HS01 … Lamp_SS05 | column x 16 / 280 / 544, rows y 88 + 36·n · 18×18 | Appearance animation, type Range: 0 → red, Flashing = Yes; 1 → green | DB_IO_<member> of the same signal |
| ⑬ | 15 text fields for ID + name and 15 for the input address, on white rectangles 256×30 | next to each lamp | Static text, e.g. "HS-01 E-stop main panel" and "%I0.0" | – |
| ⑭ | I/O field IO_AlarmHex | 682,266 · 110×24 | Mode Output; display format Hexadecimal; format pattern 4 digits | DB_Alarm_Alarm |
| ⑮ | 16 rectangles Bit_X0 … Bit_X15 with text X0 … X15 | x = 8 + 49·n, y 296 · 44×30 | Appearance animation, type Single bit, bit n: 0 → grey, 1 → red | DB_Alarm_Alarm |
| ⑯ | 3 circles with text: Reset_Cmd, Any_Fault, HMI_Reset | y 349, x 8 / 158 / 308 · 18×18 | Range animation 0 → grey, 1 → orange (Reset_Cmd, HMI_Reset) or red (Any_Fault) | DB_Alarm_Reset_Cmd, DB_Alarm_Any_Fault, DB_Alarm_HMI_Reset |
| ⑰ | Button Btn_Reset2 | 640,340 · 152×40 | Copy of ⑨ | Same events as ⑨ |
Part F – Compile, download and test
- Select the HMI device and run Compile → Software (rebuild all); fix every error and check the warnings for unconnected tags.
- Without hardware: start the CPU in S7-PLCSIM, then select the HMI and choose Online → Simulation → Start. Toggle the inputs %I0.0 – %I1.7 from a PLCSIM SIM table to play the role of the field contacts.
- With hardware: download the PLC, then the HMI (Download to device, PG/PC interface on the PROFINET network card).
- Run the same cases as the simulator: open a contact, see the lamp turn red and the alarm arrive, close it, ACK, RESET; try RESET with the fault active; test each filter button and ACK ALL. Then sign off the loop-test sheet in the lab.
Any_Fault and flashes while any fault is latched. If you also want an indication of unacknowledged alarms, as in the simulator, add the WinCC alarm indicator object, which flashes while unacknowledged alarms are pending.Troubleshooting Discrete Alarms: Symptom, Cause and First Check
Most alarm problems found during commissioning fall into a handful of patterns. Work from the field towards the panel: DI card LED, then DB_IO, then "DB_Alarm".Alarm, then the HMI tag. The first layer where the value is wrong is where the fault is.
| Symptom | Likely cause | First check |
|---|---|---|
| Alarm will not clear after RESET | Field contact is still open, so the fault branch holds the bit (correct behaviour) | Watch the DB_IO bit: it must be 1 before reset can work |
| RESET does nothing even with a healthy contact | Reset push button wired to the wrong input, or HMI button not linked to DB_Alarm_HMI_Reset | Monitor "DB_Alarm".Reset_Cmd while pressing each reset button |
| Alarm clears by itself, operator never sees it | Seal-in branch missing, FC_AlarmMapping not called, or a maintained reset switch keeps Reset_Cmd at 1 | Check OB1 calls and that Reset_Cmd is 0 when nobody presses reset |
| All HS, ES and SS alarms come together | Field 24 VDC supply off or its MCB tripped; every NC input drops at once | Measure L+ at terminal block X1 |
| DI card LED is on but the DB_IO bit is 0 | FC_InputMapping not called, or a network copies the wrong PLC tag | Compare the PLC tag table with the IO mapping table row by row |
| Alarm bit is 1 but nothing appears on the HMI | Wrong trigger tag or bit, member not Accessible from HMI, acquisition mode not cyclic continuous, or connection offline | Open the discrete alarm row and the HMI tag properties |
| Wrong message text for a fault (for example bit 0 shows bit 8) | Alarm word placed in %MW and bits addressed as M bits, so bytes are swapped | Move the word into DB_Alarm and use slice access .%Xn |
| Message stays in the list after reset | The alarm went but is still unacknowledged (status IO) | Acknowledge it; it leaves the list once both gone and acknowledged |
| Alarm repeats came and went quickly | Chattering contact or loose terminal on an NC circuit | Tighten and ferrule the circuit; debounce only non-safety signals with a short TON |
For deeper CPU-side diagnosis, including the diagnostic buffer and watch tables, see Siemens PLC troubleshooting.
Analog Alarms and Limit Monitoring
Analog alarms watch a numeric tag and trigger when it crosses a limit. Open HMI alarms → Analog alarms and configure the trigger tag, the limit value and the limit mode.
- Higher: triggers when the value rises above the limit, for high temperature or pressure.
- Lower: triggers when the value falls below the limit, for low level or low flow.
- Delay: the value must stay past the limit for this long before the message appears.
- Dead band: a percentage or absolute hysteresis so a value hovering on the limit does not flood the list.
Delay and dead band are the two settings that decide whether the alarm system is usable. Without them, a signal sitting exactly at its limit generates hundreds of come-and-go messages in a shift, and operators stop reading the list. The reasoning behind these choices is expanded in SCADA alarm management.
Set four limits on important measurements where it makes sense: low low, low, high and high high, each in a different alarm class, so an early warning looks different from a trip condition.
Configure a full alarm system in class
Practical Siemens HMI and WinCC sessions covering fault words, alarm classes, archives and acknowledgement.
Alarm Classes, Acknowledgement and the Alarm View
An alarm class defines behaviour for a whole group of messages: display colours for came, went and acknowledged states, whether acknowledgement is required, and whether the message is archived.
| Class | Acknowledgement | Typical use |
|---|---|---|
| Errors | Required | Trips and faults that stop production |
| Warnings | Not required | Conditions that need attention but not a stop |
| System | Not required | Panel and communication diagnostics |
| Operating messages | Not required | Mode changes, batch start and end events |
Acknowledgement can be written back to the PLC using an acknowledgement tag, which lets the control program require an operator action before a fault is reset. That is a much better pattern than allowing an automatic reset that hides the fault before anyone reads it.
Placing the alarm view
Add a full alarm view on a dedicated alarm screen with columns for time, alarm class, text and status, and enable filtering so an operator can show only unacknowledged errors. Then add a single-line alarm view to the screen template so the highest priority active message is visible on every screen in the project.
Keep an alarm history available as well, so a supervisor can see what happened during the night shift rather than only what is active now.
Hands-On Lab: Discrete Alarms from NC Field Wiring to the HMI Alarm View
Hands-on- TIA Portal with WinCC Comfort and a Comfort Panel or HMI simulation
- S7-1200 or S7-1500 with 16 digital inputs, or a PLC trainer kit with toggle switches
- Switches or jumpers to simulate the field contacts; never bypass a live safety circuit
- Estimated time: 90 minutes
Wire the NC feedbacks
Wire fifteen closed-when-healthy contacts (five Human Safety, five Electrical Safety, five System Safety) from L+ to %I0.0 to %I1.6, and a normally open reset push button to %I1.7.
Declare the PLC input tags
On the PLC tag table (the IO mapping page) declare only the sixteen physical inputs %I0.0 to %I1.7 with symbolic names and comments.
Create DB_IO and DB_Alarm
Add global DB_IO with one Bool per input, and DB_Alarm with Alarm (Word), Reset_Cmd, HMI_Reset and Any_Fault, all accessible from HMI.
Program FC_InputMapping
Copy each PLC input tag to its DB_IO member with one contact-and-coil network per signal; this is the only block that uses %I tags.
Program FC_AlarmMapping and call both FCs
Build the reset network and one latch network per signal using only DB_IO and DB_Alarm members, then call FC_InputMapping before FC_AlarmMapping in OB1.
Configure alarm classes and discrete alarms
Create HS_Safety, ES_Electrical and SS_System classes and one discrete alarm per bit with trigger tag DB_Alarm_Alarm, trigger bit 0 to 14.
Build the HMI screens
Add a TP700 Comfort panel connected to the CPU, create the HMI tags, then build Alarm_Screen and Field_Status with the object tables on this page: alarm views, filter, ACK, ACK ALL, RESET, tower lamp and field status lamps.
Test fault, acknowledge and reset
Rehearse every case in the interactive simulator on this page, then open each real field contact and confirm came, acknowledged, latched and reset behaviour on the panel.
Loop-test sheet (print and sign during commissioning)
Test every signal from the field device all the way to the panel, one at a time. A signal passes only when all four columns behave as written.
| ID | Field action | PLC input and DB_IO | Alarm bit and HMI | Reset check | OK |
|---|---|---|---|---|---|
| HS-01 | Open: E-stop main panel | %I0.0 = 0 → DB_IO.HS_EStop_Panel_OK = 0 | Alarm.%X0 = 1, message 1 in class HS_Safety | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| HS-02 | Open: E-stop field station | %I0.1 = 0 → DB_IO.HS_EStop_Field_OK = 0 | Alarm.%X1 = 1, message 2 in class HS_Safety | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| HS-03 | Open: Safety door | %I0.2 = 0 → DB_IO.HS_SafetyDoor_OK = 0 | Alarm.%X2 = 1, message 3 in class HS_Safety | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| HS-04 | Open: Light curtain | %I0.3 = 0 → DB_IO.HS_LightCurtain_OK = 0 | Alarm.%X3 = 1, message 4 in class HS_Safety | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| HS-05 | Open: Pull-cord switch | %I0.4 = 0 → DB_IO.HS_PullCord_OK = 0 | Alarm.%X4 = 1, message 5 in class HS_Safety | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| ES-01 | Open: Incomer MCCB | %I0.5 = 0 → DB_IO.ES_MCCB_Main_OK = 0 | Alarm.%X5 = 1, message 6 in class ES_Electrical | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| ES-02 | Open: Control transformer | %I0.6 = 0 → DB_IO.ES_Transformer_OK = 0 | Alarm.%X6 = 1, message 7 in class ES_Electrical | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| ES-03 | Open: SPP relay | %I0.7 = 0 → DB_IO.ES_SPP_OK = 0 | Alarm.%X7 = 1, message 8 in class ES_Electrical | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| ES-04 | Open: Surge protection SPD | %I1.0 = 0 → DB_IO.ES_SPD_OK = 0 | Alarm.%X8 = 1, message 9 in class ES_Electrical | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| ES-05 | Open: Motor M1 MPCB | %I1.1 = 0 → DB_IO.ES_MPCB_M1_OK = 0 | Alarm.%X9 = 1, message 10 in class ES_Electrical | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| SS-01 | Open: Overtravel fwd LS | %I1.2 = 0 → DB_IO.SS_OTL_Fwd_OK = 0 | Alarm.%X10 = 1, message 11 in class SS_System | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| SS-02 | Open: Overtravel rev LS | %I1.3 = 0 → DB_IO.SS_OTL_Rev_OK = 0 | Alarm.%X11 = 1, message 12 in class SS_System | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| SS-03 | Open: Air pressure | %I1.4 = 0 → DB_IO.SS_AirPressure_OK = 0 | Alarm.%X12 = 1, message 13 in class SS_System | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| SS-04 | Open: Hydraulic oil level | %I1.5 = 0 → DB_IO.SS_HydOilLevel_OK = 0 | Alarm.%X13 = 1, message 14 in class SS_System | Close contact, ACK, RESET → bit 0, message gone | ☐ |
| SS-05 | Open: Belt sway switch | %I1.6 = 0 → DB_IO.SS_BeltSway_OK = 0 | Alarm.%X14 = 1, message 15 in class SS_System | Close contact, ACK, RESET → bit 0, message gone | ☐ |
Every field contact is closed when healthy, %I tags appear only in FC_InputMapping, every fault latches into its own Alarm bit with a commented network, reset only clears faults that have gone, and every HMI message names the device and the first thing to check.
Frequently asked questions
What is the difference between a discrete alarm and an analog alarm?
A discrete alarm is triggered by a single bit of a tag, normally a bit in a PLC fault word. An analog alarm is triggered when a numeric tag crosses a configured limit value.
Why group faults into a word instead of using individual bits?
One word tag carries up to sixteen alarms over a single connection, which reduces communication load and keeps the alarm numbering aligned between the PLC program and the HMI alarm list.
What does the dead band on an analog alarm do?
It adds hysteresis so a value hovering around its limit does not repeatedly trigger and clear. Combined with a delay time it is the main defence against alarm flooding.
Should every alarm require acknowledgement?
No. Reserve acknowledgement for conditions that need an operator decision, usually trips and faults. Warnings and operating messages that clear themselves are better left without it.
Why are alarm feedbacks wired with NC contacts?
A contact that is closed when the device is healthy keeps the PLC input at 1 in normal running. A real fault, a broken wire, a loose terminal or a lost 24 VDC supply all make the input drop to 0, so every failure raises an alarm instead of hiding one.
Why map inputs into a DB instead of using %I addresses in the alarm logic?
An input mapping FC copies every %I tag into a global DB once per scan. The alarm mapping FC then reads only DB members, so a rewired input or a replaced input card means changing one network in the input mapping, not the alarm logic. It also gives one place to monitor every signal during commissioning.
Why keep HMI_Reset and the Alarm word in a DB instead of M memory?
Members of an optimized global DB are symbolic, can be released to the HMI with Accessible from HMI, and cannot collide with another programmer's marker addresses. An alarm word in %MW also hides a byte swap: bit %X0 of MW20 is physically M21.0.
Why does the ladder use a normally closed contact instruction on an NC-wired input?
The mapped DB_IO bit is 1 when healthy, so the fault condition is bit = 0. The normally closed contact instruction passes power when the bit is 0, which sets the alarm bit exactly when the field contact opens.
Why is the reset push button placed in the latch branch and not in series with the coil?
With the reset contact only in the seal-in branch, the fault branch keeps the alarm bit on while the fault is still present. The operator can clear an alarm only after the device has returned to healthy, so reset cannot hide an active fault.
What does "DB_Alarm".Alarm.%X0 mean in TIA Portal?
It is slice access: bit 0 of the WORD member Alarm in the global data block DB_Alarm. %X0 to %X15 address the 16 bits of the word, and HMI discrete alarm trigger bit 0 refers to the same bit, so PLC and HMI numbering line up.
Can the emergency stop be wired only to a standard PLC input?
No. The emergency stop and safety door must act through a hardwired safety relay or a fail-safe F-CPU. The standard PLC input shown here reads an auxiliary contact of that safety circuit only for alarm annunciation.