Implementing Automatic Voice Announcements on Siemens PCS7s

David Krause12 min read
Process ControlSiemensTechnical Reference
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

Automatic voice announcement on a Siemens PCS 7 process control system is required when an operator must be alerted to the start of operation of any unit (reactor, compressor, line, packaging machine) without watching the HMI. The audible cue must be triggered reliably from the Automation Station (AS), transmitted to the Operator Station (OS), and played through either a public address (PA) system, an intercom, or a PSTN telephone line to a predefined list of recipients.

The general announcement architecture described in US Patent 5,541,981 (Automated Announcement System) separates three functional blocks: a trigger source, a playback engine, and a distribution medium. The same architecture applies to PCS 7 V9.0/V9.1 when the AS is the trigger source, WinCC Runtime is the playback engine, and the medium is a PA amplifier, an analog telephone line, or a SIP gateway. Template-based expansion for multi-language announcements is documented in the IEEE paper Automated Public Address System Using Template-based Synthesis (IEEE, 2025); the same template principle is used here for storing up to N canned messages in a PCS 7 project.

Scope. This reference covers implementation with stock WinCC Runtime on a PCS 7 OS, Hayes-compatible modems or USB audio interfaces, and PLC-triggered dedicated annunciators. It does not cover SIP/VoIP interconnects to plant telephone systems, which require additional gateway hardware.

2. Three Implementation Options

Option Trigger Path Playback Device Best For Hardware Cost
A. WinCC + PC audio card + amplifier AS tag → WinCC alarm → C/VBScript → wav playback Industrial PC line-out → 70 V PA amplifier In-plant audible alerts (one or many zones) Low
B. Dedicated PLC-triggered annunciator AS digital output → annunciator input Standalone voice module with on-board storage Reliability-critical loops independent of HMI Medium
C. PSTN auto-dialer AS tag → OS serial/USB → external modem or TAPI-compatible dialer Telephone handsets (operator, manager, on-call) Off-hours and unattended plant announcement Medium–High

Most PCS 7 plants use Option A for in-plant announcement and add Option C for off-hours escalation. Option B is chosen when the announcement must survive a complete WinCC Runtime crash.

3. Prerequisites

  1. PCS 7 Engineering Station (ES) with SIMATIC Manager / TIA Portal, configured for the target project (V9.0 SP2 or later recommended; V9.1 supports Windows Server 2019/2022 OS images).
  2. Operator Station (OS) with WinCC Runtime, full installation of WinCC RT Advanced on Windows 10 IoT Enterprise LTSC 2019/2021 (or Server equivalent). Verify WinCC > "Computer" > "Properties" > "Startup" lists the desired runtime components.
  3. Audio hardware: industrial-grade PC with on-board HDA codec, or add-on USB audio such as the ESI Maya 22 USB or Behringer UCA222 for line-level output to a PA amplifier (70 V or low-Z).
  4. Modem hardware (Option C only): Hayes-compatible external modem on RS-232 or USB. Industrial-grade devices such as the MultiTech MT9234ZBA or US Robotics USR5637 are documented for 24/7 operation. Verify the device exposes a standard COM port or TAPI service provider.
  5. Plant PA amplifier (Option A) with line-level input and 25 V / 70 V / 100 V constant-voltage output; sized per the loudspeaker line load.
  6. Sample WAV files at 16-bit, 22.05 kHz or 44.1 kHz, mono, PCM, μ-law not required (linear PCM keeps the playback engine simple). File size for a 10-second message ≈ 220 KB at 22.05 kHz mono.

4. Option A — WinCC Audio Playback Architecture

SIMATIC AS 410 Industrial Ethernet OS / WinCC RT PC Audio (HDA) PA Boolean tag "Unit_Start" VBScript plays WAV Line-out → 70 V Tag change on AS → alarm in WinCC → global action script → mciSendString

The trigger originates from a Boolean tag in the AS (for example, Unit1_Start_Acknowledge). WinCC logs this as a message, which fires a global action script. The script invokes the Windows multimedia API to play the WAV file on the default audio device.

4.1 Tag Configuration on the AS

Create a single-cycle rising-edge tag in CFC/SCL on the AS:

// SCL on S7-410 AS (PCS 7 V9.0)
FUNCTION_BLOCK FB_UnitStartAnnounce
VAR
    bStartEdge : BOOL;  // one-shot
