Displaying S7-300 ALARM_DQ Messages in WinCC V7 with AS-OS

David Krause11 min read
SiemensTutorial / How-toWinCC
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

Siemens S7-300 PLCs generate diagnostic and process messages through blocks such as ALARM_DQ, ALARM, ALARM_S, and the system diagnostic interrupts reported via OB 82 / OB 83 / OB 85 / OB 100 / OB 102. When a WinCC V7 OS (operator station) project is bound to the STEP 7 V5.x project through the AS-OS integration component, STEP 7 automatically transfers the message text, class, trigger tag, and acknowledgment logic into the WinCC alarm logging database. If the OS compile wizard does not appear when you compile the OS in STEP 7, the AS-OS integration component is almost always missing on the engineering station.

This tutorial walks through the exact sequence required to make ALARM_DQ messages from an S7-300 CPU visible in the WinCC V7 Alarm Logging runtime, including the prerequisite install step that is most often overlooked, the NetPro connection that the wizard depends on, and the time-stamp drift fix documented in Siemens Knowledge Base entry 7604251.

Prerequisites

Item Required Version / Catalog Number Notes
STEP 7 V5.x V5.5 SP4 or later (HF recommended) Used to author the S7-300 program and the OS assignment. Reference: Siemens Industry Online Support.
WinCC V7 V7.4 SP1 or V7.5 SP3 (with matching Update) Explorer-based configuration. For TIA-based Runtime Professional message configuration, see the separate TIA Portal alarm table documentation.
AS-OS Engineering component Bundled with STEP 7 / WinCC DVD; selectable in WinCC Setup Install via WinCC Setup → User-defined installation; see Step 1 below.
S7-300 CPU CPU 31x (313C, 314, 315-2 DP, 317, 319) with firmware ≥ V2.x ALARM_DQ with acknowledgment requires CPU 31x with firmware ≥ V2.6 for full ALARM_DQ acknowledgement semantics.
PC adapter or CP card PC Adapter USB (6ES7972-0CB20-0XA0) or CP 5611 / CP 1623 Used for online commissioning and message event capture.
License keys WinCC RT 2,048 PowerTags (or larger) and AS-OS option Required only at runtime, not for engineering compile.
The AS-OS integration component is a separate engineering component shipped with the WinCC DVD. A typical installation can finish in 5–10 minutes; the missing-piece symptom is that the OS compile wizard never launches and no message texts propagate to WinCC.

Understanding S7-300 Message Architecture

S7-300 diagnostics use two message categories. Bit-messages (ALARM_S, FB 3) carry up to ten associated values and do not require acknowledgement. Acknowledgement-required messages use ALARM_D (FB 2) or ALARM_DQ (FB 4). ALARM_DQ additionally carries up to ten associated values and supports central acknowledgement — required for 16-state signal groups or when messages must be acknowledged from multiple OS stations.

The relevant system blocks:

  • FB 2 / FB 3 / FB 4 – Message blocks placed in the S7-300 user program (LAD / FBD / STL), available in Libraries → Standard Library → System Function Blocks.
  • OB 82 – Diagnostic interrupt (e.g. wire break, sensor fail).
  • OB 85 – Priority class error.
  • OB 100 / OB 102 – Warm / cold restart messages.
  • SFC 17 / SFC 18 / SFC 19ALARM_SQ / ALARM_DQ / ACK_OP system functions (used for dynamic messaging from any FB).

Each call to ALARM_DQ transmits a message frame containing the EV_ID (event identifier), the state (incoming, outgoing, acknowledged), the time stamp from the CPU clock, and any associated values. The WinCC alarm logging receives the frame through the AS-OS connection configured in NetPro.

Step 1: Install the AS-OS Engineering Component

If the OS compile wizard does not appear when you compile the OS in STEP 7, the AS-OS integration component is almost certainly missing on the engineering PC.

  1. Insert the WinCC V7 installation DVD (or mount the ISO image).
  2. Launch Setup.exe from the DVD root.
  3. When prompted, choose User-defined installation (not "Typical").
  4. Expand the WinCC Configuration and WinCC Options tree nodes.
  5. Locate the entry labeled AS-OS Integration (sometimes shown as AS/OS Engineering in localized builds) and set it to "Will be installed on the hard disk".
  6. Confirm dependencies (Microsoft Message Queuing, SQL Server where applicable) are also selected.
  7. Complete the install.
  8. Re-apply the latest WinCC Update / Hotfix you currently have installed so the integration add-in is patched to the same baseline.

After this step, the WinCC Configuration entry appears in the Start → SIMATIC → STEP 7 → Configure AS-OS Interface program group, and STEP 7 registers the menu entry under Options → OS → Compile.

