Problem Definition — Discrete Event Logging with Repeated Triggers
When a vending machine controller reads a coin acceptor over a parallel interface, each coin insertion must be archived as an independent row in the operator-visible event list. The default behaviour of a WinCC (TIA Portal) Alarm View is to display only the currently pending alarm state; if the same alarm text triggers repeatedly, the operator sees a single row whose timestamp updates on the most recent trigger — not a chronological list of every insertion. The same problem appears for any repeating process event that must be audited individually: coin insertions in vending, ticket validations in transit, part counts on a production line, or button presses on a service terminal.
This document describes the configuration required to produce a true FIFO event log of repeated alarms, including the use of text lists, discrete alarms, alarm buffers, alarm logs, and edge-triggered PLC pulse generation. It targets TP1200 Comfort, TP1500 Comfort, KTP1200 Basic, and KTP1500 Basic panels but applies to all SIMATIC HMI panels that support text lists (i.e., all TIA Portal panels from firmware V13 onward). It assumes an S7-1200 or S7-1500 PLC is in charge of reading the coin acceptor and exposing Boolean tags to the HMI.
Two phenomena commonly produce the "single row" symptom:
- The Alarm View is bound to the active-state filter (Pending alarms) rather than the alarm buffer.
- The PLC publishes a sticky level (the input stays TRUE as long as the coin is in the acceptor chute), so the HMI only sees one rising edge per inserted coin even though many coins are inserted.
Both are addressed below.
Prerequisites — TIA Portal, Panel, and PLC Requirements
- TIA Portal: V13 SP1 minimum. For text-list output fields inside alarms, V13 SP1 is sufficient. V14 SP1 is required for Basic Panel alarm buffer support. V16 or later is recommended for current firmware compatibility and TIA Portal Openness automation.
- SIMATIC HMI panel firmware: V13.0.1 or higher for Comfort Panels; V14.0.0 or higher for Basic Panels to access the alarm buffer view.
- PLC: S7-1200 (CPU 1211C, 1212C, 1214C, 1215C, 1217C) or S7-1500 (CPU 1511-1 PN through 1518-4 PN/DP). The HMI connection uses Ethernet (PROFINET) or — for legacy S7-1200 panels — MPI/PROFIBUS.
- Coin acceptor: any unit with parallel NPN or PNP outputs, one per denomination, with a minimum pulse width of 80–100 ms. Common interfaces are 4-channel (€0.05/€0.10/€0.20/€0.50) or 6-channel (adding €1 and €2). Power is typically 12 V DC or 24 V DC; some acceptors include a 24 V→12 V regulator on-board.
- PLC I/O: 4–6 fast 24 V digital inputs (DI) on the S7-1200/S7-1500, debounced in the PLC cycle if necessary.
- HMI tag database: one Bool pulse tag per denomination, or one Int denomination-index tag, exposed to the HMI via the PLC's HMI connection.
Alarm View, Alarm Log, and Alarm Buffer — Conceptual Differences
WinCC (TIA Portal) exposes three runtime entities that are frequently confused. The distinction is critical because only two of them will produce the requested "list of all alarms, even duplicates" behaviour:
| Entity | Storage location | Behaviour on duplicate trigger | Survives reboot? | Used for |
|---|---|---|---|---|
| Alarm View — Pending alarms | In-RAM only; not persisted | Replaces the prior row for that alarm; timestamp updated; no new row created | No | Operator situational awareness; "what is the current machine state?" |
| Alarm View — Alarm buffer | In-RAM circular buffer, last N events | Appends a new row on every trigger; chronological FIFO | No (unless logged to SD) | Visible recent-history list inside the Alarm View control |
| Alarm log (archive) | Persistent file (CSV or RDB) on HMI storage | Appends a new row on every trigger; chronological | Yes | Long-term audit trail, regulatory compliance, accounting |
The "single row that only updates the timestamp" behaviour is the default Alarm View in pending-alarms mode. To get a chronological list of every coin insertion, configure the Alarm View control to display the alarm buffer or the alarm log, and ensure the trigger is a rising-edge pulse, not a sticky level.
Text Lists — Dynamic Alarm Text Generation
A text list binds a numeric (Int, Word, Byte) or string tag value to a human-readable text. When inserted into an alarm text using the right-click command "Insert text list output field", the runtime substitutes the matched entry at the moment the alarm is raised. This is the documented mechanism for producing alarm messages such as "€0.05 has entered", "€0.10 has entered", and so on, from a single alarm definition driven by a tag index. See the official Output of texts from a text list in an alarm entry in the SIMATIC STEP 7 Basic manual for the exact keystroke sequence (function InsertTextListOutputField).
| Text list index (DBW / tag value) | Displayed alarm text | Use case |
|---|---|---|
| 0 | €0.05 has entered | 5-cent coin inserted |
| 1 | €0.10 has entered | 10-cent coin inserted |
| 2 | €0.20 has entered | 20-cent coin inserted |
| 3 | €0.50 has entered | 50-cent coin inserted |
| 4 | €1.00 has entered | 1-euro coin inserted |
| 5 | €2.00 has entered | 2-euro coin inserted |
Two design choices:
- One alarm per denomination: six discrete alarms, each with a static text and a single Boolean trigger tag. Simplest; one alarm per index.
- One alarm with text list: a single discrete alarm whose text contains a text-list output field, driven by an Int denomination-index tag. More compact; one alarm definition.
Both produce identical runtime behaviour in the alarm buffer. The second approach reduces engineering effort and centralises the message strings for translation, but requires the PLC to publish a denomination index rather than independent bits.
Parallel Interface Wiring to the PLC
A typical 6-channel coin-acceptor parallel interface exposes:
- V+ (12 V or 24 V supply)
- GND
- OUT1 … OUT6 (open-collector NPN or dry contact, one per denomination)
- INHIBIT (input from PLC to disable acceptance)
Wire each OUTx to a 24 V digital input on the S7-1200/S7-1500. If the acceptor is NPN (sinks current), connect OUTx to the DI terminal and rely on the S7 input's built-in pull-up. If the acceptor uses dry contacts, wire the contacts between the DI terminal and 24 V. Provide a 100 ms input filter in the PLC hardware configuration to suppress contact bounce; this is in addition to, not a replacement for, the rising-edge detection in user code.
PLC Pulse Generation
The PLC must publish a rising-edge pulse to the HMI, not a sticky level. If the HMI receives a sticky TRUE, the alarm is raised once on the rising edge and then "goes" when the bit clears; if the bit never clears (e.g., a stuck input), only one entry is ever produced. The standard Siemens idiom is the FP (FlankenPositiv / positive edge) instruction:
// S7-1200/1500 SCL — coin pulse rising-edge detection
// "CoinRaw_x" : Bool input wired to coin-acceptor output x
// "CoinEdge_x" : static Bool edge-memory bit
// "CoinPulse_x" : Bool tag bound to HMI alarm trigger x
IF iRaw AND NOT sEdge THEN
oPulse := TRUE; // one-scan pulse on 0->1
ELSE
oPulse := FALSE;
END_IF;
sEdge := iRaw;
Equivalent STL:
A "CoinRaw_1";
FP "CoinRE_1"; // rising-edge detector: FP sets M-bit on 0->1
= "CoinPulse_1"; // one-scan pulse to HMI alarm trigger
Always verify the pulse width with a PLC watch table or trace before commissioning the HMI. A pulse shorter than one PLC scan cycle (1–10 ms typical) can be missed; a pulse wider than the HMI's polling cycle (default 1 s) can produce duplicate alarms if the alarm trigger tag is also read on a cycle that overlaps.
Step-by-Step Configuration Procedure
- Create the HMI tags. In the project tree, expand "HMI tags" and add one Bool per denomination ("CoinPulse_5c", "CoinPulse_10c", …), each connected to the matching PLC tag via the HMI connection. Alternatively, add one Int "CoinIndex" tag if you prefer the single-alarm text-list design.
- Create the text list. Right-click "Text and graphic lists" → "Text lists" → "Add new". Name it "tlCoinEvents". Configure the list as a numeric (Int) list with range 0–5. Populate the entries as shown in the table above.
- Create the discrete alarm. Right-click "HMI alarms" → "Discrete alarms" → "Add new". Name it "CoinInserted". In the alarm text box, type the static prefix and suffix, then place the cursor where the coin value should appear and select right-click → "Insert text list output field" → select "tlCoinEvents" and the "CoinIndex" tag. The alarm text now reads: "<text list> has entered", where <text list> is a placeholder for the runtime substitution.
- Bind the trigger tag. In the alarm's "Trigger" property, set the tag to the rising-edge pulse BOOL (CoinPulse_x) or, for the single-alarm design, to a tag that becomes TRUE briefly each time any coin fires. The trigger condition is "Rising edge" by default; leave it as is.
- Configure the Alarm View. Drag an "Alarm view" control onto the screen. In the properties, "General" tab, change "View" from "Pending alarms" to "Alarm buffer" (Comfort Panels) or check "Show log" (Basic Panels V14+).
- Set the buffer size. In the Alarm View properties, set "Number of visible alarms" to a value that covers the expected session, e.g., 100. Maximum buffer: 1,024 entries for Comfort Panels, 256 entries for Basic Panels V13/V14, 500 entries from V15 onward.
- Configure columns. Enable "Date", "Time", "Alarm text", and (optionally) "Status". Disable "Status" if you want a pure event list without acknowledgement columns.
- Configure the alarm log. In "Alarm logging", enable logging, set the storage location to "Storage card SD" (Comfort Panels), set the file format to "CSV (Comma-separated)" for Excel compatibility, and configure segment size and retention per your audit policy.
- Compile and download. Compile the HMI project; resolve any tag-consistency warnings. Download to the panel. Restart the panel runtime to clear any prior alarm buffer.
- Test. Trigger each denomination from the PLC watch table. Confirm one row per trigger in the Alarm View, in chronological order. Trigger €1 ten times in succession and verify ten rows appear in the buffer.
Alarm Log Configuration for Long-Term Audit
The alarm buffer is volatile; for accounting and regulatory audit a persistent alarm log is mandatory. On Comfort Panels, configure:
-
Storage location: "Storage card SD" (path:
/Logs/Alarms). USB storage works on TP1500 Comfort and larger, but SD is more reliable in vending environments subject to vibration. - File format: CSV with semicolon delimiter for European locale compatibility. Columns: Date, Time, Status, Alarm class, Alarm text.
- Segment size: 1 MB per segment. The runtime rotates segments automatically when the active segment fills.
- Retention: not enforced by the runtime; manage retention externally by archiving or deleting older segments via a script on the SD card.
Log retrieval: insert the SD card into a PC and open the CSV file in Excel, or use the S7-1500 PLC's web server to expose the most recent segment over HTTP for remote retrieval.
Verification and Commissioning
- From the PLC's watch table, force each CoinPulse_x to TRUE one cycle at a time. Verify the Alarm View shows a fresh row with the correct text-list entry for each.
- Force the same CoinPulse_x to TRUE ten times in succession. Verify ten rows appear, with sequential timestamps.
- Insert a sequence of mixed denominations (€1, €0.50, €1, €0.20, €0.10) and verify the Alarm View shows the events in exactly the order they were triggered — not in denomination order.
- Power-cycle the panel and confirm whether the alarm buffer persists (it should NOT; that is the alarm log's job).
- Confirm the alarm log file on the SD card contains the same events in CSV form.
- Verify the alarm text by reading the runtime tag values; the text-list output field should always resolve to the index that was published by the PLC at the moment the alarm fired.
Performance and Buffer Sizing
Each alarm buffer entry consumes approximately 1 KB of panel RAM. A Comfort Panel with 1,024 entries uses ~1 MB; this is negligible compared to the panel's 256 MB–1 GB RAM. CPU overhead per alarm trigger is ~2 ms on a Comfort Panel, so even at 100 alarms/second the panel runtime CPU remains under 20 % load. The bottleneck is usually the HMI tag polling cycle, not the alarm itself.
For high-throughput applications (>50 events/s), reduce the polling cycle on the trigger tags to 100 ms (default is 1 s). This is configured in the HMI tag's "Acquisition" properties. Note that reducing the polling cycle increases PROFINET traffic proportionally.
Multilingual Text Lists
Vending machines are often deployed across multiple language regions. WinCC (TIA Portal) supports per-language text lists: each entry has one translation per project language. Add the language in "Project view → Languages & Resources" → "Project languages", then edit the text list entries in each language. The runtime automatically selects the language based on the panel's configured language, switchable at runtime via the ChangeLanguage system function. Alarm text lists support the same mechanism.
Troubleshooting Matrix
| Symptom | Root cause | Fix |
|---|---|---|
| Single row, timestamp updates on each repeat | Alarm View is in "Pending alarms" mode | Switch View property to "Alarm buffer" or "Alarm log" |
| Only one row ever, regardless of view mode | Trigger tag is sticky (level) not pulsed (edge) | Insert FP/edge detection in PLC code before publishing to HMI |
| Text shows literal "<text 0>" or "???" | Text list not assigned to the output field | Re-insert the text list output field and bind to tlCoinEvents; confirm list range covers the tag's value range |
| Buffer fills within minutes | Buffer size too small or alarm raised every PLC cycle | Increase buffer entries; verify edge pulse width is exactly one scan |
| Alarm log file missing after reboot | Storage path points at volatile memory (internal flash on Basic Panels) | Set storage location to SD card or USB on Comfort Panels; on Basic Panels, export logs manually |
| "Insert text list output field" greyed out | Project type does not support text lists (WinCC flexible legacy import, Basic Panel V13) | Migrate panel project to TIA Portal; upgrade Basic Panel firmware to V14 |
| Wrong text shown for a coin (e.g., €0.20 reads as €0.10) | Wiring swap between coin-acceptor outputs and PLC inputs | Test each denomination one at a time and re-map the PLC I/O or text-list indices |
| CoinPulse_x fires but no alarm appears | Tag is not connected to the HMI; HMI shows "###" or "?" in the tag monitor | Open "Connections" → verify the HMI connection; reload the PLC and HMI; check that the tag's "Access" is "Absolute" not "Symbolic" |
| Alarm appears with the wrong timestamp (off by hours) | Panel timezone / daylight-saving not set | Set Control Panel → "Date/Time" or push the time from the PLC via the time-master function |
Migrating from WinCC flexible
If you have an existing WinCC flexible project that uses text lists in alarms, the migration to TIA Portal V16+ preserves the text list structure automatically. Two caveats:
- The "Insert text list output field" command was renamed between WinCC flexible and TIA Portal; the underlying function is the same.
- Basic Panels migrated from WinCC flexible may show the alarm in pending-only mode until the firmware is upgraded to V14.
Advanced: TIA Portal Openness for Text List Library Management
OEMs that ship multiple vending machines with the same alarm message set can automate the migration of text lists across projects using the TIA Portal Openness API. The API can copy a project's text lists into a global library master copy folder, or delete text lists from a library master copy folder, without manual export/import. This is documented in the TIA Portal Openness manual under "Managing alarm text list in PLC and Mastercopy library" — see TIA Portal Openness — Functions on Libraries. A typical C# script uses the IMasterCopyFolder and ITextList interfaces to enumerate and migrate the lists. This is useful for fleet rollouts and for synchronising alarm messaging across engineering sites.
FAQ
Why does my Alarm View show only one row when the same coin is inserted repeatedly?
The Alarm View is in "Pending alarms" mode by default. Change the View property to "Alarm buffer" or "Alarm log" so every trigger appends a new row.
How do I make the alarm text show "€1 has entered" instead of a placeholder?
Create a text list with the six coin entries (indices 0–5), then in the alarm text use the right-click shortcut "Insert text list output field" and bind it to that list and the denomination tag. See the official SIMATIC STEP 7 Basic manual entry.
What buffer size should I configure for a vending machine logging 5,000 insertions per day?
Set the Comfort Panel buffer to its maximum of 1,024 visible entries and enable the alarm log to SD card; the log holds effectively unlimited events subject to storage capacity (32 GB SD ≈ 100 million rows).
Can a Basic Panel (KTP1200 Basic) do this?
Yes, from firmware V14.0.0 onward. Before V14, Basic Panels only show pending alarms and do not expose the alarm buffer view.
Why does my alarm trigger only once even though I insert ten coins?
The trigger tag is sticky (level) rather than pulsed (edge). Add rising-edge detection (FP in STL, or the SCL pattern above) between the raw input and the HMI tag.
How do I share text lists across multiple TIA Portal projects?
Use the TIA Portal Openness API to copy the text lists into a global library master copy folder, as documented under Managing alarm text list in PLC and Mastercopy library.