S7-1500 HMI Acknowledge Program_Alarm Using Ack_Alarms in TIA

David Krause14 min read
SiemensTIA PortalTutorial / 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

Overview

When an S7-1500 CPU raises a Program_Alarm via the extended instruction family, the standard alarm screen on a WinCC Comfort/Advanced TP700 HMI displays an "Acknowledge" button. The operator pressing that button generates an acknowledgment event on the HMI, but the underlying PLC logic frequently needs to react to the same event - typically to clear a latched fault bit, de-energize an audible horn, gate a process interlock, or record the operator's identity in an audit log.

The bridge between the HMI acknowledgment action and the PLC program is the Ack_Alarms extended instruction, introduced with STEP 7 and TIA Portal V14 SP1. Before that service pack, controller-side alarms created with Program_Alarm could not be acknowledged from the PLC. The HMI's tag-based acknowledgment mechanisms only worked for HMI-side alarms (analog/digital alarms configured inside WinCC). The block remains the supported path on current firmware (validated through TIA Portal V20).

This reference covers:

  • The instruction set required (Program_Alarm, Get_Alarm, GetAlarmState, Ack_Alarms)
  • Enabling central alarm management on the S7-1500 CPU
  • Mapping the TP700 standard alarm screen acknowledge event to a PLC tag
  • Wiring that tag into Ack_Alarms
  • Reading the acknowledgment state back via GetAlarmState and Program_Alarm.ACK_STATE
  • Known limitations (no per-class, per-group, or single-alarm acknowledgment) and the workarounds that engineers actually deploy

Prerequisites

Item Minimum version Notes
TIA Portal V14 SP1 Ack_Alarms introduced in this service pack
STEP 7 (PLC programming) V14 SP1 Required for the Ack_Alarms extended instruction
WinCC Comfort/Advanced V14 SP1 Standard alarm screen template
S7-1500 CPU firmware V2.0+ V1.x CPUs do not expose Ack_Alarms
HMI firmware Matching TIA version TP700 Comfort recommended

You should already be comfortable with S7-1500 hardware configuration, alarm text list creation in TIA Portal, HMI tag configuration with PLC connections, and a working Program_Alarm instance that is being displayed on the TP700.

The Alarm Architecture on S7-1500

Two alarm sources are frequently conflated in S7-1500 projects:

  1. HMI-side alarms - configured inside WinCC on the HMI (analog/digital alarms in the HMI tag table). These can be acknowledged directly from the HMI by writing to a defined acknowledgment tag.
  2. Controller-side alarms - generated by the PLC using Program_Alarm and the related extended instructions. The HMI displays them, but acknowledgment traditionally required operator action that the PLC could not directly observe.

The reason is historical: with TIA Portal ≤ V14, controller-side alarms were buffered by the CPU and the HMI was a passive consumer. There was no PLC-accessible function to clear the alarm's pending state until TIA V14 SP1's Ack_Alarms instruction became available.

Central Alarm Management in the CPU

Before any of the alarm instructions work as expected, central alarm management must be enabled on the S7-1500 CPU. From the official TIA Portal V20 documentation:

When central alarm management is enabled, the CPU transfers the entire alarm text, which can consist of multiple text list entries, to the HMI device.

Central alarm management has a critical side effect for Program_Alarm: the CPU, not the HMI, owns the alarm object. The HMI only displays it. This is precisely why the HMI's per-tag acknowledgment mechanism does not work for Program_Alarm instances - the HMI does not own the alarm record.

Enabling central alarm management

  1. Open the S7-1500 CPU in the device configuration (HWCN).
  2. Navigate to Properties → Alarm settings (in older builds: Properties → General → Alarm management).
  3. Check "Central alarm management in the PLC".
  4. Recompile the hardware configuration and download to the CPU.
Central alarm management is enabled by default for new projects. Existing projects upgraded from V13/V14 may have it disabled and must be turned on manually before Ack_Alarms can acknowledge Program_Alarm instances.

