Resolving TIA Portal Bool Array Trigger Tag Error in WinCC

David Krause12 min read
HMI / SCADASiemensTroubleshooting
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

Problem Overview

When configuring discrete alarms on a SIMATIC HMI with WinCC Comfort or WinCC Unified in TIA Portal V16 (or later), engineers frequently encounter a configuration rejection when assigning an Array [0..31] of Bool PLC tag as the alarm trigger tag. The TIA Portal editor returns an error similar to "The data type is not permitted for a trigger tag" or rejects the HMI tag during the Trigger tag selection dropdown. This blocks the entire alarm pipeline: no bit can be mapped to a discrete alarm text, no acknowledge variable can be created, and the project cannot be compiled to the HMI runtime.

The symptom typically presents as follows:

  • HMI tag is created as Array [0..31] of Bool and successfully linked to the matching PLC tag (e.g., "plcdata".Alarm).
  • The HMI tag is reachable in the tag table, online monitoring is functional, and the connection status shows OK.
  • When the tag is selected in the Discrete alarms editor and the Trigger tag field is opened, the entry is either greyed out or rejected with a data-type validation error.
  • Compiling the HMI produces warnings such as "Tag <name> cannot be used as a trigger tag" or "Invalid data type for trigger".

The root of the failure is not a bug, a firmware defect, or a licensing issue; it is a hard architectural constraint in the WinCC alarm subsystem.

Root Cause: WinCC Trigger Tag Data Type Requirements

WinCC Comfort, WinCC Advanced, and WinCC Unified all require that the trigger tag for a discrete alarm be a fixed-width, bit-addressable integer type. According to the official WinCC Unified V20 alarm configuration documentation, valid trigger tag data types are:

  • Bool (single bit, single alarm)
  • Byte (8 alarms, bit 0-7)
  • Word (16 alarms, bit 0-15)
  • DWord (32 alarms, bit 0-31)
  • LWord (64 alarms, bit 0-63)
  • Array of Byte / Word / DWord / LWord (multi-word alarm blocks)

The reference is documented in the Siemens TIA Portal Help under Configure trigger (RT Unified) - WinCC Unified.

An Array of Bool is not a valid trigger type because the alarm subsystem must address individual bits inside a contiguous, machine-word-aligned memory region. The runtime must be able to compute a single absolute bit offset (byte index × 8 + bit index) and read the value in a single fetch. A boolean array breaks that model: TIA Portal would have to either (a) generate a separate fetch per bit (catastrophic for 32-bit alarm clusters) or (b) maintain a shadow register. Siemens chose to disallow the configuration instead.

This restriction applies regardless of:

  • The HMI panel series (Comfort, Unified Comfort Panels, WinCC Runtime Advanced, WinCC Runtime Professional).
  • Whether the source PLC tag resides in an optimized or non-optimized DB.
  • Whether the HMI tag is internal or linked to a PLC tag via an HMI connection.
  • The TIA Portal version (V15.1, V16, V17, V18, V19, V20, and current V21).

Trigger Tag Parameter Reference

Property Valid Value Invalid Value Notes
Data type (single alarm) Bool - One trigger per alarm.
Data type (clustered) Byte, Word, DWord, LWord SInt, Int, UInt, Real, LReal, String, WString Cluster is required for multi-bit alarm blocks.
Data type (multi-cluster) Array of Byte, Array of Word, Array of DWord Array of Bool, Array of Int Multi-cluster allowed for >32 alarms.
Bit access 0..7 (Byte), 0..15 (Word), 0..31 (DWord) Dynamic bit index Bit must be a compile-time constant in the alarm editor.
PLC tag location Global DB, Instance DB, M memory, I/O Temporary LOCALS Temporary data is invalid; tag must be retentive or live for the alarm horizon.
DB block attribute Optimized or non-optimized (with absolute addressing) - Both supported; non-optimized may be required if HMI accesses bits by absolute address.

