Implementing Chronological Messaging with S7-400 and WinCC

David Krause10 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

1. Overview

Chronological messaging (German: "Chronologische Meldeanzeige") is a Siemens HMI concept in which alarms are time-stamped at the PLC (S7-300/S7-400) and read by the HMI for display. Because the time stamp originates in the CPU rather than in the panel, the displayed sequence remains consistent even when the HMI is restarted, the project is reloaded, or the panel has been disconnected from the network.

For a CPU 412-2 PN paired with a TP1200 Comfort, chronological messaging requires:

  • STEP 7 V18 or higher in the Professional edition (or STEP 7 Professional in TIA Portal V13 SP1 and newer). STEP 7 Basic cannot configure S7-300/S7-400 devices and cannot be used for this application.
  • WinCC Comfort/Advanced/Professional in the same TIA Portal installation.
  • CPU 412-2 PN firmware V6.0 or higher (recommended V6.0.7 or newer to cover all SFC17/18 corrections).
  • TP1200 Comfort with WinCC Comfort V18 (or matching the TIA Portal version).

The reference implementation published by Siemens (entry ID 23730697) describes the configuration on the S7-400 and WinCC side. This article extends that document with the connection-setup steps that the source FAQ explicitly excludes, plus the SFC17/SFC18 call mechanics and the TP1200 message-view wiring.

License requirement: S7-400 devices do not appear in the TIA Portal device catalog under STEP 7 Basic. If your project tree only offers S7-1200 CPUs, your installation is running the Basic edition. Upgrade to STEP 7 Professional + WinCC Comfort to unlock the S7-400 family.

2. Prerequisites

Component Requirement Notes
Engineering framework TIA Portal V18 (or V17/V16 SP1) STEP 7 Professional + WinCC Comfort bundled
CPU CPU 412-2 PN (6ES7412-2EK07-0AB0) or compatible Firmware V6.0.7+ recommended
HMI TP1200 Comfort (6AV2124-1MC01-0AX0) WinCC Comfort V18 image
Ethernet PN/IE subnet, 10/100 Mbit Same subnet, no router between CPU and panel
System blocks SFC17 "ALARM_SQ" / SFC18 "ALARM_S" / SFC19 "ALARM_SC" / SFC20 "ALARM_SQ" cancel From standard library, distributed with the CPU firmware
Project license STEP 7 Professional license key Local or floating

3. How Chronological Messaging Works on S7-400

Unlike a discrete alarm that is acknowledged in the HMI, a chronological message is generated and time-stamped in the CPU, transferred once to the HMI, and stored in the HMI's chronological message buffer. The HMI never re-sends the message; it only displays what the CPU has announced.

S7-400 CPU SFC17/18 call PN/IE ACK / status TP1200 Comfort Message view time stamp in CPU chronological buffer 1. Program calls SFC18 with an EV_ID, an associated value (e.g., a tag with current torque or pressure) and a text reference. 2. The CPU adds the time stamp and pushes the message to all HMI partners configured for the same EV_ID. 3. The HMI stores the message in its chronological ring buffer and renders it in the alarm view. 4. ACK/STATUS handshake is performed via SFC19 / SFC20 against the same EV_ID.

3.1 SFC17 vs. SFC18 selection

Block Name Use case Requires partner
SFC17 ALARM_SQ Status message that must be acknowledged at the HMI Yes (WinCC alarm control)
SFC18 ALARM_S Status message, no acknowledgement Yes (WinCC alarm control)
SFC19 ALARM_SC Cancel an active SFC17/SFC18 message Yes
SFC107 ALARM_DQ Diagnostic interrupt, user-relevant Yes (HMI Pro only)

For TP1200 Comfort and the standard chronological message list, use SFC18 for non-acknowledgeable events (e.g., threshold transitions, set-point reached) and SFC17 for events that the operator must acknowledge (e.g., fault, E-Stop). The time stamp resolution is 10 ms on S7-400 CPUs; the panel displays it in the configured date/time format.

4. Project and Connection Setup

  1. Open TIA Portal and create a new project. Do not use a project migrated from STEP 7 V5 - the S7-400 must be added as a device in the TIA Portal project tree.
  2. Add the CPU 412-2 PN from the hardware catalog. TIA Portal places the PROFINET interface (X1) automatically.
  3. Add the TP1200 Comfort to the same project and connect its PROFINET port to the CPU's PROFINET subnet. TIA Portal will create an HMI connection with the type S7-300/400.
  4. Open Devices & Networks > Connections. Confirm that the connection type is S7-300/400 and the partner end is the CPU 412-2 PN. If TIA Portal proposes S7-1200, the HMI project was created with a different CPU family and must be re-linked.