Step 2: Configure the STEP 7 Project and Place ALARM_DQ

Open your STEP 7 V5.x project containing the S7-300 station. Place a call to FB 4 (ALARM_DQ) in OB 1, OB 35, or the interrupt OB appropriate to the process. The call signature is:

// STL example
CALL FB 4, DB 10
  SIG      := I 0.0        // trigger signal (BOOL)
  ID       := DW#16#EEEE  // acknowledgement ID (optional)
  EV_ID    := DW#16#AAAA  // event ID — must be unique project-wide
  SEVERITY := 5            // message severity (0..31)
  SD       :=              // starting address of associated values
  // output
  ACK_STATE:= MW 20        // acknowledgement state

Compile and download the hardware configuration and the user program to the S7-300 station. Confirm the call is being executed by toggling I 0.0 and verifying a message appears in STEP 7 → CPU Messages → User-Defined Messages from the online view. Once that is working, proceed to NetPro.

Step 3: Establish the AS-OS Connection in NetPro

The OS compile wizard uses connections defined in NetPro. Without an S7 connection assigned to the WinCC station, nothing is compiled to WinCC.

  1. Open SIMATIC Manager → Options → NetPro.
  2. In the network view, right-click the WinCC station and select Insert New Connection.
  3. Choose the S7-300 CPU as the connection partner and select S7 Connection.
  4. In the connection properties, verify the Configured Connection Type is S7 Connection and tick OS assignment if available, or finish and then right-click the connection → Object Properties → OS* tab and check Used by WinCC.
  5. Click Apply, then Network → Save and Compile.
STEP 7 must be able to resolve the WinCC station's TCP/IP or MPI address. The AS-OS integration uses ISO-on-TCP (port 102) by default; verify no firewall rule blocks port 102 between the engineering PC and the S7-300 station.

Step 4: Run the OS Compile Wizard

  1. Return to SIMATIC Manager with the project open.
  2. Right-click the WinCC station and select OS → Compile (or from the menu: Options → OS → Compile).
  3. The OS compile wizard appears. Tick Operator messages (this includes ALARM_DQ / ALARM_D / ALARM_S / system diagnostics).
  4. Choose the message numbers to be auto-assigned by WinCC unless you maintain a cross-project message number map (described below).
  5. Click Compile. The wizard writes the S7 message configuration into the WinCC project's AlarmLogging database; you should see a status line such as "X operator messages / Y process messages transferred".

If the wizard still does not appear after the AS-OS installation in Step 1, restart the engineering PC and reopen the project. The wizard launcher is registered as a STEP 7 menu extension; partial installs occasionally require a re-register of the COM component via regsvr32 "C:\Program Files\Siemens\Automation\WinCC\bin\AsOsgw.dll".

Step 5: Configure the WinCC Alarm Display

Open WinCC Explorer and confirm the messages arrived:

  1. Launch WinCC Explorer and open the project that was just compiled.
  2. Open Alarm Logging. The transferred S7 messages should appear as rows with their EV_ID, message text, priority, and class.
  3. Open Graphics Designer and place a WinCC Alarm Control onto the process screen.
  4. In the Alarm Control configuration, select the message lists Alarm (state + acknowledgement) and optionally Short-term archive and Long-term archive.
  5. Configure the column set to include: Date, Time, Status, Class, Number, Message text, Point of error.
  6. Activate the project (Runtime). Trigger the ALARM_DQ by setting the configured SIG input high and observe the row appearing in the alarm control.

For TIA Portal / WinCC Runtime Professional environments, the same concept applies using the alarm table Web part; see the alarm table in DataMonitor RT Professional documentation for the Web-NX scenario.

Time-Stamp Correction for S7-300 Messages

The S7-300 CPU only stores a local time-of-day — no time-zone offset or DST flag. If the engineering PC and the CPU are not perfectly synchronised, the WinCC alarm control can show messages off by one or several hours. The behavior is documented in Siemens Knowledge Base article 7604251.

Recommended correction path:

  1. Confirm the CPU clock is synchronised using either SFC 0 SET_CLK at startup, the SIMATIC Time Synchronisation service, or an external NTP-talking CP (CP 343-1 Basic / Advanced).
  2. In WinCC Alarm Logging → Properties → Message Blocks → User Defined Block, confirm the time-source is set to CPU Time only if you intentionally want the CPU clock as reference; otherwise use WinCC Time which equals the runtime PC clock.
  3. Verify the Windows locale on the engineering and runtime machines has Adjust for daylight saving time automatically enabled. The CPU clock does not know DST, so any DST transition will shift the perceived timestamp by one hour until the next resync.
  4. For multi-station HMI panels, align all stations to a single NTP source via a CP card or the SIMATIC PC Time Synchronisation service.

