WinCC Flexible 2008: Organizing Discrete Alarms into Sub-Folders
WinCC flexible 2008 SP3 remains a deployed runtime on thousands of OP/TP/MP panels. Engineers who import several hundred discrete alarms via the CSV import wizard discover three hard limits of the editor: the wizard never asks for a target sub-folder, multi-row drag-and-drop is rejected in the alarm tree, and the Group column of the CSV is metadata only - it does not create folders. This guide documents the three field-proven procedures to move discrete alarms into sub-folders, exposes the exact CSV column contract, maps the legacy behavior to the TIA Portal V20 discrete-alarm schema, and ties the result back to the OPC UA Part 9 alarm-type model so the same data structures survive an OPC UA upgrade.
Problem Definition
When WinCC flexible 2008 SP3 imports a discrete-alarm CSV, the engineering tool appends every record to the alarm class that is currently expanded in the project tree. The Import/Export wizard has no "Target folder" field. The Group column in the CSV does not create sub-folders and is purely a runtime filter attribute. After the import, hundreds of records pile up under the root "Discrete alarms" node.
The standard Windows multi-row drag gesture is rejected inside the alarm list. The only selection-aware operations are SHIFT+click (range) and CTRL+click (additive), followed by right-click Copy and Paste. Engineers who try to use Ctrl+A without first clicking into the list view find that the selection never anchors and the operation silently fails.
The same problem returns during STEP 7 / TIA Portal V20 migration. The discrete-alarm file format changed from ANSI/UTF-8 CSV (WinCC flexible) to Microsoft Excel XLSX (TIA Portal), the number of supported columns grew, and the placeholder-overwrite trick that works in WinCC flexible is unavailable because TIA Portal matches on a compound (number, instance-DB) key. Engineers who do not plan the target folder structure up front must re-import after every project reorganization.
Prerequisites
- WinCC flexible 2008 SP3 installed on a Windows XP SP3, Windows 7, or Windows Server 2008 R2 host with the latest hotfix rollup applied.
- A STEP 7 V5.4+ or WinCC flexible stand-alone project with the HMI device inserted in the device tree and online/offline compilation working.
- Discrete tags defined in the PLC program and exposed to the HMI tag database. For SIMATIC S7-300/400 use DB / MW / I / Q areas; for S7-1200/1500 use symbolic PLC tags mapped into the HMI tag list.
- Alarm classes configured under "HMI alarms → Classes" - typically "Errors", "Warnings", "System".
- Microsoft Excel 2003 or later (only required for the TIA Portal V20 XLSX import; WinCC flexible 2008 accepts ANSI or UTF-8 CSV).
- User rights: project editor or higher on the WinCC flexible project file (
*.hmi).
Alarm Tree Architecture in WinCC Flexible 2008
WinCC flexible distinguishes two orthogonal concepts: alarm classes and alarm folders. An alarm class is a runtime behavior template (color, sound, acknowledgement requirement, logging). A folder is an editor-time grouping that the operator never sees directly - it shows up in the alarm view only if the view's "Path" column is enabled. The folder structure lives in the *.hmi file as a tree of GUIDs, not as a separate database.
| Concept | Created where | Visible to operator | Purpose |
|---|---|---|---|
| Alarm class | HMI alarms → Classes | Yes (color, icon) | Defines acknowledge behavior, logging, prioritization |
| Alarm folder (sub-folder) | Right-click in alarm tree → New folder | Only if path column enabled | Editor-time grouping for engineering |
| Alarm group (CSV column) | CSV Group field | Yes (filter attribute) | Runtime grouping for operator view filtering |
| Alarm number | CSV Number field | Yes (status bar) | Unique identifier, project-wide |
The folder is the only mechanism the editor uses to keep CPU-specific alarms out of each other's view during engineering. The runtime alarm group is orthogonal: a folder can hold alarms from many groups, and a group can have alarms in many folders.
CSV File Structure for Discrete Alarms in WinCC Flexible 2008
Each line of the CSV is one alarm record. The first line is the header. The column separator is the configured Windows list separator (semicolon on most German locales, comma on most English locales). Quotation marks are required for any field containing the separator character, the quote character, or a newline. WinCC flexible reads the file as ANSI by default; for non-ASCII characters in alarm text, save as UTF-8 with BOM.
| Column | Required | Data type | Description | Example |
|---|---|---|---|---|
| Number | Yes | Integer 1-65535 | Unique alarm number, project-wide | 1001 |
| Text | Yes | String up to 255 chars | Alarm text, supports tag placeholders | "Motor %d overload" |
| Trigger tag | Yes | HMI tag name | PLC tag exposed to HMI | DB1_DBW0[0] |
| Trigger bit | Yes | Integer 0-15 | Bit position within trigger word | 3 |
| Acknowledgement | Yes | yes / no | Operator must acknowledge | no |
| Class | Yes | String | Alarm class name from project | Errors |
| Group | No | String | Runtime filter attribute, NOT a folder | CPU1 |
| Info text | No | String up to 255 chars | Operator tooltip / hover text | "Check drive section 2" |
| Coming | No | String | Single character coming-event state | C |
| Going | No | String | Single character going-event state | G |
| Ack | No | String | Single character ack-event state | A |
A minimal three-record CSV that imports cleanly looks like this (English locale, comma separator):
Number,Text,Trigger tag,Trigger bit,Acknowledgement,Class,Group
1001,"Motor 1 overload",DB1_DBW0,3,no,Errors,CPU1
1002,"Motor 2 overload",DB1_DBW0,4,no,Errors,CPU1
2001,"Coolant low",DB2_DBW2,0,yes,Warnings,CPU2
Solution 1 - Multi-Select Copy and Paste Within the Alarm Tree
The fastest method for reorganizing an existing project that already has all alarms in the root folder.
- In the project tree, expand "HMI alarms → Discrete alarms" (or whichever class the records sit under).
- Click an empty area of the alarm list view to anchor keyboard focus to the list control.
- Click the first alarm row. Hold SHIFT and click the last alarm row. The entire range is highlighted in blue.
- For non-contiguous selection (skip a row), hold CTRL and click each additional row.
- Right-click the selection. The context menu opens with at minimum: Cut, Copy, Paste, Delete, Properties.
- Click Copy. The selection is placed on the Windows clipboard as a multi-record alarm structure (not as plain text).
- Right-click the target sub-folder in the tree and choose Paste. WinCC flexible inserts the records into the new folder with the original numbers, texts, classes, and trigger tags intact.
- Verify that the source folder still contains the originals. To remove them, select the source range, right-click Delete. WinCC flexible warns if any alarm is referenced by a screen object, script, or scheduled task.
Solution 2 - Pre-Create Placeholder Alarms in Each Sub-Folder
Recommended when the goal is to import one CSV per CPU or per plant area and have the records land in the correct sub-folder without manual copy/paste.
- Create the target sub-folders under "Discrete alarms". For a three-CPU project, name them
CPU1_Alarms,CPU2_Alarms,CPU3_Alarms. - Click into
CPU1_Alarms. In the alarm list, add one placeholder alarm with Number =1001, Text =(placeholder), Trigger tag = any valid tag, Trigger bit = 0, Class =Errors. - Repeat for
CPU2_Alarmswith Number2001and forCPU3_Alarmswith Number3001. The numbers must be unique project-wide and should reserve a range per CPU (see Numbering Strategy below). - Export the alarm tree to CSV: Project → Import/Export → Export → Alarms → CSV. The exported file lists the placeholder rows with the correct Group column values.
- Open the exported CSV in Excel. Append your real alarm records. Use the placeholder Number as the first record of each CPU group, and match the Group column to the sub-folder name.
- Re-import the CSV: Project → Import/Export → Import → Alarms → CSV.
- On import, WinCC flexible matches each imported record by Number against the existing project. Records whose Number matches an existing alarm overwrite the existing record in place - the new data is written into the same folder as the placeholder.
- Records with a new Number (no match in the project) are appended to the folder that was selected in the tree at the moment the wizard was invoked. To force a new record into a sub-folder, click the sub-folder first, then start the import.
Solution 3 - One CSV Per Sub-Folder, Sequential Import
For projects that are clearly partitioned by PLC CPU, the cleanest workflow is to author one CSV per sub-folder and import them in sequence.
- Click the target sub-folder (e.g.,
CPU1_Alarms) in the alarm tree before invoking the import wizard. The wizard writes new alarms into the currently selected folder - this is the only folder-selection mechanism the wizard provides. - Open the import wizard: Project → Import/Export → Import → Alarms → CSV.
- Browse to
CPU1_alarms.csv. Click Open. - In the column-mapping dialog, verify the mapping. The default mapping is correct for CSVs exported from WinCC flexible, but for hand-authored files confirm that Number maps to the project field Number, Text to Text, and so on. The Trigger tag column must use the HMI tag name (e.g.,
DB1_DBW0), not the PLC symbolic name. - Click Import. The records appear in the
CPU1_Alarmssub-folder. - Repeat for
CPU2_AlarmsandCPU3_Alarms, clicking the corresponding sub-folder before each import. The column-mapping dialog remembers the last mapping for the session.
This method is robust but does not scale beyond 10-15 sub-folders because the engineer must manually navigate the tree between imports. For projects with more than 50 sub-folders, script the CSV edits in Python or PowerShell, generate one file per sub-folder, and drive WinCC flexible via the EsimationObject COM interface exposed by the engineering tool.
Numbering Strategy to Avoid Collisions
WinCC flexible 2008 SP3 requires unique alarm numbers project-wide, even across sub-folders and across alarm classes. Two records with the same Number are flagged at compile time with error 1301: "Alarm number already in use". Reserve number ranges per CPU and per class up front.
| Sub-folder | Error range | Warning range | System range | Trigger tag bank |
|---|---|---|---|---|
| CPU1_Alarms | 1000 - 1999 | 11000 - 11999 | 21000 - 21999 | DB1.DBW0..DB1.DBW15 |
| CPU2_Alarms | 2000 - 2999 | 12000 - 12999 | 22000 - 22999 | DB2.DBW0..DB2.DBW15 |
| CPU3_Alarms | 3000 - 3999 | 13000 - 13999 | 23000 - 23999 | DB3.DBW0..DB3.DBW15 |
| Common | 9000 - 9999 | 19000 - 19999 | 29000 - 29999 | DB10.DBW0..DB10.DBW15 |
Each trigger word holds 16 bits (1 alarm per bit). With 16 alarm words per CPU the bank supports 16 x 16 = 256 discrete alarms per sub-folder. If the project needs more, expand the word index (DBW0, DBW2, DBW4, ...) for higher counts. Avoid the range 0-999 - WinCC flexible reserves a small set of system numbers below 1000 for internal use (e.g., connection-loss events).
PLC Trigger Tag Configuration for Multi-CPU Projects
On SIMATIC S7-300/400 the trigger tag is a word from a data block: DB1.DBW0 (absolute addressing) or "DB1"."AlarmWord0" (symbolic, when the DB has a name and the symbol table is loaded). On S7-1200/1500 the HMI tag must be symbolic: "DB_Motor"."AlarmWord0" with bit access at the HMI level by entering the bit number in the alarm's Trigger bit column.
| PLC family | Trigger tag syntax in CSV | Bit reference | HMI tag creation |
|---|---|---|---|
| S7-300/400 |
DB1_DBW0 or DB1.DBW0
|
Trigger bit column 0-15 | Absolute or symbolic |
| S7-1200/1500 | "DB_Motor"."AlarmWord0" |
Trigger bit column 0-15 | Symbolic only |
| LOGO! | VW0 |
Trigger bit column 0-15 | Absolute |
| Third-party (Modbus TCP) |
HR0 or 400001
|
Trigger bit column 0-15 | Modbus area definition |
The PLC program must set the bit when the alarm condition is true and clear it when the condition is gone. WinCC flexible samples the bit on the configured acquisition cycle (default 1 s, configurable down to 250 ms). The status transition triggers a "Coming" event; clearing the bit triggers a "Going" event. If the bit is set faster than the acquisition cycle, the alarm is missed - increase the cycle or use edge-triggered alarms (WinCC flexible 2008 SP3 supports edge detection for digital tags only).
Multi-Language Alarm Text
WinCC flexible 2008 supports per-alarm text in up to 32 runtime languages. The CSV import is single-language: the Text column is written to the currently active editing language. To add translations, either use the in-editor translation table (HMI alarms → Languages → Edit translations) or maintain one CSV per language and re-import sequentially while switching the editing language between imports.
%d for integer values, %f for floating point, and %s for strings. The token expands at runtime with the value of the trigger tag's parent word. Example: alarm text "Motor %d current" with trigger tag DB1_DBW0 renders as "Motor 12 current" when DB1.DBW0 = 12.Performance and Limits
WinCC flexible 2008 SP3 has a project-wide limit of 4,000 discrete alarms per HMI device. On OP 77B, TP 177, and the older OP 73 the practical limit is lower because of the panel's memory; 2,000 alarms is the safe upper bound for these panels. Comfort Panels and the WinCC flexible Runtime support the full 4,000.
Import performance: the CSV import is single-threaded and writes one record per database transaction. A 1,000-alarm import takes 8-15 seconds on a Windows 7 host with SSD storage. For imports larger than 2,000 records, split the CSV into chunks of 500 and import sequentially to keep the editor responsive.
Folder depth is limited to 8 levels. Sub-folders deeper than 8 are not supported and the editor will display a warning at compile time.
Migration to TIA Portal V20
WinCC flexible 2008 SP3 reached the end of its product life cycle and is no longer supported for new projects. New designs should be created in TIA Portal V20, where the discrete-alarm import format is XLSX (Microsoft Excel workbook) rather than CSV. The TIA Portal V20 documentation specifies the required columns in the discrete-alarm import file for Basic Panels, Panels, Comfort Panels, and the WinCC RT Advanced / RT Professional runtimes.
| TIA Portal V20 column | WinCC flexible 2008 equivalent | Notes |
|---|---|---|
| Alarm number | Number | Compound key with instance DB in TIA |
| Alarm text (per language worksheet) | Text | One worksheet per runtime language, named by locale |
| Trigger tag | Trigger tag | Must be symbolic PLC tag name, not absolute address |
| Trigger bit | Trigger bit | 0-7 for byte, 0-15 for word |
| Acknowledgement | Acknowledgement | Boolean, not yes/no string |
| Alarm class | Class | Class must be defined in TIA project |
| Priority | (no equivalent) | TIA-only: 0-16, used for sort order in alarm view |
| Group | Group | Optional; runtime filter, NOT a folder |
To convert a WinCC flexible CSV to a TIA Portal V20 XLSX:
- Open the CSV in Excel, save as
.xlsx. - Add a new worksheet named after the active runtime language (e.g.,
en_US). Copy the alarm rows into it. - Rename the header row to match the TIA Portal V20 column names exactly. TIA Portal is case-sensitive on column names: Alarm number is rejected, Alarm Number is rejected, only Alarm number with the exact TIA spelling passes.
- Replace any
DB1_DBW0trigger tag with the symbolic PLC tag, e.g.,"DB_Motor"."AlarmWord0". - Import via HMI alarms → Import/Export → Import alarms. TIA Portal V20 inserts the records into the alarm class selected in the tree before the import. There is no Group-column-to-folder mapping; the sub-folder must pre-exist and be selected.
OPC UA Part 9 Discrete Alarm Mapping
When the HMI runtime is upgraded to a TIA Portal version that exposes alarms via OPC UA, the discrete alarm concept maps to the OPC UA Part 9 - Alarms and Conditions, Section 5.8.24 (DiscreteAlarmType). The discrete alarm subtype is a Condition with a single input value, where the active state is the condition being in an alarmed (non-normal) value. Each WinCC flexible alarm record becomes one UA Event of type DiscreteAlarmType. The sub-folder structure in WinCC flexible maps to the Source node hierarchy in the OPC UA address space, not to the ConditionId, so the source path is preserved across OPC UA subscribers and external SCADA can re-create the same folder view at runtime.
Key OPC UA Part 9 fields the engineering team should align during migration:
| OPC UA Part 9 field | WinCC flexible field | Mapping notes |
|---|---|---|
| ConditionId | Number | Must be globally unique; prefix with project ID for OPC UA |
| SourceName | (derived from PLC tag) | OPC UA server builds from PLC symbol + bit |
| SourcePath | Sub-folder path | Multi-level path separated by '/' |
| EventId | Number (legacy) | OPC UA standard event IDs are 16-byte GUIDs |
| Message | Text | Localized via the OPC UA LocaleId |
| Severity | Class | 1-1000, mapped from WinCC flexible class priority |
Verification
After reorganization, validate the alarm tree with the following procedure before downloading to the panel or running the RT simulation.
- Open the HMI device's Alarms editor. Confirm that the sub-folders appear under "Discrete alarms" with the expected alarm counts.
- Compile the project: Project → Compiler → All. Zero errors and zero warnings should be reported. Warning 1301 ("Alarm number already in use") indicates a Number collision across folders.
- Download to the panel or start the WinCC flexible RT simulation. Trigger one alarm in each sub-folder and confirm the alarm view groups the records correctly. Verify the acknowledgement and going transitions appear in the alarm log.
- Export the alarm tree to CSV a second time: Project → Import/Export → Export → Alarms → CSV. Compare against the source CSV with a diff tool (WinMerge, Beyond Compare). The only differences should be column ordering, the addition of internal WinCC flexible fields, and the Group column values per sub-folder.
- In the Cross-references view (Tools → Cross-references), confirm that no screens, scripts, or scheduled tasks still reference the old alarm numbers. Any unresolved cross-reference blocks the download with error 3001.
- On multi-HMI projects, run the "Consistency check" from the project tree root. This catches cases where a sub-folder exists on one HMI device but not on its peer, which would cause runtime filter mismatches on shared alarms.
Troubleshooting Matrix
| Symptom | Root cause | Resolution |
|---|---|---|
| Error 1301 "Alarm number already in use" on import | CSV row matches an existing alarm in any folder | Pre-delete the conflicting alarm or change the Number column; reserve per-CPU number ranges |
| Import succeeds but records appear in root folder | Root folder was selected in the tree before invoking the wizard | Click the target sub-folder first, then re-import |
| Multi-select in alarm list does not work | Keyboard focus is on the tree control, not the list | Click an empty area of the alarm list to set focus, then SHIFT+click the last row |
| Drag-and-drop multi-row move is silently rejected | The OLE list control does not implement IDropTarget | Use the clipboard path: Copy → select target → Paste |
| Trigger bit column shows # after import | Trigger bit is non-integer (e.g., text "3") | Edit CSV: ensure column has 0-15 as integer with no surrounding text |
| Alarm text shows %d but no value on runtime | Tag placeholder syntax does not match the trigger tag data type | Use %d for INT, %f for REAL, %s for STRING |
| CSV import wizard greyed out | Project not compiled or HMI device not in project tree | Add the HMI device or run a full compile before invoking the wizard |
| Placeholder alarm not overwritten on re-import | Number in CSV does not exactly match the placeholder | Compare Numbers character-by-character; WinCC flexible requires exact integer match |
| Group column is missing from imported file | CSV was exported from a build that pre-dates the Group column | Manually add the Group column to the CSV and re-map it in the wizard |
| Folder disappears after compile | Folder is empty and the editor auto-prunes on compile | Add at least one placeholder alarm or enable the editor setting "Keep empty folders" |
| Cross-reference broken after move | Screen object references the old alarm Number, which now lives in a different folder | Update the screen object's alarm reference; cross-references are Number-based, not folder-based |
| Compile warning 1100 "Number range exhausted" | Project has more than 4,000 discrete alarms | Split the project across two HMI devices or reduce alarm count by using analog threshold alarms |
Field Commissioning Checklist
- Pre-import: confirm that all PLC trigger tags exist in the HMI tag database and that the bit access has been tested with the tag simulator in STEP 7.
- Sub-folder structure: create the target sub-folders in the alarm tree before the first CSV import. Document the naming convention in the project README.
- Number range reservation: write the per-CPU number allocation into a project-wide header comment in the CSV file.
- First import: import a small test CSV (10 records) into a test sub-folder, compile, and download to confirm the workflow.
- Bulk import: run the full CSV import. Record the start and end timestamps to track performance.
- Compile: zero errors, zero warnings. Resolve any 1301 / 1100 messages before continuing.
- Cross-references: open the cross-reference view and verify that all alarm numbers are referenced by at most one screen object (or none, for purely logged alarms).
- Runtime simulation: trigger one alarm in each sub-folder. Verify the operator screen displays the correct text, group filter, and folder path.
- Language check: switch the runtime language to each configured locale and verify the alarm text is translated.
- Backup: save a copy of the post-import
*.hmifile under version control (Git, SVN) with a tag indicating the alarm numbers and folder structure frozen.
FAQ
How do I bulk-move discrete alarms from the root folder to a sub-folder in WinCC flexible 2008 SP3?
Click the first alarm row, hold SHIFT, click the last alarm row to highlight the range, right-click and choose Copy, then right-click the target sub-folder in the tree and choose Paste. The Ctrl+A shortcut also works inside the alarm list, but only if the list has keyboard focus; click an empty area of the list to set focus first.
Can the CSV import wizard target a sub-folder directly?
No. The wizard has no folder picker. The records are inserted into the folder that is currently selected in the alarm tree at the moment the wizard is invoked. Click the target sub-folder first, then start the import, and the new records land in that sub-folder.
Why are all imported records landing in the root folder after I specified "CPU1" in the Group column?
The Group column is metadata only and is used at runtime for operator-view filtering. WinCC flexible does not create sub-folders from the CSV. The folder must exist in the alarm tree before the import, and the import must be invoked while the target sub-folder is selected. Once the records are in the sub-folder, the Group column can be edited per record if needed.
What is the maximum number of discrete alarms per sub-folder in WinCC flexible 2008 SP3?
WinCC flexible 2008 SP3 supports up to 4,000 discrete alarms per HMI device, distributed across an unlimited number of sub-folders. The per-CPU limit is governed by the trigger-tag word depth, not by the alarm editor: each 16-bit DBW supports 16 alarms, so 256 alarm words per PLC allow 4,096 alarms. On OP 77B, TP 177, and OP 73 panels, keep the total under 2,000 to stay within the runtime memory budget.
How do I migrate WinCC flexible 2008 SP3 alarm CSV files to TIA Portal V20?
Open the CSV in Excel, save as XLSX, add a worksheet per runtime language, rename the header row to match the TIA Portal V20 column names exactly (case-sensitive), replace any fully-qualified tag names with symbolic PLC names, and use HMI alarms → Import/Export → Import alarms. TIA Portal V20 imports XLSX, not CSV, and inserts records into the alarm class selected in the tree before the import.
Do sub-folders in WinCC flexible 2008 SP3 affect the runtime behavior of the HMI?
No. Sub-folders are an editor-time grouping mechanism. The operator never sees the folder structure unless the alarm view has the "Path" column enabled. Runtime filtering uses the Group column or the alarm class, both of which are independent of the sub-folder. The sub-folder is purely a productivity feature for the engineering team.