Program_Alarm and GetAlarmState in Brief

Program_Alarm

Per the TIA Portal V20 extended instructions reference:

The instruction "Generate program alarm with associated values" monitors a signal and on a signal change at the parameter SIG generates a program alarm.

The instruction's relevant I/O for acknowledgment purposes:

Parameter Direction Type Meaning
SIG IN BOOL Signal state monitored for rising/falling edge alarm
ACK_STATE OUT BOOL TRUE while the alarm is acknowledged (operator has pressed ACK)
TIMESTAMP IN/OUT DTL Time of the last signal change
Associated values (up to 10) IN various Inserted into the alarm text at runtime
DONE / BUSY / ERROR / STATUS OUT various Standard instance-DB result codes

The output ACK_STATE is the central parameter for the user scenario: it goes TRUE only after the operator has acknowledged the alarm on the HMI. However, on its own, Program_Alarm does not allow the PLC to trigger acknowledgment - it can only observe the result. The PLC-triggered acknowledgment is the role of Ack_Alarms.

GetAlarmState

GetAlarmState reads whether a specific alarm - referenced by its ALARM_ID returned from a Program_Alarm instance DB - is currently in a "not yet acknowledged" or "acknowledged" state. It is the read counterpart to Program_Alarm's ACK_STATE output and is useful for complex logic where you need to poll rather than react to the ACK_STATE rising edge.

Ack_Alarms Instruction

Ack_Alarms is the extended instruction introduced in TIA V14 SP1 to acknowledge controller-side alarms from the PLC program. The block operates on alarm IDs of alarms that have been previously raised - typically by Program_Alarm.

Block I/O

Parameter Direction Type Description
REQ IN BOOL Rising edge triggers acknowledgment of all pending controller-side alarms
RET_VAL OUT INT Return value; 0 = OK, see error codes below
BUSY OUT BOOL TRUE while acknowledgment is in progress
DONE OUT BOOL TRUE for one cycle after acknowledgment has been processed
ERROR OUT BOOL TRUE if RET_VAL indicates an error
STATUS OUT WORD Extended status information

Return value (RET_VAL) codes

RET_VAL Meaning
0000 No error; acknowledgment completed
8001 Internal buffer full - retry on next call
8080 Central alarm management not enabled in the CPU
8090 Instruction cannot be executed in current CPU operating mode
80A0 - 80A4 Internal CPU resource error; check the diagnostics buffer

Any non-zero RET_VAL should be captured and logged via WRMSG / a dedicated Program_Alarm so that operators can see why an acknowledgment button press had no effect.

Critical limitation

Ack_Alarms acknowledges all pending controller-side alarms on the CPU at the moment REQ receives a rising edge. There is no parameter to filter by alarm class (for example, only acknowledge "Error" class but not "Warning"), by alarm group ID, or by a single alarm ID. This is the limitation that field engineers consistently flag: a single FB that wraps Program_Alarm cannot selectively acknowledge "its own" alarm instance.

HMI Configuration: Mapping the Standard Alarm Screen Button

The TP700 Comfort ships with a standard alarm screen template ("alarm screen" / AlarmControl) that contains the acknowledge button. Wiring the button's click to a PLC variable is the missing link in most projects.

Step 1 - Create the HMI tag

  1. In the TIA Portal project tree, expand the TP700 HMI → HMI tags.
  2. Create a new HMI tag named HMI_AckAlarmTrigger of type Bool.
  3. Set its connection to the S7-1500 PLC and tie it to a PLC tag (for example AckAllAlarms_PLC.%M0 or a DB tag such as "AlarmDB".Ack_Req).

Step 2 - Link the button to the tag

The TP700 standard alarm screen uses the configured acknowledgment function internally. In TIA Portal's HMI alarm configuration:

  1. Open HMI alarms → Settings → Acknowledgment.
  2. Under "Acknowledge PLC tag", assign the new HMI tag (HMI_AckAlarmTrigger).
  3. In the alarm screen's properties (on the screen editor), confirm that "Use configured acknowledgment tag" is enabled.

