Triggering HMI Alarms from Bool Inputs in TIA Portal V15.1

David Krause14 min read
HMI / SCADASiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Triggering HMI Alarms from Bool Inputs in TIA Portal V15.1

Configuring a discrete HMI alarm from a digital input such as %I0.0 in TIA Portal V15.1 is one of the most common stumbling blocks for engineers moving from WinCC Flexible or third-party HMIs to the integrated Comfort/ Unified panel environment. The discrete alarm editor in TIA Portal only accepts a Word (INT, UINT, or WORD) data type for the trigger tag, while a digital input is, by definition, a Bool (bit). This reference explains the underlying memory model, the bit-to-word mapping required to bridge the gap, the exact configuration steps in the PLC and HMI editors, and the field-tested commissioning checks that confirm a single bit drives the correct alarm text.

1. Problem Definition

A digital input on an S7-1200 or S7-1500 PLC is wired into the process image as a Bool tag, for example %I0.0 (motor overload contactor), %I0.1 (E-stop pressed), or %I0.2 (high level). The PLC programmer can use these bits directly in the user program with no further manipulation. The challenge appears when the same condition must drive a discrete alarm on the HMI: the TIA Portal alarm editor rejects a Bool trigger tag with the message "Only Word data types are permitted."

The reason is architectural. A discrete alarm in TIA Portal is designed to pack up to 16 (or 32) discrete conditions into a single 16-bit word read from the PLC each cycle. The HMI does not poll 16 individual Bool tags; it polls one Word and decodes the bit pattern locally. This minimises HMI/PLC communication traffic and guarantees that all 16 conditions are sampled atomically. The PLC programmer is therefore responsible for aggregating the discrete faults into a Word before the HMI polls it.

Important: The HMI is not "limited" to Word data types - it is intentionally designed around Word-based trigger tags. Trying to force a Bool trigger through a workaround tag (e.g., a single-bit Word) defeats the purpose and creates extra communication load. The correct approach is to aggregate the Bool conditions into a single status Word and configure one alarm block per bit.

2. Prerequisites

Before starting the configuration, confirm the following:

  • TIA Portal V15.1 with the latest HSP (Hardware Support Package) installed. Update to Update 4 or later if HMI compile errors occur.
  • STEP 7 Professional V15.1 for PLC programming (S7-1200/1500) or STEP 7 Basic V15.1 for S7-1200 only.
  • WinCC Professional / Comfort V15.1 for HMI configuration, or the Unified runtime add-in.
  • An S7-1200 CPU (firmware V4.2 or later recommended for full alarm acknowledgement support) or S7-1500 CPU (any firmware V2.x).
  • A Comfort Panel, Unified Panel, or WinCC Runtime Advanced/Professional HMI device added to the project with an established HMI connection to the PLC.
  • Defined discrete process inputs (e.g., %I0.0 motor overload, %I0.1 E-stop, %I0.2 high level).

Reference: S7-1200 Programmable Controller System Manual (entry ID 109751049) and S7-1500 Automation System System Manual (entry ID 109755202).

3. PLC Memory Architecture: Bit-to-Word Mapping

On the S7-1200/1500, the bit memory area (M) is byte-addressable. Any word (%MWx) overlaps exactly two bytes (%MB2x and %MB2x+1) and sixteen individual bits (%Mx.0 through %Mx.7 through %M(x+1).0 through %M(x+1).7). The relationship is fixed at the firmware level - there is no implicit data conversion required. Writing to bit %Mx.y automatically updates the corresponding bit position in word %MWx, and vice versa.

The standard pattern for HMI discrete alarm aggregation is therefore:

  • Reserve one Word in the M area (e.g., %MW300) as the alarm status word.
  • Reserve the overlapping 16 Bool tags (%M300.0 through %M301.7) as the individual fault flags.
  • In the PLC user program, write a 1 to the appropriate bit whenever the underlying process condition becomes true (e.g., motor overload contact closes, energise %M300.0).
  • In the HMI, configure a discrete alarm with trigger tag "FaultWord1" and trigger bit 0, 1, 2 ... 15 as required.
Bit-to-Word Address Overlap (S7-1200/1500)
Word High Byte Low Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
%MW300 %MB301 %MB300 %M301.7 %M301.6 %M301.5 %M301.4 %M301.3 %M301.2 %M301.1 %M300.0

Note the byte order: Siemens stores the low byte at the lower memory address (%MB300 holds bits 0 to 7, %MB301 holds bits 8 to 15). Some legacy documentation references Motorola (big-endian) ordering for the bit numbering; in TIA Portal V15.1 the trigger bit number entered into the HMI alarm dialog matches the bit number of %MWx directly, so bit 0 = %M300.0, bit 8 = %M301.0.

