Configuring WinCC Alarm Print Jobs and Message Sequence Reports

David Krause15 min read
SCADA ConfigurationSiemensTutorial / 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

Siemens WinCC exposes message and alarm data through the Alarm Control ActiveX (the Alarm OCX in V6 / Alarm Control in V7) and the Alarm Logging editor. Operators can trigger two distinct print operations from the toolbar: a message report (cumulative, sourced from the archive) and a current view (what is on screen at the moment of the click). For unattended or event-driven printing — for example, the moment a new message arrives — WinCC uses a print job bound to a line layout (*.RP1) or a page layout (*.RPL). The print job named Message sequence report prints only newly incoming messages and is the only job in a stock WinCC installation that targets a line printer.

This reference covers the full alarm-printing workflow from WinCC V6.0 through V7.5 SP2: file layout, designer configuration, runtime activation, line vs page printer selection, C and VBS scripting, the Alarm OCX toolbar buttons, and the typical failure modes that produce an empty PDF. The reference is built from the field-proven procedures documented in the WinCC Alarm Logging and Report Designer manuals and is intended for engineers commissioning or troubleshooting alarm output in operating plants.

Prerequisites

  • WinCC V6.0 SP4 or later (V6.2, V7.0, V7.2, V7.3, V7.4, V7.5, V7.5 SP2 all supported).
  • Alarm Logging component installed and runtime-licensed.
  • At least one configured message class and one wired message tag.
  • For line-printer output: a line printer reachable from the WinCC server, or a Windows generic / text-only printer queue mapped to a continuous-form device.
  • For page-printer output: any Windows printer queue (office laser, inkjet, or PDF writer) and a configured *.RPL page layout.
  • For script-driven printing: Global Script C editor (V6) or the VBS action editor (V7) with write access to the project.
  • The Report Runtime option installed and licensed on the WinCC server.
Report Runtime is a separate WinCC option. Confirm its presence in the WinCC Explorer under Computer > Properties > Startup. Without it, the print jobs will not execute even when the print job and layout are correctly configured.

Print Job Architecture

WinCC separates three layers for every printed report:

  1. Layout — the visual definition of the printout. Two file extensions are valid: *.RP1 (line layout) and *.RPL (page layout).
  2. Print job — the binding between a layout, a printer queue, and a data source. WinCC ships a set of predefined jobs for Alarm Logging.
  3. Trigger — the event that starts the job: operator button, scheduled time, or C / VBS script call.
Layout (*.RP1 / *.RPL) Print Job Printer / File Trigger (Button / Script / Time)

When a print job is opened in the WinCC Explorer under Report Designer > Print Jobs, the file extension tells you the mode:

File extension Mode Output device
*.RP1 Line layout (line printer) Continuous-form line printers; one record per carriage return
*.RPL Page layout (page printer) A4 / Letter page printers; full pages only
A line layout is bound to a print job whose Printer field is set to a line printer queue. If you assign a *.RPL layout to the same job, the Line Layout for Lineprinter option in the report properties is automatically greyed out — the two modes are mutually exclusive per job.

Standard Print Jobs and Layout Files

WinCC ships with several print jobs under Report Designer > Print Jobs in the Alarm Logging editor. The most common ones for alarm output are:

Print job name Layout Output
@Report Alarm Logging – Message sequence report *.RP1 line layout Continuous stream of new incoming messages only
@Report Alarm Logging – Message list *.RPL page layout One or more pages listing the current archive contents
@Report Alarm Logging – Archive list *.RPL page layout Historical archive dump for a selected time range
@Report Alarm Logging – Short-term archive list *.RPL page layout Snapshot of the short-term archive

The Message sequence report is the only job that prints only new messages. It is the correct choice for unattended / event-driven printing where the operator is not on screen. The Short-term archive list job is the correct choice when the operator wants a snapshot of what is currently visible in the Alarm Control. In WinCC V6.0 SP4, the line-layout print job is marked with a yellow sheet in the printer icon in the Report Designer tree; page-printer jobs are not flagged.