When the operator presses the on-screen ACK button, WinCC sets the configured tag to TRUE for one cycle - which is exactly the rising-edge trigger that Ack_Alarms.REQ needs.

Step 3 - Disable HMI-internal acknowledgment (recommended for controller-side alarms)

If you want the HMI to display the alarm as acknowledged only when the PLC has processed the request, leave the HMI-internal acknowledgment disabled and rely on the PLC-side ACK_STATE flowing back through the Program_Alarm output. This prevents a race where the HMI clears the alarm visually before the PLC has actually cleared its own logic.

Step-by-Step Wiring Procedure

1. CPU hardware setup

TIA Portal project
└─ Devices & Networks
   └─ PLC_1 (S7-1500 CPU 1515-2 PN)
       └─ Properties → Alarm settings
           └─ [✔] Central alarm management in the PLC

Compile and download the hardware configuration before continuing.

2. Create the alarm block wrapper (FB)

For a clean project structure, wrap Program_Alarm and the local alarm logic in a Function Block with a single instance DB:

FUNCTION_BLOCK "FB_AlarmWrapper"
VAR
    iAlarmID : DWORD;                  // populated after first Program_Alarm call
    stProgramAlarm : "Program_Alarm";  // multi-instance
    bSig         : BOOL;               // local signal
    bAckState    : BOOL;               // observes PLC-side ACK
END_VAR

BEGIN
    "FB_AlarmWrapper_DB".iAlarmID := "Program_Alarm_DB".ID;   // capture ID once
    "Program_Alarm_DB"(
        SIG       := bSig,
        ACK_STATE => bAckState);
END_FUNCTION_BLOCK

In TIA Portal V20 the Program_Alarm block exposes instance-DB fields ID, TIMESTAMP, and ACK_STATE. ID is allocated by the system on first call and is the value you would pass into GetAlarmState for a single-instance poll.

3. Instantiate the Ack_Alarms block

In OB1 (or a dedicated alarm OB), instantiate Ack_Alarms and wire it to the HMI acknowledgment tag:

// Cyclic OB (OB1)
"Ack_Alarms_Instance"(
    REQ     := "AlarmDB".HMI_AckReq,       // BOOL, rising edge from HMI
    RET_VAL => "AlarmDB".Ack_RetVal,      // INT
    BUSY    => "AlarmDB".Ack_Busy,        // BOOL
    DONE    => "AlarmDB".Ack_Done,        // BOOL
    ERROR   => "AlarmDB".Ack_Error,       // BOOL
    STATUS  => "AlarmDB".Ack_Status);     // WORD

4. Verify in the PLC online view

  1. Download all blocks to the CPU.
  2. Force bSig := TRUE on one Program_Alarm instance via the watch table.
  3. The alarm appears on the TP700.
  4. Press the on-screen ACK button.
  5. Observe HMI_AckReq → TRUE for one cycle, then Ack_Done → TRUE, and bAckState on the Program_Alarm instance → TRUE.

Verification Checklist

Step Expected result Where to verify
Program_Alarm fires when SIG=TRUE Alarm row appears on TP700 alarm screen TP700 runtime
HMI ACK button writes the tag HMI_AckReq pulses TRUE for one PLC cycle Watch table on AlarmDB
Ack_Alarms.REQ rising edge Ack_Done=TRUE within 1-2 OB1 cycles Watch table
Program_Alarm.ACK_STATE after ACK TRUE and stays TRUE until SIG goes FALSE Watch table on instance DB
Operator acknowledgment counter increments AlarmDB.AckCount increments Watch table
RET_VAL after each ACK 0 (no error) Watch table
Error path: ack with central mgmt off RET_VAL = 8080 Disable option in HWCN, force ack

Limitations and Workarounds