4. Step 1 - Create the PLC Tags

Open the PLC tag table in the project tree (Project → PLC_1 → PLC tags → Default tag table). Add the following tags:

PLC Tags to Add
Name Data Type Address Comment
Motor_OL_Input Bool %I0.0 Motor overload contact (NC)
E_Stop_Input Bool %I0.1 Emergency stop pressed
High_Level_Input Bool %I0.2 Tank high level switch
FaultWord1 Word %MW300 HMI alarm trigger word #1
Motor_OL_Fault Bool %M300.0 Bit 0 of FaultWord1
E_Stop_Fault Bool %M300.1 Bit 1 of FaultWord1
High_Level_Fault Bool %M300.2 Bit 2 of FaultWord1

The two flag tags (Motor_OL_Fault, E_Stop_Fault, High_Level_Fault) share the same physical memory as FaultWord1. Writing a 1 to Motor_OL_Fault sets bit 0 of %MW300; the HMI sees this as trigger bit 0 active.

Tip: declare both the Bool flag and the Word tag with the same starting address; TIA Portal will not flag a duplicate because they access overlapping regions of the same memory area. To avoid confusion, add the comment column shown above so future maintenance engineers can see the relationship at a glance.

5. Step 2 - Program the Bit-Mapping Logic

The user program must transfer the physical input states into the flag bits whenever the conditions are met. Use a standard edge-triggered assignment in ladder logic (LAD) or structured text (ST).

5.1 Ladder Logic (LAD) Implementation

Add a new network in OB1 (or a cyclic alarm OB such as OB35) for each fault:

Network 1: Motor Overload Fault
       Motor_OL_Input           Motor_OL_Fault
  |  | |------[/]--------------( S )--|
  |    |                              |
  |  NC contact: input TRUE on healthy|

Network 2: E-Stop Fault
       E_Stop_Input             E_Stop_Fault
  |  | |------[/]--------------( S )--|

Network 3: High Level Fault
       High_Level_Input         High_Level_Fault
  |  | |------[/]--------------( S )--|

Network 4: Acknowledge / Reset (optional)
       HMI_Ack_Button           Motor_OL_Fault
  |  | |----------------------( R )--|
  |    |                              |
  |  Rising-edge pulse from HMI       |

If the input is wired Normally Open (NO), replace the [/] NC contact with a standard | NO contact. If the input is Normally Closed (NC, as is standard for motor overload contacts and E-stops), the NC contact [/] correctly evaluates TRUE when the contact opens (fault condition).

5.2 Structured Text (ST) Implementation

// Aggregate discrete faults into FaultWord1
IF NOT "Motor_OL_Input" THEN
    "Motor_OL_Fault" := TRUE;        // Bit 0 set
END_IF;

IF NOT "E_Stop_Input" THEN
    "E_Stop_Fault" := TRUE;          // Bit 1 set
END_IF;

IF "High_Level_Input" THEN
    "High_Level_Fault" := TRUE;      // Bit 2 set
END_IF;

// Optional: latching until acknowledged
IF "HMI_Ack_Button" THEN
    "Motor_OL_Fault" := FALSE;
    "E_Stop_Fault"  := FALSE;
    "High_Level_Fault" := FALSE;
END_IF;

5.3 Direct Bit-Write Using AT Function

For higher-performance implementations where the program is writing many faults at once, declare an AT overlay in a global data block (DB) instead of using individual := statements:

DATA_BLOCK "AlarmAggregation"
  STRUCT
    WordView : WORD;       // %MW300 view
    BitView  AT WordView : ARRAY[0..15] OF BOOL;
  END_STRUCT;
END_DATA_BLOCK

Now the program can address "AlarmAggregation".BitView[0], [1], ... [15] as Bool while the HMI reads "AlarmAggregation".WordView as Word. This avoids any risk of accidentally using a mismatched address and is the preferred pattern for projects with 8 or more faults. See the S7-1200 System Manual, section on AT function overlays.

6. Step 3 - Configure the HMI Discrete Alarm

Switch to the HMI device in the project tree (e.g., HMI_1).

  1. Open HMI → HMI alarms → Discrete alarms.
  2. Double-click an empty row to open the alarm editor.
  3. In the ID column, enter a unique numeric identifier (e.g., 1).
  4. In the Text column, enter the alarm message displayed on the panel, e.g., Motor Overload Tripped.
  5. In the Trigger tag column, click the dropdown and select the PLC tag FaultWord1 (which points to %MW300).
  6. In the Trigger bit column, enter the bit number that corresponds to the fault (e.g., 0 for motor overload, 1 for E-stop, 2 for high level).
  7. Configure the Class (Errors, Warnings, Information) and any Acknowledgement behaviour as required.
  8. Repeat for each bit of FaultWord1 you intend to use.
  9. Compile the HMI (right-click HMI_1 → Compile → Software (only)).