Cross-Project Message Numbering (Optional)

For larger plants where the same WinCC message number is reused across multiple S7 stations (Acknowledge, Lock, Enable), use the message-number-procedure described in the WinCC V7 — Examples of Integrated Engineering with STEP 7 manual, chapter 5.3 "Message number procedure". With this mode enabled in the OS compile wizard, you assign each EV_ID to a project-unique WinCC message number, which lets you centralise acknowledgements from any HMI panel.

Troubleshooting Matrix

Symptom Likely Cause Verification Remediation
OS compile wizard never appears AS-OS integration component not installed Check Programs and Features for the WinCC option Reinstall via WinCC Setup → User-defined install → AS-OS Integration
Wizard runs but 0 messages transferred No ALARM / ALARM_S / ALARM_D / ALARM_DQ call in program Online CPU messages view Place the block and recompile
Wizard runs, messages present, but not in runtime WinCC project not activated or wrong message class filtered Graphics Designer → WinCC Alarm Control properties Activate runtime, relax filter
Message appears with wrong time CPU clock not synchronised; DST transition CPU online diagnostic → Time Implement SFC 0 sync; see 7604251
Acknowledgement from HMI has no effect Connection in NetPro is not flagged for OS use NetPro → connection properties → OS Tick "Used by WinCC", recompile
EV_ID collision warning during compile Duplicate event IDs in different FBs Cross-reference EV_ID across all instances Re-number the duplicates; recompile
Wizard error: "Unknown message number range" AS-OS message-number table empty OS project editor → Message Numbers Re-assign range via Tools → Configure Message Numbers

Verification Checklist

  • OS compile wizard appears immediately upon OS → Compile in SIMATIC Manager.
  • WinCC Alarm Logging database shows the transferred messages with English / local text.
  • Forcing the SIG input in the S7 program creates a row in the WinCC Alarm Control within one scan (≤ 250 ms for ALARM_DQ on a 315-2 DP).
  • Acknowledging the row on the HMI clears the visible state in the next PLC cycle.
  • Time stamps of fresh messages are within 1 second of the engineering PC clock when NTP is healthy.
  • Restarting the WinCC Runtime does not lose the long-term archive if the SQL Server database folder is on a persistent drive.

Field Notes and Engineering Best Practices

  • Reserve EV_ID ranges per station (e.g. station 1 = 0xA000–0xAFFF, station 2 = 0xB000–0xBFFF) to keep message identification clean.
  • Always use unique DB numbers for each ALARM_DQ instance DB. Reusing an instance DB across blocks corrupts the acknowledgement state.
  • Place heavy message-firing blocks (FIFO diagnostic buffers) in OB 35 (100 ms) or OB 82 (hardware interrupt) — never in OB 1 with cyclic OB 35 emission as a workaround.
  • For 16-state messages, prefer ALARM_DQ over ALARM_S because central acknowledgement is mandatory.
  • If you migrate from WinCC V6 to V7, the message-number procedure ("Message numbers") may need to be reenabled in the OS compile wizard before the V6 mappings translate correctly.

Why does the OS compile wizard fail to appear in STEP 7 when compiling the WinCC station?

The AS-OS engineering component is not installed. Insert the WinCC installation DVD, choose User-defined install, and select AS-OS Integration. After install, reapply your current WinCC Update, restart the PC, then re-open the STEP 7 project and try OS → Compile again.

My CPU messages show in STEP 7 online, but never reach the WinCC Runtime. What is wrong?

The S7 connection in NetPro is not flagged for OS use. Right-click the S7 connection between the WinCC station and the S7-300 CPU → Properties → OS* → enable the WinCC assignment, then recompile the OS.

What is the difference between ALARM_DQ and ALARM_S on the S7-300?

ALARM_S is a non-acknowledgement message (FB 3); ALARM_DQ (FB 4) is an acknowledgement-required message with up to ten associated values and supports central acknowledgement from multiple OS stations. Use ALARM_DQ for critical faults and ALARM_S for informational events.

How do I keep the CPU and WinCC clocks aligned so messages are not off by one or more hours?

Synchronise the CPU clock using SFC 0 ("SET_CLK") at startup or connect a CP 343-1 with NTP. Disable DST-only adjustments on the engineering PC if the CPU clock is the reference. See the Siemens KB article 7604251 for the full resolution path.

Can I configure the same ALARM_DQ EV_ID to be acknowledged from more than one WinCC station?

Yes. Enable the message-number-procedure option in the OS compile wizard and assign a project-unique WinCC message number for each EV_ID. With this configuration, WinCC treats the message as a process tag and allows distributed acknowledgement across all panels.

Back to blog