END_VAR
BEGIN
    IF i_bUnitStartCmd AND NOT bStartEdge THEN
        bStartEdge := TRUE;
        i_bAnnounceRequest := TRUE;   // drives WinCC tag "Unit1_StartAnnounce"
    ELSIF NOT i_bUnitStartCmd THEN
        bStartEdge := FALSE;
        i_bAnnounceRequest := FALSE;
    END_IF;
END_FUNCTION_BLOCK

Compile and download to the AS. The tag Unit1_StartAnnounce becomes visible in the OS tag database after the OS compile.

4.2 WinCC Alarm Wiring

Open WinCC Explorer > "Alarm Logging" > "Messages". Add a single-bit message on tag Unit1_StartAnnounce with class "System, Information", event "Incoming". On the "Actions" tab attach a global C or VBScript action that fires only on the "Message Came In" event.

4.3 Global VBScript Action (recommended)

' Global action: plays an audio file when tag rises
' Trigger: Tag "Unit1_StartAnnounce" (Boolean)
' File path: C:\PCS7\Announce\Unit1_Start.wav

Dim oShell, sCmd
Set oShell = CreateObject("WScript.Shell")
sCmd = """C:\PCS7\Announce\Unit1_Start.wav"""

' Use Windows Media Player COM in background mode
Dim oPlayer
Set oPlayer = CreateObject("WMPlayer.OCX")
oPlayer.URL = sCmd
oPlayer.Controls.Play

' Clean up after playback to release the audio device
Dim iDelay
For iDelay = 0 To 30     ' ~30 seconds max wait
    If oPlayer.playState = 1 Then Exit For   ' 1 = Stopped
    HMIRuntime.Trace "Playback in progress..." & vbCrLf
Next iDelay
Set oPlayer = Nothing

Place this script under "Global Script" > "Actions" and set its trigger to the message event "Unit1_StartAnnounce -> Incoming".

4.4 Alternative: C Script via mciSendString

// WinCC Global C Action
#include "apdefap.h"
void OnMessage(PMSG_MESSAGE msg)
{
    if (msg->dwEvent == MSG_EVENT_COMING)
    {
        // Open and play in background
        mciSendString("open \"C:\\PCS7\\Announce\\Unit1_Start.wav\" type waveaudio alias MSG1",
                      NULL, 0, NULL);
        mciSendString("play MSG1", NULL, 0, NULL);
    }
}

The C variant is preferred when sub-100 ms latency between tag rise and audible output matters; it bypasses Media Player initialization overhead.

5. Option B — PLC-Triggered Annunciator

For loops where the announcement must continue even when the WinCC OS is offline, install a dedicated voice module that listens directly on PROFINET or on a hard-wired digital output from the AS. Industrial voice modules include:

Module Class Storage Trigger Output
PROFINET voice node SD card, up to 255 messages PROFINET IO record write Line audio / 4 Ω speaker
Discrete-input voice module Internal flash, 8–32 messages 8–32 V DC inputs 8 Ω speaker or 70 V PA
Telephone auto-dialer Internal flash, 4–16 numbers Discrete inputs or serial PSTN line

Wiring from the AS410 is straightforward: one Boolean tag is mapped to a digital output module (e.g., SIMATIC ET 200SP DQ 8x24VDC/0.5A) and the voice module's discrete input is wired to the same output. On activation, the module plays the corresponding message regardless of OS state.

6. Option C — PSTN Auto-Dialer Integration

To play a pre-recorded message over the public switched telephone network (PSTN), the OS PC dials a destination number, waits for answer, and plays the WAV file into the line. Two implementation paths exist:

6.1 External Modem with AT Commands (legacy path)

Recommended for brownfield plants with existing analog trunk lines. The modem presents a Hayes-compatible command interface.

Phase AT Command Purpose
Initialize ATZ Reset to profile 0
Configure ATE1 ATV1 ATS0=0 AT+FCLASS=8 Echo on, verbose responses, auto-answer off, voice mode
Dial ATDT+15551234567 Dial destination in DTMF tone mode
Wait for connect AT+VLS=2 Select local speaker as audio source
Play AT+VPB="C:\PCS7\Announce\Unit1_Start.wav" Transmit recorded voice (8-bit μ-law at 8 kHz required)
Hang up ATH0 Terminate call
Format constraint. Modem voice playback under +FCLASS=8 requires 8 kHz, 8-bit, μ-law mono PCM. Convert standard WAVs to this format with SoX:
sox Unit1_Start.wav -r 8000 -e mu-law -b 8 -c 1 Unit1_Start_modem.wav