The completed discrete alarm table should resemble:

HMI Discrete Alarm Configuration
ID Text Trigger Tag Trigger Bit Class
1 Motor Overload Tripped FaultWord1 0 Errors
2 Emergency Stop Pressed FaultWord1 1 Errors
3 Tank High Level FaultWord1 2 Warnings

7. Step 4 - Display the Alarm View on the HMI

Drag an Alarm view control from the Toolbox onto a screen. Configure the columns to include Date, Time, Status, Text. Under Filter, enable the classes you defined. When the PLC sets bit 0 of %MW300, the alarm view will populate with the text "Motor Overload Tripped" at the next HMI poll cycle (typically 1 second, configurable under → HMI → Runtime settings → Alarms).

8. Bit-Numbering Convention Reference

The most common field issue with this pattern is bit-number mismatch. The table below is the single source of truth for which bit number to enter in the HMI alarm editor:

Bit Mapping Reference for %MW300
HMI Trigger Bit PLC Bool Tag Byte Address Bit Weight (hex)
0 %M300.0 MB300 0x0001
1 %M300.1 MB300 0x0002
2 %M300.2 MB300 0x0004
3 %M300.3 MB300 0x0008
4 %M300.4 MB300 0x0010
5 %M300.5 MB300 0x0020
6 %M300.6 MB300 0x0040
7 %M300.7 MB300 0x0080
8 %M301.0 MB301 0x0100
9 %M301.1 MB301 0x0200
10 %M301.2 MB301 0x0400
11 %M301.3 MB301 0x0800
12 %M301.4 MB301 0x1000
13 %M301.5 MB301 0x2000
14 %M301.6 MB301 0x4000
15 %M301.7 MB301 0x8000

9. Step 5 - Commissioning and Verification

Verification should always proceed in the same order: PLC logic first, communication second, HMI display third. This isolates any fault to one domain.

9.1 Verify PLC Logic

  1. Download the PLC project to the CPU and go online.
  2. Open the Watch table containing %I0.0, %M300.0, and %MW300.
  3. Force %I0.0 = TRUE (motor healthy). Confirm %M300.0 = FALSE and %MW300 = 16#0000.
  4. Force %I0.0 = FALSE (overload tripped). Confirm %M300.0 = TRUE and %MW300 = 16#0001.
  5. Repeat for each bit. If the Word does not update, the user program is not running - check the OB1 cycle bit, the CPU run/stop switch, and any conditional logic blocking the assignment.

9.2 Verify HMI/PLC Communication

  1. Start the HMI simulation (RT Start) or download to the panel.
  2. In the HMI's tag simulation (WinCC → Tools → Tag simulation), write 1 to FaultWord1 directly. The corresponding alarm should appear.
  3. Set FaultWord1 back to 0. The alarm should clear (or remain pending if latched with acknowledgement).

9.3 Verify End-to-End Function

  1. With the HMI running live against the PLC, force %I0.0 = FALSE from the watch table.
  2. Within one HMI poll cycle, alarm ID 1 ("Motor Overload Tripped") must appear in the alarm view.
  3. Reset the input. The alarm clears (or moves to acknowledged state if so configured).
Field tip: If the alarm never appears but the Word is correctly set in the PLC, check the HMI connection status under → Connections. The trigger tag must be reachable on the active connection. A common mistake is configuring the alarm against the PLC tag of the offline project while the runtime is connected to a different CPU (e.g., the simulation instance). Use the connection diagnostics in the HMI runtime (System → Diagnostics → Connections) to confirm.

10. Scaling Beyond 16 Alarms

A single Word supports 16 discrete alarms. For installations requiring more, use a DWORD (%MD300) or two consecutive Words (%MW300 and %MW302) - skip one Word address between blocks to leave headroom for future expansion and avoid overlap. Define each Word as a separate trigger tag in the HMI:

Multi-Word Alarm Aggregation Example
HMI Trigger Tag Address Bit Range Typical Use
FaultWord1 %MW300 0-15 Process faults (overload, E-stop, level)
FaultWord2 %MW302 0-15 Drive faults (VFD trip, comms loss)
FaultWord3 %MW304 0-15 Maintenance warnings (filter, lube)
FaultDWord1 %MD306 0-31 System-level diagnostics