The official Siemens "Communication with SIMATIC S7 300/400" chapter in the TIA Portal Help (V20 edition) covers the same connection model for Basic Panels, Panels, Comfort Panels, RT Advanced and RT Professional:

Communication with SIMATIC S7 300/400 - TIA Portal Help (V20)

4.1 Connection diagnostics

On the HMI side, open Connections > [connection name] > Properties and verify:

  • Address: the HMI's IP address
  • Partner address: the CPU's IP address
  • Connection resource ID: 0 (default) for the first S7-300/400 partner
  • Slot / Rack: 0 / 0 (rack 0, slot 2 = CPU)

5. PLC Program: Calling SFC18 (Example)

Create a function block (FB) in the S7-400 program and call SFC18 once for every event you want to log. Use an associated value to attach process state (e.g., the actual torque in Nm) to the message.

ST example (SCL)

// FB "Chrono_Alarms" - call site in OB1
"Inst_Chrono"(Trigger := bAlarmActive,
            EV_ID   := 1,
            SIG     := 1,
            SD      := REAL#42.5,         // associated value (Nm)
            RET_VAL := iSfc18Ret);

IF iSfc18Ret <> 0 THEN
    // SFC18 error - store in diagnostics DB
    "dbDiag".lastSfc18Error := iSfc18Ret;
END_IF;

LAD example - place SFC18 in a network with the following parameter mapping:

Input Type Value / Tag Meaning
SIG BOOL Tag: bAlarmActive 1 = trigger message
ID WORD W#16#1 Event ID (EV_ID), must be unique per project
EV_ID DWORD DW#16#00000001 Must match the HMI configuration
SD REAL Tag: rTorque Associated value (max 4 bytes)
RET_VAL INT Tag: iSfc18Ret 0 = OK, see diagnostics manual for others

5.1 Common SFC18 RET_VAL codes