No per-alarm acknowledgment

Ack_Alarms does not accept an alarm ID. To acknowledge "just one alarm", the developer must:

  1. Use Get_Alarm (mode 6 or 7, depending on TIA version) to enumerate pending alarms into a buffer.
  2. Filter the buffer by associated values or by alarm ID prefix.
  3. Acknowledge only when a controlled condition is met - for example, hold the HMI trigger tag in TRUE only when the buffer contains the targeted alarm.

No per-class acknowledgment

The same enumeration approach via Get_Alarm is required if class-specific clearing is needed.

CPU firmware dependency

S7-1500 CPUs with firmware V1.x do not expose Ack_Alarms. The CPU must be V2.0 or later. Older CPUs in a mixed rack must be upgraded or excluded from the acknowledgment flow.

Get_Alarm versus GetAlarmState

These are distinct blocks:

  • Get_Alarm reads out alarm buffer contents into user data. It is often used with AttachAlarm / DetachAlarm for advanced diagnostic scenarios.
  • GetAlarmState reads the current state of a specific alarm instance by alarm ID - lighter weight for the "what is this one alarm doing" question.

Choose GetAlarmState for simple acknowledge/observe logic; choose Get_Alarm only when you must enumerate many alarms programmatically.

Troubleshooting Matrix

Symptom Likely cause Fix
TP700 ACK button has no effect on HMI_AckReq Alarm screen not using the configured ack tag Reassign PLC tag in HMI alarms → Settings → Acknowledgment
Ack_Alarms.RET_VAL = 8080 Central alarm management disabled Enable in CPU properties → Alarm settings
Ack_Alarms.RET_VAL = 8090 CPU in STOP / wrong operating mode Check CPU run state; check OB1 scan
Program_Alarm.ACK_STATE stays FALSE after ack HMI not in same project / wrong tag pointer Verify connection + tag in HMI tag table
Ack button works but logic never executes REQ edge missed because of long OB1 cycle Add edge detection (positive-edge flag) in front of REQ
Only some alarms are acknowledged Ack_Alarms acks everything; partial clear expected This is normal; use GetAlarmState to filter visibility, not state
HMI alarm screen shows "Alarm active" even after PLC ACK HMI-internal acknowledgment still enabled Disable HMI-internal ack in alarm screen properties
Project upgraded from V13/V14 to V15+ - ack still fails Central alarm management not re-enabled after upgrade Re-enable in HWCN and re-download
Alarms generated but never reach HMI Alarm text list not assigned to the alarm instruction Open the instance DB of Program_Alarm, check the "Alarm text" property
RET_VAL = 80A1 after PLC restart CPU resource temporarily unavailable during ramp-up Retry Ack_Alarms on the next OB1 cycle

Field-Proven Patterns

Pattern A - Edge-detected REQ for slow scan times

On large S7-1500 programs where OB1 cycle time approaches or exceeds the HMI tag pulse width, the HMI's one-cycle TRUE can be missed. Insert a positive-edge flag:

// Edge detection
IF "AlarmDB".HMI_AckReq AND NOT "AlarmDB".HMI_AckReq_Old THEN
    "AlarmDB".Ack_Edge := TRUE;          // latched for one OB1 cycle
END_IF;
"AlarmDB".HMI_AckReq_Old := "AlarmDB".HMI_AckReq;

"Ack_Alarms_Instance"(
    REQ     := "AlarmDB".Ack_Edge,
    RET_VAL => "AlarmDB".Ack_RetVal,
    BUSY    => "AlarmDB".Ack_Busy,
    DONE    => "AlarmDB".Ack_Done);
"AlarmDB".Ack_Edge := FALSE;

Pattern B - Per-FB "acknowledge mine" guard

To mimic single-alarm acknowledgment, latch the request only when GetAlarmState reports that the targeted alarm is the only one pending:

"GetAlarmState_Instance"(
    ALARM_ID := "FB_AlarmWrapper_DB".iAlarmID,
    STATE    => "FB_AlarmWrapper_DB".bLocalState);

