Problem Description
When using WinCC (TIA Portal / WinCC Explorer, including the Reports and Alarm Logging editors) to produce a printed archive of alarm messages, many engineers observe that a daily alarm report only ever contains approximately 32 pages, even when far more alarms have been recorded that day. Pages that should contain valid messages are silently truncated at the print spool, leaving operators with an incomplete audit trail. The issue is most often reported on:
- WinCC V7.x Runtime / WinCC Professional (TIA Portal) V13 to V20
- Projects that use the default Alarm Logging Runtime layout with a per-day message sequence selection
- Printers that correctly receive the WinCC job but stop after a fixed number of message frames
The print job completes without an error, the printer's queue is empty, and the report shows the correct time range, but tail-end alarm frames are missing. This behavior is not a printer-driver failure or a Windows spooler issue; it is a documented characteristic of how WinCC's Message Sequence Report composes pages when its configuration is left at the project default.
Symptoms and Field Observations
Symptoms reported in the field are consistent across WinCC versions and printer brands:
- Daily alarm report consistently stops at 32 pages regardless of alarm volume.
- No WinCC system alarm, no error code in WinCC Explorer > Tools > System Information, and no entry in the Windows event log.
- When the same time slice is exported to a CSV via the Alarm Logging editor, the row count matches the database and exceeds the page-equivalent row count on the printed report.
- Modifying the page count or printer driver does not change the cutoff at exactly 32 pages.
Root Cause: Message Sequence Protocol Limits and Layout Defaults
WinCC's Message Sequence Report prints alarm frames in the order they are written to the Alarm Logging database. By default, the system uses an internal buffer size that maps to roughly 32 print pages under standard line-height and column defaults. When you trigger a print job that requests more frames than the buffer can hold, the spooler only outputs the frames already loaded into the buffer at job-start time; the remaining frames remain queued but are dropped when the report job closes. This is the most common cause of the "32-page daily limit" and is independent of physical memory, disk space, or printer capability.
Three configuration decisions directly drive this limit:
- Layout — the Alarm Message Table sheet you assign to the print job must contain a row height and column count that fills each page with a known frame count. The default project layout is optimized for screen display, not bulk printing.
-
Print job definition — the Reports editor entry for the alarm log must reference a print job (
RPTJobPrinttarget) and a page range that covers the full time slice; if the page range is left at default, the report only commits frames already in the message sequence buffer. -
Trigger source — manual Print clicks from the Alarm Control may pre-load the buffer; scheduled global-script triggers with a wider time range require an explicit
RPTJobPrintcall to commit the full sequence to the spooler.
Prerequisites for a Correct Alarm Printout
Before reconfiguring the report, verify the following engineering prerequisites. Most "32-page" issues are resolved by one of these checks, before any code change is needed.
- WinCC project must be running on the server that owns the Alarm Logging database. Client stations can view alarms but cannot print the full message sequence unless the project is configured with the Server-Prefetch option enabled in the Alarm Logging editor.
- The printer must be installed on the WinCC server with a known driver. Use the Siemens-tested driver list when possible; generic Windows PCL/PS drivers are valid for text reports but may break column alignment on multi-byte Windows installations.
- Disk space on the project path must be at least 1 GB free; message sequence exports use the project folder as scratch space during large prints.
- Global script runtime must be enabled: WinCC Explorer > Computer > Properties > Startup > Global Script Runtime.
- User rights for the WinCC user must include Configuration > Reports and Operation > Alarm Logging authorization levels.
Reference: Printing Alarms in Runtime (RT Professional) — WinCC (Siemens TIA Portal V20 documentation, TIA Cloud Help).
Solution 1 — Configure the Alarm Message Table Layout for Print
The first and most reliable fix is to assign a print-optimized Alarm Message Table sheet to the report job instead of the default runtime layout.
- Open WinCC Explorer > Alarm Logging > Reports.
- Right-click the report you use for daily logs and select Select Layout....
- Choose the @Alarm Message Table layout, then click Edit.
- In the layout editor, reduce the row height of each alarm line to
0.4 cmand the column widths to fit the print page width (e.g.2.5 cm, 2 cm, 2 cm, 8 cmfor a 21 cm-wide A4 printable area). This raises the number of frames per page from ~32 to ~55–65 on a default installation. - Confirm with OK and save the project.
- Re-deploy the Runtime and re-trigger the report.
The change applies to all reports that reference this layout, so plan the layout for the highest-volume report and reuse it.
Solution 2 — Use RPTJobPrint from a Cyclic Global Script
When you need to print on a schedule (daily, weekly, monthly), a cyclic action calling RPTJobPrint is the recommended pattern. The function commits the full message sequence buffer to the spooler, bypassing the manual Print dialog that only pre-loads a partial buffer.
Step-by-step configuration
- In WinCC Explorer, right-click Global Script > C-Actions and select New > Action.
- Set the trigger to Time > Cyclic. Recommended intervals:
- Daily archive:
86400000 ms(24 h), aligned to 00:00 server time. - Weekly archive:
604800000 ms(7 d). - Monthly archive: trigger on the first day of each month using a tag-driven condition instead of pure cyclic.
- Daily archive:
- Paste the following C-action body:
// C-Action: Scheduled Alarm Logging Print
// Trigger: cyclic, e.g. 24h for daily archive
#include "apdefap.h"
void OnTimeTrigger(char* lpszPictureName, char* lpszObjectName)
{
// Print job name as defined in Reports editor
char* szPrintJob = "AlarmLog_Daily";
// Print page name (the Alarm Message Table layout assigned to the job)
char* szPrintPage = "@Alarm Message Table";
// Issue the print job; RPTJobPrint handles buffer flush to spooler
RPTJobPrint(szPrintJob, szPrintPage, 0);
}
- Compile the action. If you see error 0334: 'RPTJobPrint': undeclared identifier, ensure that the project's AP_Functions.h is included in the project include path (Options > Settings > Include).
- Save and re-deploy the Runtime.
int RPTJobPrint(LPCTSTR lpJobName, LPCTSTR lpPageName, int nCopy). Returns 0 on success; any non-zero return code indicates a job-not-found condition. Check the WinCC system alarm 1300xxx range for job-name resolution errors.
Solution 3 — Output the Message Sequence to a File (Diagnostic + Archival)
If the print path remains unstable — for example, on remote printer servers or in heavily virtualized environments — output the message sequence to a file and print from a host process. This also doubles as a diagnostic: comparing the file's line count with the printed page count immediately proves whether the truncation is happening in WinCC or in the printer driver.
Using GmsgFunction
Reference: Siemens Support Portal entry 15350783 (C-Script example for GmsgFunction — output of message frames to a text file).
// C-Action: Write today's alarm sequence to a daily text file
// Trigger: cyclic, 60 seconds (file is rotated by date at midnight)
#include "apdefap.h"
#include "GlobalDef.h"
void OnCyclicTrigger(char* lpszPictureName, char* lpszObjectName)
{
char szFileName[256];
char szDate[32];
SYSTEMTIME st;
GetLocalTime(&st);
sprintf_s(szDate, sizeof(szDate), "%04d%02d%02d", st.wYear, st.wMonth, st.wDay);
sprintf_s(szFileName, sizeof(szFileName),
"C:\\WinCC_AlarmArchive\\AlarmLog_%s.txt", szDate);
// 0x0001 = MSG_TYPE_ALARM, 0x0002 = include acknowledged, 0x0004 = include cleared
DWORD dwFlags = 0x0001 | 0x0002 | 0x0004;
GmsgFunction(szFileName, "@Alarm Message Table", 0, 0, 0, 0, dwFlags);
}
- Create the target folder
C:\WinCC_AlarmArchive\on a drive with sufficient free space; in industrial sites, prefer a non-OS partition to simplify backup. - Add the action to the project's Global Script > C-Actions with a 60-second cyclic trigger.
- After 24 hours, the file
AlarmLog_YYYYMMDD.txtwill contain the full day of alarms, line by line, with one record per alarm event.
You can then print the file from a Windows scheduled task using notepad /p, or feed it to a third-party reporting tool such as Excel or Power BI for audit-ready output.
Solution 4 — Buffer and Time-Range Tuning
When the 32-page limit persists after the layout change, the message sequence buffer is the next knob to inspect.
- Open Alarm Logging > Properties > Archive.
- Set Message sequence buffer from the default
1024frames to8192frames (or higher, sized to your worst-case day). - Adjust the Update cycle to
1000 msso that alarms are flushed from the working buffer to the archive every second instead of every 5 seconds. - For long historical windows (e.g. monthly reports), set the Time range of the print job explicitly to From: 00:00:00 of the first day, To: 23:59:59 of the last day. A relative time range like last 30 days can misalign with the buffer flush boundary and re-introduce truncation.
Verification Procedure
After applying any combination of the four solutions above, validate the printout by executing the following sequence. This is the same sequence used during WinCC Factory Acceptance Tests (FAT) for alarm-archiving deliverables.
- Generate load: using the internal Alarm Simulator (Tools > Alarm Logging > Test) or a script, fire 5,000 alarm frames within 60 seconds. Confirm that the archive row count in the Alarm Logging editor is 5,000.
- Trigger the report via the global script action; do not use the manual Print button.
- Count pages in the spooler output. For a daily report on a load of 5,000 alarms, you should now see between 90 and 200 pages (depending on layout), not 32.
-
Cross-check the printed total against
GmsgFunction's text file. Both should report the same alarm count for the same time range. A divergence of more than 1% indicates a remaining buffer or layout mismatch. -
Inspect WinCC system alarms: open WinCC Explorer > Tools > System Information and confirm there are no entries with IDs
1300001through1300999for the test window. These IDs map to Reports-editor failures. - Repeat the test on a quiet day (fewer than 50 alarms) to confirm the report still produces a valid 1–2 page output, ruling out an over-sized buffer regression.
Cross-Reference: WinCC Version Notes
| WinCC Version | Editor Path | Function Signature | Known Limitation |
|---|---|---|---|
| WinCC V7.4 SP1 | Alarm Logging > Reports | RPTJobPrint(LPCTSTR, LPCTSTR, int) |
Default buffer 1024 frames; 32-page cap on default layout. |
| WinCC V7.5 SP2 | Alarm Logging > Reports | Same as V7.4 | Layout wizard introduces auto-fit column — verify column count post-wizard. |
| WinCC Professional (TIA V15–V17) | HMI > Reports > Alarm Logging Report | VB-script wrapper available | Buffer exposed under Runtime Settings > Alarms > Buffer size. |
| WinCC RT Professional (TIA V18–V20) | Project tree > Reports > Alarm log | Same as V7.x via WinCC API | Print job list shown in TIA Cloud Help — Printing Alarms in Runtime (RT Professional). |
Best Practices for Sustainable Alarm Archiving
-
Decouple print from primary alarm storage. Treat WinCC's Reports editor as the print front-end and the Archive database as the source of truth. A scheduled
GmsgFunction-style dump into a SQL table or a structured file gives you an immutable record that does not depend on the print pipeline. - Use a dedicated printer. Network printers with PostScript and bidirectional status updates are the most reliable; generic GDI/direct printers tend to drop pages under burst load.
-
Trigger the daily report two minutes after midnight, not at 23:59. This guarantees that the To-time range of the report (
23:59:59.999) is fully written to the archive and the next day's From boundary does not collide. - Set the cyclic action's Error handling to Stop on error during commissioning, and to Continue on error for production. This avoids stopping the Runtime on a single failed print, while still surfacing issues during FAT.
-
Document the print job name in the project README. Operations staff will need the exact
szPrintJobstring to re-trigger reports from the WinCC Alarm Control right-click menu. -
Verify against the system's local time zone.
GetLocalTimereturns the WinCC server's local time, not UTC. If the plant uses a UTC-shifted time zone, align the cyclic trigger to UTC explicitly to avoid day-boundary drift in monthly reports.
Troubleshooting Matrix
| Symptom | Likely Cause | First Check | Fix |
|---|---|---|---|
| Exactly 32 pages, no error | Default layout + 1024-frame buffer | Layout row count per page | Reduce row height; raise buffer to 8192. |
| Variable page count, sometimes truncated | Time range overlaps buffer flush | Update cycle setting | Set update cycle to 1000 ms; absolute time range. |
| Empty report, header only | Wrong print job name | Reports editor job list | Match szPrintJob to the configured job name. |
| Print job never fires | Global Script Runtime disabled | Computer > Properties > Startup | Enable Global Script Runtime. |
| Spooler error on long monthly report | Printer driver timeout | Windows print queue | Switch to file-based dump + scheduled print. |
| Garbled multi-byte text | Code page mismatch on layout | Layout font code page | Set code page to system locale; use Unicode-aware printer. |
| Page count correct, but alarms out of order | Multiple message sequences active | Alarm Logging > Message classes | Consolidate into a single message sequence; sort by event timestamp. |
Frequently Asked Questions
Why does my WinCC daily alarm report always stop at 32 pages?
The default Alarm Message Table layout fits roughly 32 pages worth of frames into the 1024-frame message sequence buffer. To print more, either reduce the rows-per-page on the layout (e.g. row height 0.4 cm) or raise the Alarm Logging archive buffer to 8192 frames under Alarm Logging > Properties > Archive.
Can I print alarms on a schedule without using the manual Print button?
Yes. Create a cyclic global script C-action that calls RPTJobPrint("JobName", "PageName", 0) with a 24 h, 7 d, or monthly trigger. This commits the full buffer to the spooler; the manual Print button only loads a partial buffer and is not reliable for archival jobs.
What is GmsgFunction and when should I use it?
GmsgFunction is a WinCC C-API that writes the current message sequence to a text file, one record per line. Use it when the print path is unstable, when you need an immutable daily archive independent of the printer, or as a diagnostic to compare line counts against the printed page count.
How do I find the official Siemens documentation for printing alarms in WinCC RT Professional?
See Printing Alarms in Runtime (RT Professional) in the TIA Portal V20 Cloud Help. For WinCC V7.x, the same topic is documented in the WinCC Information System under Working with WinCC > Alarm Logging > Printing Alarms.
Do I need to print on the WinCC server, or can a client station print the full report?
You can print from a client, but the project must be configured with Server-Prefetch enabled in the Alarm Logging editor so that the client has read access to the full message sequence buffer. Otherwise the client only sees the locally cached frames and the same 32-page symptom reappears.