RET_VAL (W#16#) Meaning Remedy
0000 No error -
8001 No partner configured for this EV_ID Add HMI connection in TIA Portal
8002 Partner not connected / not logged on Check HMI connection status, PROFINET cable
8003 Send buffer full (CPU overload) Reduce call rate, extend OB1 cycle
8084 Wrong EV_ID format (bit 31 set) EV_ID must be < 0x80000000

6. HMI Configuration in TIA Portal (TP1200 Comfort)

  1. Open the TP1200 device in the project tree.
  2. Navigate to Alarm logs > Chronological. This buffer stores all messages received via the S7-300/400 connection. Set the size (default 500 messages is sufficient for most lines).
  3. Open HMI tags > Show all tags and create a tag of the same name and data type that the PLC uses for the SFC18 associated value (e.g., rTorque, REAL, length 4). Map it to the PLC tag over the S7-300/400 connection.
  4. Open the screen that should display the messages. Drag the Alarm control (or Alarm view) onto the screen and configure:
    • Source: Chronological log
    • Columns: date/time, message text, state, associated value
    • Layout: classic ("WinCC Classic") for S7-300/400 connections

7. Message Text and Associated-Value Configuration

The TIA Portal WinCC editor does not define free text for chronological messages. The text is generated by the CPU when it calls SFC17/18, because the message text plus the format specification are part of the S7-400 project (STEP 7 V5 or TIA Portal). Specifically:

  1. On the S7-400 device, open PLC alarms > Text lists.
  2. Create one text list entry per EV_ID. Example for EV_ID 1:
    • Range start: 1
    • Range end: 1
    • Text: Motor torque reached
  3. On the message view side, the alarm control will display the text from the PLC without any further mapping.
EV_ID uniqueness: EV_IDs must be unique across the entire S7-400 project. If two SFC18 calls share the same EV_ID, the second one will overwrite the first and the HMI will not display two distinct events. Use a contiguous range (e.g., 1-200) and document it in the project header.

8. Commissioning Procedure

  1. Compile the S7-400 project and download the hardware configuration to the CPU.
  2. Download the user program (OB1, FB, DB, SFC18 calls) to the CPU.
  3. Compile the TP1200 project and download it to the panel. Use Extended download to transfer the runtime image.
  4. Set the IP addresses of CPU and panel on the same subnet. The CPU's IP must match the connection partner in TIA Portal.
  5. Trigger one of the SFC18 events from the program (set a tag, force the input in the watch table).
  6. Verify the message appears in the TP1200 alarm view with the correct time stamp.
  7. Cycle power on the HMI. After restart, the chronological message buffer must still contain the previously received events.

9. Verification and Diagnostics

Use the following checks after commissioning to confirm the chronological pipeline is healthy.

9.1 Connection status on the HMI

Open the TP1200 system screen System > Connections. The S7-300/400 partner must show status Connected. If it shows Disconnected, check:

  • PROFINET cabling and link LEDs
  • IP address and subnet mask of both ends
  • PG/PC and HMI are on the same subnet (no router between them)
  • The connection resource ID on the HMI side has not been duplicated

9.2 PLC-side SFC status

Monitor the SFC18 RET_VAL in a watch table. A constant value of W#16#0000 confirms the CPU has handed the message to the PN stack. A constant W#16#8001 indicates the partner registration is missing; re-check the connection under Devices & Networks on the TIA Portal side.

9.3 Buffer verification

On the TP1200, the chronological message list is a ring buffer. When the configured size is reached, the oldest entry is overwritten. Increase the buffer size in Alarm logs > Chronological > Size if older events must be retained (max 9999 entries on Comfort V18).

10. Troubleshooting Matrix

Symptom Likely cause Diagnostic Remedy
No S7-400 in device catalog STEP 7 Basic installed Help > About TIA Portal > Installed products Upgrade to STEP 7 Professional
SFC18 RET_VAL = 8001 No HMI partner for this EV_ID Watch RET_VAL after forcing SIG=1 Re-create the S7-300/400 connection
Connection shows "Disconnected" on HMI PROFINET / IP mismatch Ping CPU from PG Correct IP/subnet, replace cable
Alarm view empty on TP1200 Wrong log assigned to view Alarm control > Properties > Source Switch to "Chronological log"
Time stamp off by hours CPU clock not synchronized Online > Diagnostics > Time Set time on CPU or enable NTP
Messages lost after HMI restart Chronological buffer not configured Alarm logs > Chronological > Size Set size > 0
SFC18 RET_VAL = 8084 Bit 31 set in EV_ID Watch EV_ID in STL Use DWORD < 0x80000000
Duplicate messages with same text EV_ID reused Cross-reference all SFC18 calls Assign unique EV_IDs

11. Comparison: Chronological vs. Non-Chronological

Aspect Chronological (SFC17/18) Non-chronological (bit-triggered)
Time stamp origin PLC HMI
Survives HMI restart Yes (in panel buffer) No
Configuration effort PLC program + text list + HMI view HMI tag + alarm configuration only
Program blocks required SFC17/18/19 None
License STEP 7 Professional + WinCC Comfort WinCC Comfort suffices
Best use case Audit trail, root-cause analysis Operator information

12. Reference Documents

The following Siemens documents were used to validate the procedure:

Do I need STEP 7 Professional to configure chronological messaging with an S7-400 and a WinCC Comfort panel?

Yes. The S7-400 family is not visible in the TIA Portal device catalog under STEP 7 Basic. You must install STEP 7 Professional (V16 SP1 or newer) plus WinCC Comfort/Advanced/Professional in the same TIA Portal framework.

Can SFC17 and SFC18 be used on a CPU 412-2 PN for chronological messages?

Yes. SFC18 (ALARM_S) sends a non-acknowledgeable status message, SFC17 (ALARM_SQ) sends an acknowledgeable message. Both are part of the standard library shipped with the CPU firmware from V6.0 onwards. The time stamp resolution is 10 ms.

Why does my TP1200 Comfort alarm view stay empty after the SFC18 call?

In 90% of cases the alarm control is bound to the wrong log. Open the alarm control properties, set Source > Chronological log, and confirm a non-zero size is configured under Alarm logs > Chronological. Also verify the SFC18 RET_VAL in the watch table is 0 and the HMI connection is established.

Are chronological messages preserved across an HMI restart?

Yes, as long as the chronological buffer is configured (size > 0) and the events were received before the restart. The CPU sends the message once, the panel stores it in its ring buffer, and the buffer survives a power cycle of the panel.

What is the maximum number of chronological messages I can configure?

WinCC Comfort V18 supports up to 9999 entries per chronological log. The S7-400 CPU side is limited by the number of available communication resources (configured under Properties > Communication) and by the number of SFC18 instances in the program. In practice, a few hundred EV_IDs are comfortable on a CPU 412-2 PN.

Back to blog