Solution 1: Use a Word / DWord Array in a Non-Optimized DB

The cleanest fix is to change the alarm source data type at the PLC level from Array [0..31] of Bool to Array [0..1] of Word (32 bits) or Array [0..0] of DWord (32 bits). This requires modifying the data block from optimized to non-optimized so that the HMI can address each word absolutely.

Step 1 — Recreate the alarm block

  1. Open the project in TIA Portal and navigate to the Program blocks tree.
  2. Right-click the alarm source DB and select Properties → Attributes.
  3. Uncheck Optimized block access. Click OK and confirm the recompile prompt.
  4. Replace the existing Array [0..31] of Bool member with Array [0..1] of Word (rename to e.g. AlarmWord) or Array [0..0] of DWord.
  5. Recompile the PLC program; fix any code that referenced individual bool elements with new bit syntax (e.g., DB.AlarmWord[0].%X5 instead of DB.AlarmBool[5]).

Step 2 — Map the HMI tag

  1. Open the HMI tag table on the Comfort Panel project.
  2. Add a new tag (e.g., HMI_AlarmWord) with data type Word or Array of Word.
  3. In the Connection column, link to the same PLC, and in the Address field, type the absolute DB address (e.g., DB100.DBX0.0 WORD for the first 16 bits, or use the dropdown to navigate to "MyDB".AlarmWord[0]).
  4. Verify the tag compiles without warnings.

Step 3 — Configure the discrete alarm

  1. Open HMI alarms → Discrete alarms.
  2. Add a new alarm row.
  3. Set Trigger tag to HMI_AlarmWord (or HMI_AlarmWord[0]).
  4. Set Trigger bit to the desired bit index (0-15 for Word, 0-31 for DWord).
  5. Configure the alarm text, class (e.g., Warnings), and acknowledge tag if required.
  6. Repeat for each bit. The editor now accepts the configuration because the data type is on the approved list.
Note: Non-optimized DBs disable some S7-1500 advanced features (symbolic-only debugging, partial download with consistent changes, and download-in-RUN for that DB). If those features are mandatory, use Solution 2 instead.

Solution 2: SCATTER_BLK and GATHER_BLK Conversion (Optimized DB Compatible)

For projects that must keep the optimized DB attribute (typical for S7-1500 / S7-1200 firmware 4.x and newer), use the SCATTER_BLK and GATHER_BLK instructions to maintain a parallel Word/DWord image of the bool array. The HMI then points to the image, not the source bool array.

Data Flow

The PLC program copies bits from the optimized source array into a non-optimized (or simply non-array-of-bool) Word/DWord that the HMI can poll:

// FB "Alarm_Image" — called cyclically in OB1 or in the alarm-source FB
// Inputs
//   boolSrc : Array[0..31] of Bool   (from optimized DB, e.g. "plcdata".Alarm)
// Outputs
//   dwordImg: DWord                  (HMI trigger image)

// SCATTER: Bool[0..31]  ->  DWord
"GATHER_BLK"(
    IN  := "plcdata".Alarm,           // source: Array[0..31] of Bool
    OUT := #dwordImg                  // dest : DWord
);

For the reverse direction (e.g., HMI writes an acknowledge bit back), use SCATTER_BLK:

// SCATTER: DWord  ->  Bool[0..31]
"SCATTER_BLK"(
    IN  := #dwordAckImg,             // source: DWord from HMI
    OUT := "plcdata".Ack             // dest : Array[0..31] of Bool
);

Step-by-Step Setup

  1. Create a new global DB (e.g., DB_HMI_AlarmImage) and leave it optimized.
  2. Add the members: TriggerImage : DWord; and AckImage : DWord;
  3. Add an FB or FC that calls GATHER_BLK on the bool source array and writes the result into TriggerImage. Call it in OB1 (or in a cyclic interrupt OB30 at 100 ms) to keep the image in sync.
  4. If acknowledges are required, call SCATTER_BLK in the same cycle to push AckImage back to a Array[0..31] of Bool.
  5. Compile the PLC. Use a watch table to confirm the image updates when the source bits toggle.
  6. On the HMI side, add a tag HMI_TriggerImage with data type DWord, link it to "DB_HMI_AlarmImage".TriggerImage.
  7. Open the discrete alarm editor, assign HMI_TriggerImage as the trigger tag, and set the trigger bit to 0..31 for each of the 32 alarms.
