Overview
WinCC Flexible supports bulk import and export of discrete (bit-triggered) and analog (limit-value) alarms through a structured text interchange format that can be opened, edited, and saved with Microsoft Excel. This capability is essential when configuring large HMI message systems containing several hundred to several thousand alarms: manual entry through the editor is impractical, error-prone, and prevents engineering teams from maintaining alarms in a version-controlled spreadsheet that is also readable by maintenance and process engineers who do not have WinCC Flexible installed.
The alarm import/export engine is the same module that powers tag list import/export, and the procedure is symmetric: engineers create a working template by performing one initial export, then build out the full message database in Excel before re-importing. This article documents the canonical workflow, the file structure, the parser rules, the silent-failure modes, and the migration path to TIA Portal (WinCC Comfort/Advanced) for projects that have moved past the WinCC Flexible lifecycle.
Prerequisites
Before beginning the import workflow, confirm the following:
- WinCC Flexible 2008 SP5 (or 2008 SP2/SP3/SP4) installed with a valid license key
- Microsoft Excel 2003/2007/2010/2013 (32-bit recommended for COM automation compatibility; WinCC Flexible 2008 was built against Office 2007 COM libraries)
- HMI project (.hmi) with at least one configured alarm class and one configured trigger tag
- Read/write access to the project source directory and to the
\messagessubfolder - Knowledge of the message number range (default 1 to 500,000; per-area ranges are configured under Project > Messages > Number Ranges)
- Local administrator rights if importing on Windows Vista or Windows 7 (UAC virtualisation otherwise redirects the import target to a writable profile copy)
Understanding the Alarm File Structure
The export generates a CSV file with a fixed column order. Column header language depends on the WinCC Flexible editor language; the file always contains one column per alarm attribute and one row per alarm. The canonical German column set (which the parser uses as the internal canonical form) is shown below; English editions map the same attributes to English column names.
| Column | Attribute | Type | Notes |
|---|---|---|---|
| 1 | Nummer / Number | Integer | Unique message number within the active number range. Must be numeric only — comment rows break the parser. |
| 2 | Klasse / Class | String | Alarm class name (e.g. Error, Warning, System). Must match a class defined in the project. |
| 3 | Trigger / Auslöser | String | Trigger tag symbolic name (HMI tag). Must exist in the tag database. |
| 4 | Trigger-Bit / Auslöserbit | Integer | Bit position 0–31 of the trigger word. 0xFFFF for whole-tag trigger. |
| 5 | Quittierung / Acknowledge | Integer | 0 = no acknowledgment required, 1 = acknowledgment required, 2 = acknowledgment by PLC required. |
| 6 | Gruppe / Group | String | Display group in the alarm view. Up to 4 groups per alarm. |
| 7 | Text / Meldetext | String | Message text shown in the alarm line. Supports tag-field placeholders such as %s or %%<tagname>%%. |
| 8 | Info-Text | String | Optional tooltip / help text shown on selection. |
| 9 | Quittiervariable PLC | String | PLC tag used for write-back acknowledgment (only valid for value 2 in column 5). |
| 10 | Bereich / Area | String | Number range / area assignment. |
The field separator is locale-dependent: WinCC Flexible 2008 generates a semicolon-delimited file on German/European installations and a comma-delimited file on English/US installations. After saving from Excel, the import engine uses the column header row to identify fields and is tolerant of either separator. The file encoding is Windows-1252 unless the project has been switched to UTF-8 under the editor options — alarms containing characters outside the Latin-1 range will be silently truncated in the Windows-1252 case.
Step-by-Step Procedure
Step 1 — Create the Template via Initial Export
Open the WinCC Flexible project, right-click Messages in the project tree, and select Export > Messages. The editor enforces the rule that at least one alarm must exist; create a single dummy alarm (class Error, trigger HMI_Tag_1, text template) before exporting. The export writes messages.csv (or messages.txt) into the project folder. This file is the structural template that defines column order, separator, and header language for the round-trip.
Step 2 — Open and Edit in Excel
Double-click the exported file. Excel launches and applies the Text Import Wizard. Accept the proposed delimiter (semicolon or comma, depending on locale) and mark the first column as Text so message numbers are not coerced to scientific notation (e.g. 1000000 becoming 1E+06). Save the file in CSV (Comma Delimited) or CSV (MS-DOS) format; Unicode CSV (UTF-8) is supported in WinCC Flexible 2008 SP3 and later.
Step 3 — Populate the Alarm Database
For each alarm entry, fill in at minimum columns 1, 2, 3, and 7. Recommended practices:
- Use
CONCATENATEor string templates to assemble message text with tag placeholders, e.g.="Motor " & %%<MotorName>%% & " overload" - Maintain a separate sheet with alarm-class definitions so the class column can be validated via
VLOOKUP - Use Excel data validation (list) on the class column to prevent typos that would orphan the alarm at import time
- Reserve number range 900,000–999,999 for system / diagnostic messages to keep them separate from process alarms
Step 4 — Clean the File Before Import
Before re-importing, perform a final pass to remove any rows that are not valid alarm records. The WinCC Flexible CSV parser is strict: any row whose first column is non-numeric, blank, or contains a comment delimiter (//, #, ;) terminates the parse with a generic error such as "Invalid line at row N" and aborts the entire import — no partial rollback is performed. A documented field failure is the case where engineers leave header or note rows beginning with // as personal working comments. Excel treats these as ordinary text and saves them to CSV without warning, but the parser rejects them. The fix is to delete every row whose first cell does not contain a positive integer message number.
Step 5 — Import the File
Return to WinCC Flexible, right-click Messages, and select Import > Messages. Browse to the edited CSV, confirm the dialog, and watch the status bar. On success, the messages appear in the editor grouped by class. On failure, the dialog reports the offending line number; open the CSV in Notepad, navigate to that line, and inspect column 1.
Step 6 — Verify the Import
Use the WinCC Flexible compiler (Project > Compiler > All) to regenerate the runtime database. Open the alarm view on the panel or in the RT simulation, force each trigger tag, and confirm the message text and acknowledgment behavior. Spot-check at least 5% of imported alarms.
Tag Import/Export Synergy
The same import/export engine handles the HMI tag database. Engineers typically maintain a single Excel workbook with three sheets: Tags, Alarms, and Classes. The Tags sheet uses the standard Name, PLC, Datatype, Length, Address, AccessMethod, Comment structure and is exported via Project > Communication > Tags > Export. Importing tags first ensures that the symbolic names referenced in the alarm Trigger column exist before the alarm import runs; otherwise alarms will be created with a broken tag reference and will show "<Unknown Tag>" at runtime.
| Object | Export Location | Import Menu Path | File Type |
|---|---|---|---|
| HMI Tags | Communication > Tags > right-click > Export | Communication > Tags > right-click > Import | CSV (semicolon) |
| Discrete Alarms | Messages > right-click > Export | Messages > right-click > Import | CSV (semicolon/comma) |
| Analog Alarms | Messages > right-click > Export (combined file) | Messages > right-click > Import | CSV (semicolon/comma) |
| Text Lists | Text and Graphics Lists > Export | Text and Graphics Lists > Import | CSV |
Common Errors and Parser Diagnostics
| Symptom | Root Cause | Fix |
|---|---|---|
| "Invalid line at row N" on import | Comment row, blank row, or non-numeric first cell | Delete every non-numeric row; ensure first cell is a positive integer |
| Imported alarms show no trigger at runtime | Trigger tag name in CSV does not match any HMI tag (case-sensitive) | Export tags first, validate with VLOOKUP, then import |
| Truncated message text or garbled characters | File saved as UTF-8 but editor expects Windows-1252, or vice versa | Match encoding in Tools > Options > General > Save as |
| Message numbers converted to scientific notation | Excel auto-formatted column as number | Re-import as text: Data > Text to Columns > mark column as Text |
| Alarm class shows as "Unknown" in the alarm view | Class string in CSV does not match any configured class (including locale) | Match the class name exactly, including accents (Error vs Erreur vs Fehler) |
| Import succeeds but compiler reports duplicate message numbers | Two rows with the same first-cell integer | Sort and de-duplicate by column 1 before import |
| Import appears to succeed but alarm list is empty | Wrong number range — rows were silently filtered | Check Project > Messages > Number Ranges and remap |
Working with Large Alarm Sets (500+ Entries)
For projects where the alarm database exceeds 500 entries, follow these performance and integrity rules:
- Split the workbook into one sheet per alarm class (Errors, Warnings, System). Each class becomes a separate CSV export/import cycle, reducing the blast radius of a single parser failure.
- Use Excel named ranges for the trigger tag list to enable data validation dropdowns on the Trigger column.
- Pre-allocate the number range in contiguous blocks of 1000 to simplify maintenance and make orphaned-number scans trivial.
- Use the WinCC Flexible Cross Reference tool after import to verify that every alarm trigger tag is actually used somewhere in the project. Untriggered alarms waste PLC connection bandwidth.
- For audit trails, save the Excel workbook into the project source folder as
alarms_master.xlsxand reference its path in the project documentation. This keeps the alarm database under version control alongside the.hmifile.
Migration Path: WinCC Flexible to TIA Portal (WinCC Comfort/Advanced)
Projects originally configured in WinCC Flexible can be migrated to TIA Portal V13 SP1 or later using Siemens Automation > Migration Tool or the integrated Project > Migrate project command. The migration brings across tags, alarms, and screens. The CSV-based alarm database workflow is preserved in TIA Portal under Project tree > HMI > Screens & items > HMI alarms > Export/Import with the same column structure but updated header strings. Engineers maintaining both legacy and new TIA projects can keep a single Excel workbook and re-import into either system, provided the column headers are reconciled. Siemens KB entry "How can you create messages with externally preset texts as mass data and process them with Excel in WinCC Flexible?" documents the legacy workflow and remains the canonical reference for WinCC Flexible 2008 SP5 installations.
For new projects starting today, use TIA Portal V18 or V19 with WinCC Comfort/Advanced. The TIA Portal Help: "Importing and exporting HMI tags" and the parallel Importing and exporting alarms page cover the modern equivalent and support XLSX directly without a CSV intermediate.
Verification Checklist
Before signing off an alarm import, confirm each item:
- [ ] WinCC Flexible compiler reports zero errors and zero warnings
- [ ] Cross Reference shows every imported alarm has at least one trigger tag reference
- [ ] Alarm class count in the editor matches the distinct Class values in the CSV
- [ ] RT simulation: force each of 10 randomly chosen trigger tags and verify the message text, class colour, and acknowledgment state
- [ ] File
alarms_master.xlsxis checked into the project source repository - [ ] Round-trip test: re-export the imported alarms, diff against the input file, and resolve any drift (typically caused by Excel dropping trailing whitespace or coercing numeric formats)
FAQ
Can WinCC Flexible 2008 import alarms directly from a native .xlsx file?
No. The WinCC Flexible 2008 import engine reads CSV (comma- or semicolon-delimited) or tab-delimited text files. Save the Excel workbook to CSV (Comma delimited) (*.csv) in Excel 2010/2013 or to CSV (MS-DOS) (*.csv) in Excel 2007 before importing. XLSX direct import was added in TIA Portal WinCC Comfort/Advanced V14 SP1 and later.
Why does my import fail with "Invalid line at row N" when the first cell looks like a valid number?
Excel often prepends a UTF-8 BOM or a non-breaking space to the first cell of a CSV saved from a German locale, or it converts long integers (6+ digits) to scientific notation such as 1E+06. Re-import the CSV via Data > From Text/CSV in Excel, mark the first column as Text, and re-save. The parser requires a pure ASCII positive integer with no exponent, no decimal point, and no thousands separator.
How do I prevent my personal comment rows (// notes) from breaking the import?
Delete them. The WinCC Flexible CSV parser does not support comment rows of any kind. Use a separate notes sheet inside the same Excel workbook (which the parser never sees) to keep your working comments. The official Siemens FAQ also notes that any cell containing ; in a semicolon-delimited file or , in a comma-delimited file must be quoted or removed.
What is the maximum number of alarms supported in WinCC Flexible 2008 SP5?
Theoretical maximum is 500,000 discrete alarms per HMI device, defined across 16 configurable number ranges. Practical limits depend on panel class: the MP 277 supports 4,000 active alarms in the buffer, the MP 377 supports 8,000, and PC-based RT (WinCC Flexible Runtime) supports 8,000 by default, expandable to 32,000 with the appropriate license. Above 2,000 active alarms, compile time and alarm-view rendering degrade noticeably on TP/OP panels.
Can I automate the import from a script or command line?
WinCC Flexible 2008 does not expose a public command-line import API. The supported automation path is the WinCC Flexible ES COM interface (visible in Tools > Options > General > Activate API), which can be driven from VBScript or PowerShell. For new projects, TIA Portal exposes the Openness API (C#, VB.NET, Python via the TIA Openness Python wrapper) which supports scripted alarm import from XLSX and CSV; see the TIA Portal Openness documentation.