6.2 TAPI (Microsoft Telephony API) Integration

Newer deployments use Windows TAPI 3.x instead of raw AT commands. TAPI abstracts the underlying hardware (modem, SIP gateway, or TDM card) and exposes a COM-based line device object. WinCC scripts can call TAPI directly through tapi3.dll and mscorlib.

Reference: Microsoft Telephony API documentation, Microsoft Learn — Telephony API (TAPI).

' WinCC VBScript via TAPI 3.x (Windows 10 / Server 2019)
Dim oTapi, oAddr, oCall
Set oTapi   = CreateObject("TAPI.AddressFamily.1")
Set oAddr   = oTapi.get_AddressesByName("Line1").Item(0)
Set oCall   = oAddr.CreateCall("+15551234567", 1, 1)   ' TAPICALLMEDIA_AUDIO

oCall.Connect False
Do While oCall.State < 3   ' CS_CONNECTED = 3
    HMIRuntime.Trace "Dialing..." & vbCrLf
Loop

' Stream WAV to line device via SAPI 5 / DirectShow
' (Implementation detail: use DirectShow FilterGraph with
'  Tee -> Sound Card Capture Filter -> TAPILineDevice)
HMIRuntime.Trace "Connected, playing message..." & vbCrLf
WScript.Sleep 10000   ' message length in ms
oCall.Disconnect
TAPI line provider required. The TAPI 3.x COM object only works if a Windows line device provider is installed for the modem. For USB soft-modems, install the vendor's TAPI service provider (TSP) such as USR5637 TSP from US Robotics. Verify with tapiinfo.exe from the Windows SDK.

7. WAV File Preparation and Sizing

Each pre-recorded announcement must be stored in a deterministic path on every OS image. Recommended layout:

C:\PCS7\Announce\
   Unit1_Start.wav
   Unit1_Stop.wav
   Unit2_Start.wav
   Alarm_Critical.wav
   Alarm_Warning.wav
   language\
      de\
      es\
      zh\
      ...

Size the storage per the formula:

bytes = duration_seconds * sample_rate_Hz * (bits_per_sample / 8) * channels

For example, a 30-second mono message at 44.1 kHz, 16-bit:

bytes = 30 * 44100 * (16/8) * 1 = 2,646,000 bytes ≈ 2.6 MB

For 50 messages at 30 s each, plan ≥ 130 MB of free space on the OS drive. Keep an offline mirror for disaster recovery.

8. Plant Audio Output Sizing (Option A)

When the line-out of the OS PC feeds a PA amplifier, the amplifier must drive the total loudspeaker line load. The constant-voltage PA formula is:

P_amplifier_W = sum_over_taps( V_tap^2 / Z_speaker ) * 1.25   (25% headroom)

For a 70 V line with twenty 1 W taps:

P = 20 * 1 = 20 W → amplifier minimum = 25 W → choose 30 W or 40 W unit
Verification. Always confirm by reading the actual tap power on each speaker transformer; mismatched transformer primaries are a common field defect.

9. PCS 7 AS–OS Engineering Steps

  1. In SIMATIC Manager, open the project and place the Boolean tag Unit<n>_StartAnnounce in the AS program as an output of the unit control block. Use CFC for ladder-equivalent visual editing or SCL for text-based logic.
  2. Compile the AS (right-click > "Compile and Download Objects") and verify the tag appears in the S7 connection list.
  3. In the OS project, run the OS compile (WinCC Explorer > OS Project Editor > Compile OS). The tag becomes visible in the WinCC tag management under the area folder of the AS.
  4. Create an internal WinCC tag Unit1_StartAnnounce_Pulse that is a 2-second one-shot derived from the AS tag using a "Linear Conversion" or a small C action. This debounces chatter on noisy input signals.
  5. Create the alarm message and attach the global action as described in §4.
  6. On the OS, place the WAV files in C:\PCS7\Announce and grant the WinCC Runtime user account read access.
  7. Activate the OS Runtime and trigger the start of the unit. Listen for the announcement at the PA speaker.