11. Troubleshooting Matrix

Common Faults and Resolutions
Symptom Likely Cause Resolution
HMI editor rejects the trigger tag with "Only Word data types are permitted." Trigger tag is declared as Bool. Change PLC tag type to Word / INT / UINT / DWORD. Keep the Bool flag as a separate tag at the same address.
Alarm triggers the wrong text (e.g., overload displays "E-stop"). Trigger bit number does not match the PLC bit being set. Verify bit-to-word mapping table. Trigger bit N must drive %Mx.N in the Word at %MWx.
Alarm does not appear at all. HMI connection inactive; PLC in STOP; tag not in the cyclic polling list. Check HMI connection diagnostics. Confirm PLC is in RUN. Verify the tag is referenced (an unused tag will not be polled).
Alarm appears but does not clear when the input resets. Fault bit is latched (Set-only assignment, no Reset). Add a Reset coil driven by the HMI acknowledge button or an auto-clear condition.
Alarm appears with delay > 2 seconds. HMI poll cycle set too long; many tags competing for bandwidth. Reduce alarm acquisition cycle in HMI → Runtime settings. Use area pointer for alarms instead of tag-based triggers if response time is critical.
Compile error "Tag address already used" when creating FaultWord1 at %MW300 Another DB or tag table already references %MW300. Search the cross-reference (Ctrl+Shift+F) for %MW300 and move to a free M area.
Alarm appears on every power-up even though no fault exists. Retentive M bit not initialised on restart. Use non-retentive M area, or add OB100 startup logic that clears the FaultWord on cold restart.
Bit N triggers correctly in the PLC but the HMI shows no reaction HMI trigger bit indexing is 1-based instead of 0-based in older projects Check project settings. In V15.1 the trigger bit is 0-based; enter 0 for %M300.0.

12. Best Practices for Production Systems

  • Use a global DB with an AT overlay rather than scattered M flags. This makes the alarm word self-documenting and eliminates the risk of overlapping other M usage.
  • Reserve contiguous Words (e.g., %MW300-%MW320) at the top of the M area for alarm aggregation. Document the layout in the project header.
  • Latch faults that require acknowledgement and provide a separate acknowledge tag (Bool at another M bit) wired from an HMI button or the global acknowledge area pointer.
  • Mirror the FaultWord to a DB if you need to retain alarm history through power cycles; M area is non-retentive by default on S7-1200 unless declared otherwise in the PLC properties.
  • Use symbolic addressing throughout. Never reference %MW300 directly in the HMI tag table; use the symbolic name FaultWord1 so the same project can be reused across CPUs with different memory layouts.
  • Prefer the alarm area pointer over tag-based alarms for very high alarm counts (>500). The area pointer allows the PLC to push only the changed bit position, reducing HMI/PLC traffic dramatically.

For further reading on the alarm architecture, see the WinCC Professional V15.1 - Working with HMI Alarms (entry ID 109773926) and the TIA Portal Help installed locally (Help → Show Help, search for "Discrete alarms - basics").

13. FAQ

Why does the HMI alarm editor refuse a Bool trigger tag?

Discrete alarms in TIA Portal V15.1 are designed around Word-based trigger tags so that up to 16 conditions can be polled atomically in a single read. The HMI decodes the bit pattern locally; the Bool flag in the PLC only needs to set the corresponding bit of the word.

How do I map %I0.0 to trigger bit 0 of %MW300?

Either set %M300.0 from a ladder network driven by %I0.0 (e.g., a Set coil), or create a global DB with an AT overlay that views %MW300 as ARRAY[0..15] OF BOOL and write %I0.0 directly to BitView[0]. Both methods update the same physical memory.

What is the difference between trigger bit 0 and %M300.0?

They refer to the same bit. Trigger bit 0 in the HMI alarm dialog corresponds to %M300.0 in the PLC, which is the LSB of %MW300. Trigger bit 15 corresponds to %M301.7, the MSB.

Can I use an INT or DWORD trigger tag instead of a WORD?

Yes. The TIA Portal discrete alarm editor accepts WORD, INT, UINT, DWORD, DINT, and REAL (REAL is rarely used and only for analog-level limits). For 16 alarms use WORD; for 32 use DWORD; INT/UINT are interchangeable with WORD for this purpose.

How do I make the alarm latch until acknowledged?

Use a Set coil on the fault bit (S) and a separate Reset coil (R) wired to an HMI acknowledge button or a PLC-side acknowledge tag. The alarm word will retain its value through power cycles only if the underlying M or DB memory is retentive - configure retentivity in the PLC properties or in the DB settings.

Back to blog