Configuring the Message Sequence Report

  1. In the WinCC Explorer, open Alarm Logging.
  2. Right-click Reports and choose Add/Remove.
  3. In the Report Parameters dialog, enable the check box Message sequence report active.
  4. Click OK. The print job is created and bound to a default line layout.
  5. Open Report Designer > Print Jobs to verify the job was generated and inspect its bound layout.
The Reports > Add/Remove path is the documented route. In WinCC V6.0 base releases, the option may be greyed out until Alarm Logging has registered at least one message class and the project has been compiled at least once.

Activating in the Computer Properties Startup List

The hook that actually turns the message sequence report on at runtime is in the computer properties. The WinCC runtime must start the print job when the OS boots the project. To enable it:

  1. Open Computer Properties in the WinCC Explorer.
  2. Switch to the Startup tab.
  3. Add Report Runtime (or specifically the Alarm Logging print job) to the startup list and set its delay / sequence as required.
  4. Confirm that the project is in Activate state; the report runtime starts only when the project runs.

This activation step is what trips up most first-time users. Even with the layout and print job configured, no line is printed unless the report runtime is part of the project startup. The print job icon is yellow in the Report Designer tree to indicate line-printer output mode (WinCC V6.0 SP4); page-printer jobs are not flagged.

Line vs Page Printer Output

WinCC supports two modes for the message sequence report:

Mode Layout type Configuration switch When to use
Continuous (line printer) *.RP1 Properties > Line Layout for Lineprinter = checked Real line printer, or one-line-per-message CSV-like output to a text file
Page-by-page (page printer) *.RPL Properties > Line Layout for Lineprinter = unchecked No line printer available; paginated PDF or letter output

To switch between modes:

  1. Open the print job's properties dialog from the Report Designer.
  2. If a *.RPL page layout is currently selected, the Line Layout for Lineprinter checkbox is greyed out. Set the layout to <NONE> first.
  3. Toggle the checkbox on or off.
  4. Reassign a layout: *.RP1 if the checkbox is on, *.RPL if it is off.
Once Line Layout for Lineprinter is enabled, the print job only accepts line layouts (*.RP1) or <NONE>. You cannot assign a *.RPL layout until the checkbox is cleared. Conversely, after a *.RPL layout is bound, the line layout option is locked grey.

Alarm OCX / Alarm Control Toolbar Buttons

The Alarm Control exposes two print-related buttons on its toolbar. They look similar but produce very different output:

Button Action Output
Print message report Triggers the configured report print job (full archive content, not the visible filter) Complete list; the alarm-archive dataset
Print current view Prints exactly what is on screen, respecting active filters, sorting, and column visibility The visible rows, page-by-page

If the operator sees 62 messages on screen and the resulting PDF is empty, the wrong button was almost certainly pressed, or the underlying print job has no page layout. Print current view requires a paginated page layout assigned to the print job — without one, the print is sent to <NONE> and discarded. Assign an *.RPL layout, retest, and the PDF will populate.

Script-Driven Printing (RPTJobPrint and VBS)

For event-driven printing — firing the print on acknowledge, on priority change, or on a scheduler cycle — use the C-script API in WinCC V6 / V6.2 or the VBScript runtime API in V7.

C-Script (WinCC V6 / V6.2)

The relevant function is declared in the WinCC include apdefap.h:

RPTJobPrint(LPCTSTR lpstrJobName);

Example C action attached to a button:


#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
    RPTJobPrint("@Report Alarm Logging - Message sequence report");
}

Notes on the call:

  • Pass the exact print job name as it appears in the Report Designer, including the @ prefix for system-supplied jobs.
  • The function is blocking on most builds; for high-frequency events add a debounce in your trigger condition.
  • If the job name contains non-ASCII characters, wrap it in _T() for Unicode builds.
  • On failure, the function returns FALSE; the cause is logged to the WinCC diagnostic window ApDiag.exe.

VBScript (WinCC V7.0 and later)

The WinCC V7 runtime exposes the alarm subsystem through HMIRuntime.AlarmLogging:


HMIRuntime.AlarmLogging.Print "@Report Alarm Logging - Message sequence report"

For a generic print job (not specifically alarm-bound), use:


HMIRuntime.Print "JobName"

To print the current view of a specific Alarm Control on a picture, set its print job property and call its print method:


Dim ctrl
Set ctrl = ScreenItems("Control1")
ctrl.PrintJobName = "AlarmPrint_CurrentView"
ctrl.Print

Printing the Short-Term Archive List

To print exactly the rows shown in the short-term archive list, the script must call the print job that uses the current view data source, not the message sequence report. The message sequence report deliberately ignores filters and prints new messages only — that is its job. If your application needs a snapshot of the filtered list, you have two options:

  1. Add a custom print job bound to the Alarm Control's current view data source and an *.RPL page layout. Trigger it with RPTJobPrint or HMIRuntime.AlarmLogging.Print.
  2. Use the Alarm OCX's Print current view button programmatically by setting the Alarm Control's PrintJobName property and calling its Print method from a button action.

The current view source reflects whatever the operator has filtered, sorted, and selected at the moment of the print. This is the typical use case for "I have 62 messages on screen, I want a PDF of those 62".

Layout Variables for Alarm Reports

The standard WinCC alarm report layouts expose a number of layout variables that you can use in *.RPL page layouts to dynamically select a time range, message class, or filter. The most commonly used are:

Layout variable Purpose Typical value
@AlarmTime Filter on the alarm time field Time range, e.g. 2024-01-01 00:00:00
@AlarmClass Filter on message class Class name as defined in Alarm Logging
@AlarmState Filter on message state (CAME_IN, WENT_OUT, ACKNOWLEDGED) Numeric state
@Priority Filter on priority 0–16
@FromTime / @ToTime Time range for archive dump Date / time string

These are evaluated by the Report Designer when the layout is compiled. The variables can be set from a script that calls SetPropChar on the layout object before triggering the print. If substitution appears ignored, reopen the *.RPL, change a value to force a recompile, and save.

Output Targets, Drivers, and Redundancy

WinCC prints to any Windows-installed printer queue. In practice there are three useful target categories:

Target Driver Use case
Industrial line printer (e.g. Epson LX-300, Okidata ML320) Generic / Text Only Continuous paper tape for log books; the canonical use case for the message sequence report
Office laser or inkjet Manufacturer driver Letterhead or A4 printouts; requires *.RPL page layout
PDF writer (PDFCreator, Microsoft Print to PDF) Manufacturer / Windows built-in Archival and dispatch; the most common modern target
Avoid PostScript-only drivers with line layouts. The driver will reject the CR-only output and either drop the job or rasterize incorrectly. For RP1 line output, always use Generic / Text Only or a dedicated dot-matrix / thermal driver. Plan your line layout to stay within the column count of the target line printer; most industrial line printers handle 80 or 132 columns, and the practical WinCC line-layout ceiling is 160 characters (192 with the Extended alarm type) before truncation occurs.

Redundant and Multi-User WinCC

In a redundant WinCC server pair, print jobs are configured on the master project and replicated to the standby. Alarm messages print from whichever server currently holds the master role. If you need a single point of printing across the pair, bind the print job's Printer field to a network printer queue reachable from both servers; the job will follow the master role automatically.

In a WinCC client / server project, alarm printing executes on the server, not the client. The Alarm Control on the client sends the print request to the server's Alarm Logging runtime, which then dispatches the job. The client never touches the printer driver directly. This is a common source of confusion: configuring a printer on the client has no effect on alarm print output.

Troubleshooting Matrix

Symptom Likely cause Fix
Empty PDF when printing 62 messages from Alarm Control Wrong toolbar button (used message-sequence job against a filtered view) or no page layout assigned to the job Assign a *.RPL page layout to the print job; switch to the Print current view button or to a custom current view print job
Nothing prints at all Report Runtime not in the computer startup list, or project not activated Add the print job to Computer Properties > Startup and restart the runtime
"Line Layout for Lineprinter" greyed out A *.RPL page layout is currently bound to the job Set the layout to <NONE> first, then toggle the checkbox
Only first page prints Line layout assigned but a page printer queue is selected Either assign an *.RPL page layout, or remap the print job to a continuous-form printer queue
Message sequence report option missing from Add/Remove WinCC V6.0 base build; the option was added in V6.0 SP2 and later Upgrade to at least V6.0 SP2 or V6.2; or manually create the print job via the Report Designer
RPTJobPrint returns a runtime error Job name typo, project not activated, or layout has a syntax error Verify the job name exactly, activate the project, and run the layout through the designer to surface layout errors
Layout variable substitution ignored Layout not recompiled after variable change Reopen the *.RPL file, change a value to force a recompile, and save
Print fires twice for one event Two print jobs bound to the same event trigger (e.g. global action and button) Audit the project for duplicate triggers; pick exactly one
Print queue shows "Access denied" The WinCC runtime user does not have rights on the network printer Grant the WinCC service account print rights on the queue, or use a local printer on the server
Lines truncated on the printout Line width exceeds the target printer column count Reduce the number of layout columns or move to a wider line layout; do not exceed 160 chars (192 for Extended)
Client print button has no effect Alarm printing runs on the server, not the client Verify the server-side Report Runtime is running and the print job exists on the server project