IF "FB_AlarmWrapper_DB".bLocalState = 0
   AND "AlarmDB".PendingCount = 1 THEN
    "FB_AlarmWrapper_DB".bAllowAck := TRUE;
END_IF;

The PLC still calls Ack_Alarms globally, but the gate bAllowAck ensures the HMI button is only honored when the operator is unambiguously targeting this one FB's alarm.

Pattern C - Latched fault reset on ACK

Many user FBs need to clear a latched fault bit on acknowledgment. Use the rising edge of Program_Alarm.ACK_STATE:

// Detect operator ack
IF "FB_AlarmWrapper_DB".bAckState AND
   NOT "FB_AlarmWrapper_DB".bAckStateOld THEN
    "FB_AlarmWrapper_DB".bFaultLatched := FALSE;   // reset fault
END_IF;
"FB_AlarmWrapper_DB".bAckStateOld := "FB_AlarmWrapper_DB".bAckState;

Commissioning Procedure

  1. Compile clean: TIA Portal → right-click PLC → Compile all. Resolve any "Central alarm management missing" warnings before download.
  2. Download HWCN first: Always download the hardware configuration (with central alarm management enabled) before downloading software. Mixing the two can leave the CPU in a state where the option flag is set but the resource table is not.
  3. Download blocks: Download all new/modified FBs and DBs. Stop the CPU if required by your project change-check setting.
  4. Restart CPU: After enabling central alarm management on a CPU where it was previously off, perform a full restart (MRES) so the resource tables initialize.
  5. Test from the HMI: Force one SIG, observe the alarm row on the TP700, press ACK, observe the ACK_STATE flag transition in the watch table.
  6. Test the error path: Disable central alarm management (or temporarily remove the configured ack tag on the HMI), trigger an alarm, press ACK, confirm RET_VAL = 8080 and that operators see a meaningful diagnostic message.
  7. Document the wiring: In the project's HMI tag table, add comments to the HMI_AckAlarmTrigger tag pointing to the Ack_Alarms instance and to the central alarm management flag. Future engineers will thank you.

References to Official Siemens Documentation

For deeper firmware-version-specific behavior, see:

Which TIA Portal version introduced Ack_Alarms for the S7-1500?

Ack_Alarms was introduced in TIA Portal V14 SP1. Earlier versions cannot acknowledge controller-side Program_Alarm instances from the PLC - the HMI had to handle all acknowledgment internally.

Can Ack_Alarms acknowledge a single specific alarm by ID?

No. Ack_Alarms acknowledges every pending controller-side alarm on the CPU when its REQ input receives a rising edge. There is no alarm ID, class, or group filter. For per-alarm acknowledgment, use Get_Alarm or GetAlarmState to gate the HMI trigger before calling Ack_Alarms.

Why does RET_VAL return 8080 even though my alarm is on screen?

RET_VAL = 8080 means central alarm management is not enabled on the S7-1500 CPU. Open the CPU device configuration, navigate to Properties → Alarm settings, enable "Central alarm management in the PLC", recompile, and re-download the hardware configuration. A full CPU restart (MRES) is recommended when enabling this option on a previously running project.

How do I read whether a specific Program_Alarm has been acknowledged?

Use the ACK_STATE output of the Program_Alarm instance DB (BOOL, TRUE once acknowledged). For polled logic that needs to query by alarm ID, use the GetAlarmState extended instruction and supply the ID that the Program_Alarm instance DB exposes.

Do I need to disable HMI-internal acknowledgment on the TP700 alarm screen?

For controller-side Program_Alarm instances, it is strongly recommended to disable HMI-internal acknowledgment and rely solely on the PLC-side Ack_Alarms path. Otherwise the HMI can visually clear the alarm before the PLC has finished processing the acknowledgment, creating a race that confuses operators and corrupts audit logs.

Back to blog