10. Verification and Acceptance Test

Check Expected Result Method
Tag propagation Boolean appears in WinCC tag list WinCC Tag Management > search > "Unit1_StartAnnounce"
Alarm firing Message appears in alarm log within 1 s of trigger Alarm Logging runtime view
Audio latency < 1 s from tag rise to audible output Stopwatch + audio recording
Audio level 75 dBA ± 5 dB at 1 m from speaker Type 1 SPL meter
PSTN dial-out (Option C) Recipient answers and hears message Manual call test to cell phone
Redundancy (Option B) Announcement plays even when OS Runtime is stopped Stop WinCC, trigger AS tag, listen
Failure fallback No spurious announcement on WinCC restart Cycle OS, observe silence until fresh trigger

11. Troubleshooting Matrix

Symptom Likely Cause Diagnostic Remediation
No audible output, but alarm fires Audio device muted or wrong default device Right-click speaker icon > Sounds > Playback Set OS line-out as default; unmute
WAV plays in script test, not in Runtime Working directory mismatch or relative path Trace HMIRuntime.Trace path Use absolute path C:\PCS7\Announce\...
Choppy audio on long messages CPU contention on OS Task Manager > WinCC.exe CPU% Move WAV playback to a dedicated thread or move option C to a separate utility PC
Modem dials but no audio heard by remote party WAV not in 8 kHz μ-law format Inspect with soxi Re-encode with sox command in §6.1
TAPI returns error 0x80000001 No TSP installed for modem Control Panel > Phone and Modem Install vendor TSP and reboot
Announcement repeats indefinitely Tag not debounced; alarm re-arms Alarm log shows re-fire events Add 2 s pulse tag as in §9 step 4
Announcement missing after WinCC restart Global action not persistent WinCC Explorer > Computer > Autostart Place global actions in Global Script > Actions, not in local picture scripts

12. Field-Proven Notes

Multiple-language announcement. Build a small selection function in the global action that picks the language subdirectory based on a WinCC tag Operator.Language (set from the OS login). This avoids maintaining N parallel alarm messages.
OS image hardening. Disable Windows audio "enhancements" (loudness equalization, bass boost) to prevent colored playback. Set the audio sample rate to match the WAV (44.1 kHz) in the audio driver control panel.
Plant paging etiquette. For multi-unit plants, prefix every message with a 1-second attention tone (1 kHz sine) so listeners can brace for the announcement. The US 5,541,981 patent describes this technique in the "alarm tone generator" subsystem.
Standards to verify against. Telephone line interface devices must comply with the local telecom authority (FCC Part 68 in the US, TBR-21 in EU, CTR-21 historically). PA amplifier installations must follow NFPA 72 for emergency signaling where the announcement is part of an evacuation chain.

What is the simplest way to play a WAV file from WinCC Runtime on a tag change?

Create a global VBScript action triggered by an alarm event on the tag. The script instantiates WMPlayer.OCX, sets URL to the WAV absolute path, and calls Controls.Play. Latency is typically under one second on an AS410 system.

Which modem and audio format do I need for PSTN playback?

Use a Hayes-compatible external modem with +FCLASS=8 voice mode support. The WAV file must be converted to 8 kHz, 8-bit, μ-law mono PCM via SoX: sox input.wav -r 8000 -e mu-law -b 8 -c 1 output.wav.

Can the announcement still play if WinCC Runtime is stopped?

Yes, but only if Option B (dedicated annunciator) is installed. Wire a digital output of the AS directly to the voice module's discrete input; the module then plays the message independently of the OS. WinCC-based options (A and C) require Runtime to be active.

How do I support multiple languages in the same project?

Store WAV files under C:\PCS7\Announce\<language>\ and read the operator language from a WinCC tag Operator.Language (populated from the OS login). The script concatenates the path: "C:\PCS7\Announce\" & language & "\Unit1_Start.wav".

What is the maximum recommended number of canned messages per OS image?

For 30-second messages at 44.1 kHz mono 16-bit (≈2.6 MB each), 50 messages require about 130 MB of disk and load into RAM only when played, so storage is the limit. Keep under 200 messages per OS to retain headroom for WinCC's own archive growth.

Back to blog