Specifications, Limits, and Verification

Item Value
Print job file extensions *.RP1 (line), *.RPL (page)
Layout ownership Report Designer (WinCC Explorer)
Job ownership Alarm Logging editor (per project) or Report Designer
Activation surface Computer Properties > Startup > Report Runtime
C API (V6) RPTJobPrint(LPCTSTR) in apdefap.h
VBS API (V7) HMIRuntime.Print family; Alarm Logging specific: HMIRuntime.AlarmLogging.Print
Message sequence report scope New incoming messages only (does not backfill archive)
Page printer mode Whole page only — no half-page or partial output
Practical line-layout width 160 characters per line, 192 for the Extended alarm type
Print job per project Unlimited (subject to Report Designer performance)
Redundancy Print jobs replicate to standby; output follows master role
Client / server printing Executes on the server, not the client

Verification Checklist

  1. Open the WinCC project and confirm the print job is listed under Report Designer > Print Jobs.
  2. Confirm the bound layout file exists on disk and the project-relative path resolves.
  3. Activate the project; verify Report Runtime appears in the activated services list of WinCC Explorer.
  4. Trigger a single alarm; check the configured printer queue for one printed record.
  5. Repeat with the Print current view button on the Alarm OCX to validate filtered output.
  6. If using a C script, call RPTJobPrint from a debug action and inspect the return code in the WinCC diagnostics window ApDiag.exe (V6) or the GSC diagnostics (V7).
  7. Test failover: in a redundant system, force a master switch and confirm the print job continues to fire from the new master.
  8. For PDF targets, verify the output file is non-empty and that the page count matches the alarm count.

For ongoing reference, the Siemens Industry Online Support portal hosts the current WinCC manuals and the Siemens WinCC product page lists the supported versions and option packages.

FAQ

Does WinCC ship with a preconfigured print job for the message sequence report?

Yes. WinCC Alarm Logging ships the print job @Report Alarm Logging - Message sequence report, bound to a default line layout (*.RP1). Activate it under Alarm Logging > Reports > Add/Remove > Report Parameters > Message sequence report active, and add the report runtime to the computer startup list.

How do I print only the rows currently visible in the Alarm Control?

Use the Alarm OCX toolbar button Print current view, not Print message report. The latter prints the full archive dataset. Under script, bind a custom print job to the Alarm Control's current view data source with an *.RPL page layout, then call RPTJobPrint or HMIRuntime.AlarmLogging.Print with that job name.

Why is the generated PDF empty when the Alarm Control shows messages?

Most often an *.RPL page layout is not assigned to the print job, or the wrong toolbar button is used. The message-sequence report job only prints new messages; if the project was already running when the filter was applied, no new lines fire. Assign a page layout, switch to the current-view button, and re-test.

Can I trigger an alarm print automatically when a new message arrives?

Yes. The message sequence report print job does exactly that when Report Runtime is in the computer startup list. For per-message conditional logic, attach a C or VBS action to the Alarm Logging event and call RPTJobPrint("...") or HMIRuntime.AlarmLogging.Print "..." respectively.

How do I switch the message sequence report from a line printer to a page printer?

Open the print job properties. If an *.RPL page layout is bound, set it to <NONE> first. Clear the Line Layout for Lineprinter checkbox, assign an *.RPL page layout, and choose your Windows printer queue. Save and reactivate the project.

Back to blog