Best Practice: Place the gather/scatter call in a fast OB (OB1 or OB30) so the HMI does not see stale data. The image is updated on every PLC scan; the HMI polls at its own cycle (typically 250 ms-1 s), so end-to-end latency is bounded by the HMI poll rate plus the gather OB cycle.

Solution 3: Per-Bit Bool Tags with Single-Bit Trigger

If the alarm count is small (≤ 16 alarms) and the project does not require a clustered trigger tag, an alternative is to expose each alarm bit as a separate Bool tag at the HMI level and assign it directly to one alarm row per tag.

  1. Leave the optimized bool array in the PLC as-is.
  2. In the HMI tag table, add 32 individual Bool tags (e.g., HMI_Alarm_00 through HMI_Alarm_31).
  3. For each tag, set the access mode to Symbolic access and select the individual array element (e.g., "plcdata".Alarm[5]).
  4. Create 32 discrete alarm rows, each using its corresponding HMI_Alarm_NN tag as the trigger.

Trade-off: this multiplies the HMI tag count and the polling load, but it preserves the optimized DB and the original PLC code structure. For 32 bits on a Comfort Panel over EtherNet/IP or PROFINET, the tag count is well within HMI capability (Comfort Panels support up to 4096 tags in the standard model, 32 of which is trivial).

Cross-Version Compatibility Table

TIA Portal Version WinCC Comfort WinCC Unified Array of Bool as Trigger SCATTER / GATHER Supported Notes
V15.1 Yes Limited No Yes Baseline; check firmware ≥ V15.1 for SCATTER.
V16 (Update 7+) Yes Yes (V16 Unified RT) No Yes Source project version in the failing case.
V17 Yes Yes No Yes SCATTER_BLK / GATHER_BLK remain in the standard instruction set.
V18 Yes Yes No Yes No change to data-type restriction.
V19 Yes Yes No Yes Restriction still enforced.
V20 Yes Yes (PC RT and Panels) No Yes Documentation explicitly lists approved types.
V21 Yes Yes No Yes Unchanged from V20.

Verification Procedure

  1. PLC compile: Re-compile the PLC program after any DB change. The output window must show 0 errors for the modified FB/FC and DB.
  2. Download: Download the PLC program to the S7-1500 / S7-1200 in STOP-RUN, or perform a download-in-RUN if supported.
  3. HMI compile: Compile the HMI project. No warning "Tag cannot be used as a trigger tag" should remain.
  4. HMI download: Download the runtime to the Comfort Panel (or start the Unified RT).
  5. Online test: From TIA Portal, use Online & diagnostics → Force on a single bit (e.g., plcdata.Alarm[5] or plcdata.AlarmWord[0].%X5). Verify the corresponding alarm row appears in the HMI message view within one HMI poll cycle.
  6. Acknowledge test: Press the Acknowledge button on the HMI (or use the touch area wired to the ack tag). Verify the bit in the ack image toggles and the alarm clears from the active list.
  7. Cold restart: Power-cycle the PLC and HMI. Reload the project. Confirm the alarm image initializes to zero and no false alarms appear at startup (if needed, pre-initialize the image DB with explicit 0 in its startup values).

Troubleshooting Matrix

Symptom Likely Cause Resolution
Trigger tag dropdown is empty / greyed out HMI tag data type is Array of Bool or other non-approved type Convert to Word / DWord / Array of Word at HMI level (mirror via SCATTER/GATHER) or at PLC level (Solution 1).
Compiler warning: Tag <name> cannot be used as a trigger tag Same as above Same as above
Alarm appears but never clears, even after acknowledge Ack tag missing or wrong data type; ack image not propagated to source Add an AckImage : DWord and call SCATTER_BLK back to the bool array.
Alarm flickers on/off rapidly Gather OB not called every scan, or HMI poll faster than PLC update Move GATHER_BLK call to OB1; confirm the OB is online. Increase HMI poll to 500 ms if jitter persists.
Compile error: SCATTER_BLK / GATHER_BLK not found Instruction not in the current instruction set (older CPU firmware) Update S7-1200/S7-1500 firmware to ≥ V4.2 (S7-1500) or ≥ V4.4 (S7-1200) per Siemens instruction library notes.
Alarm does not appear at all Trigger bit set outside the supported range, e.g., bit 16 in a Word Match bit index to the word/dword size. Use multiple tags for >16/32 alarms.
Wrong alarm text shown for a forced bit Trigger bit index misaligned with text row Re-check the discrete alarm editor mapping. Bit 0 in the trigger tag corresponds to row 0 in the editor.

Performance and Sizing Considerations

For a single DWord alarm cluster (32 alarms), the runtime cost is negligible: one GATHER_BLK call per PLC cycle reads 32 bools and packs them into a 32-bit word. At a typical 10 ms OB1 cycle, this is sub-microsecond on an S7-1500 CPU 1515 or higher.

For larger alarm counts (256, 1024, 4096), the gather approach scales linearly. The HMI poll load is the more relevant bottleneck: a Comfort Panel polling 128 DWords at 250 ms generates ~512 bit reads/s, which is well within the panel's capacity. Unified RT on a PC scales into the tens of thousands of tags without issue.

Memory layout for the image DB:

  • 1 DWord = 4 bytes → 32 alarm bits.
  • 16 DWords = 64 bytes → 512 alarm bits.
  • 128 DWords = 512 bytes → 4096 alarm bits.

For projects exceeding 4096 bits, split the alarm image into multiple DWords and configure each block in its own discrete alarm group. WinCC allows up to 32 trigger tags per alarm line set, and the editor handles multi-cluster alarms transparently when the trigger is an Array of Word / DWord.

Frequently Asked Questions

Why does TIA Portal reject an Array of Bool as an HMI trigger tag?

The WinCC alarm runtime requires a fixed-width, bit-addressable integer (Bool, Byte, Word, DWord, LWord, or Array of those) so it can compute a single absolute bit offset in one fetch. An Array of Bool breaks that model and is explicitly disallowed; valid types are listed in the WinCC Unified V20 trigger configuration documentation.

Can I keep the optimized DB attribute and still feed alarms to the HMI?

Yes. Create a parallel alarm-image DB and use GATHER_BLK in OB1 (or a cyclic OB) to pack the optimized bool array into a DWord. The HMI then reads the DWord, not the source array. Use SCATTER_BLK to convert a DWord ack image back into the bool array if the HMI writes acknowledges.

What is the difference between SCATTER_BLK and a plain type cast?

A type cast operates on a single element; SCATTER_BLK / GATHER_BLK operate on the entire array in one call, producing a packed DWord where bit n corresponds to array index n. Both are standard TIA Portal instructions available in the Basic Instructions library on S7-1200 (firmware V4.4+) and S7-1500 (firmware V2.0+).

How many alarms can one trigger tag support?

1 for Bool, 8 for Byte, 16 for Word, 32 for DWord, 64 for LWord. For larger counts, use an Array of Word / DWord at the HMI tag level and create multiple discrete alarm rows that share the array tag with different bit offsets.

Does this restriction apply to WinCC Unified V20 as well as Comfort V16?

Yes. The same data-type whitelist (Bool, Byte, Word, DWord, LWord, Array of those) applies to WinCC Unified discrete alarms; the restriction is part of the alarm subsystem architecture, not the panel generation. The TIA Portal V16 → V21 releases do not relax it.

Back to blog