Configuring S7-200 Data Logging on WinCC Flexible HMI Panels

David Krause13 min read
HMI ProgrammingSiemensTutorial / 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: Recording PLC Data on SIMATIC HMI Panels

Recording process variables, alarms, and operator events from a SIMATIC S7-200 CPU onto a SIMATIC HMI panel is one of the most common commissioning tasks for small machine applications. The S7-200 family (CPU 221 / 222 / 224 / 224XP / 226) does not natively generate historical files that a standard Windows tool can read; the HMI panel is the data sink in almost every architecture. This article describes how to enable that recording on a WinCC Flexible runtime panel, why the popular TP177 cannot perform the task, which panels support it, and how to configure each trigger type, storage path, and CSV layout.

Field-proven caveat: The SD/MMC slot on a TP177A/TP177B is reserved for recipe backup/restore and project backup. It is not a general-purpose data-log file target. If you need CSV logging, step up to an MP 277, MP 377, or any SIMATIC Comfort Panel (TP700 / TP900 / TP1200 / TP1500 / TP1900 / TP2200). The TP177 color PN/DP and TP177 mono PN/DP are not licensed for archive creation.

Prerequisites

Before configuring data logging, verify the following hardware and software baseline.

Item Requirement Notes
S7-200 CPU CPU 221, 222, 224, 224XP, 226 Firmware ER 1.20 or higher for full V-memory access from HMI
HMI Panel MP 277 8"/10", MP 377 12"/15"/19", or Comfort Panel TP177 cannot log
WinCC Flexible 2008 SP5 (or SP4 with Hotfix 18) minimum SP5 is the last release supporting S7-200 direct driver
Cable PPI / MPI / PROFIBUS with EM 277, or Ethernet via CP 243-1 PPI at 9.6 / 19.2 / 187.5 kbps; Ethernet recommended for log density
Storage media SD card ≥ 1 GB, FAT16 / FAT32 Industrial-grade SLC recommended (e.g., Siemens 6AV6 671-1CB00-0AX2)
Operator authorization User group with "Manage logs" permission Configured under »User Administration« in WinCC Flexible

HMI Panel Capability Matrix for Data Logging

Panel capability is determined by the runtime image, not by the physical size or the presence of an SD slot. The following matrix is the field reference used to size the upgrade path.

Panel MLFB (example) Logging supported Recipe slot Archive to MMC/SD Archive to USB Archive to network share
TP 177A mono 6AV6 640-0BA11-0AX0 No Yes No (backup only) No No
TP 177A color 6AV6 640-0CA11-0AX0 No Yes No (backup only) No No
TP 177B 4" 6AV6 642-0BA01-1AX1 No Yes No (backup only) No No
TP 177B 6" mono 6AV6 642-0BC01-1AX1 No Yes No (backup only) No No
TP 177B 6" color 6AV6 642-0DC01-1AX1 No Yes No (backup only) No No
OP 177B 6" color 6AV6 642-0DA01-1AX1 No Yes No (backup only) No No
MP 177 6" 6AV6 642-0EA01-3AX0 Limited (alarms only) Yes Yes Yes No
MP 277 8" 6AV6 643-0CB01-1AX1 Yes Yes Yes Yes Optional
MP 277 10" 6AV6 643-0CD01-1AX1 Yes Yes Yes Yes Optional
MP 377 12" 6AV6 644-0AB01-2AX0 Yes Yes Yes Yes Yes
MP 377 15" 6AV6 644-0AC01-2AX0 Yes Yes Yes Yes Yes
MP 377 19" 6AV6 644-0AD01-2AX0 Yes Yes Yes Yes Yes
TP Comfort 7" 6AV2 124-1GC01-0AX0 Yes Yes Yes Yes (via X61/X62) Yes
TP Comfort 9" 6AV2 124-1JC01-0AX0 Yes Yes Yes Yes Yes
TP Comfort 12" 6AV2 124-1MC01-0AX0 Yes Yes Yes Yes Yes

If your existing panel is a TP 177A / TP 177B, do not attempt to enable logging through registry hacks or third-party firmware: the runtime license key inside the image simply does not contain the archive code. Replace the panel or migrate the application to TIA Portal / WinCC Comfort where a Comfort Panel can replace an MP 377 with no functional loss.

S7-200 Tag Address Layout for Logging

WinCC Flexible talks to the S7-200 over its native PPI driver or over Ethernet using the S7-200 TCP/IP driver that ships with WinCC Flexible 2008 SP2 and later. Both drivers expose the same address space.

PLC area WinCC Flexible syntax Width Typical use for logging
Inputs I0.0 .. I15.7 1 bit Discrete events
Outputs Q0.0 .. Q15.7 1 bit Actuator state
Marker / flags M0.0 .. M31.7 1 bit Status flags
Variable memory VW0 .. VW10238 16-bit word Process values, counters
Variable memory VD0 .. VD10236 32-bit double word Real numbers, scaled PVs
Timer current ET0 .. ET255 16-bit word Cycle times
Counter current C0 .. C255 16-bit word Production counters
Analog input (word) AIW0 .. AIW62 16-bit signed EM 231 / EM 235 raw
Analog output (word) AQW0 .. AQW62 16-bit signed EM 232 setpoints
Address alignment: When logging 32-bit REAL values from VDx, always select the byte-aligned boundary (e.g., VD0, VD4, VD8). S7-200 stores REALs as two words in big-endian low-word-first order; misalignment causes the HMI to read a swapped sign bit and display large negative garbage in the CSV.

For data that you want logged but never displayed (for example, the soft-counter for completed parts on a machine you cannot bring to a stop), allocate a dedicated VD block in the S7-200 main routine, increment it once per cycle, and read it from the HMI as a 32-bit word.

WinCC Flexible Project Setup

Step 1 - Create the S7-200 connection

  1. Open the WinCC Flexible project, right-click »Connections« under the panel name, and choose »Add connection«.
  2. Set the communication driver to SIMATIC S7 200.
  3. Configure the network parameters:
    • PPI: Baud rate 19200 bps, address 2 for the panel, address 2 for the CPU, profile PPI.
    • Ethernet: IP 192.168.0.10 for the panel, IP 192.168.0.20 for the CP 243-1, rack 0, slot 0.
  4. Press »Test« - the dialog must report »Connection established« before you save.

Step 2 - Declare the tags

  1. Open »Tags« and create a tag per value to be logged.
  2. Set »Connection« to the S7-200 connection.
  3. Set »Address« as shown in the table above.
  4. Set »Acquisition mode« to »Cyclic in operation« with a 100 ms refresh for fast PVs, 1 s for trends, and 5 s for energy meters.

Step 3 - Create the data log

  1. Navigate to »Logs« → »Data logs« and click »New log«.
  2. Name the log ProcessCSV (no spaces - WinCC Flexible truncates long names on FAT16 file systems).
  3. Set the »Storage location« to \Storage Card SD\Logs\ (MP 377 15"/19" with the SD card slot) or \Storage Card MMC\Logs\ for MP 277.
  4. Add each tag you want recorded.
  5. Choose the trigger (see trigger matrix below).

Configuring Triggers: Cyclic, On Change, On Demand

WinCC Flexible supports three trigger categories for data logs and four for alarm logs. Choosing the wrong trigger is the most common reason a log file ends up empty or grows out of control in a single shift.

Trigger Parameter Recommended for Storage cost
Cyclic 1 s .. 24 h Periodic trending Low (predictable)
On change Hysteresis value Limit transitions Variable
On demand Trigger tag bit Event-based capture Very low
Event-based (alarm) Alarm tag Alarm and event logs Low

Cyclic trigger

Set the logging cycle to 1 s for closed-loop pressure profiles, 5 s for temperature, and 60 s for utility meters. The minimum is 100 ms; the panel flushes the segment buffer to the SD card every time a 16 KB block is full, which under default settings happens roughly every 2 s at 1 s cycle.

On-change trigger

For each tag, set a hysteresis value (default 1 %, range 0.01 - 25 %). A tag is recorded only when its value differs from the last logged value by more than the hysteresis. This is ideal for setpoint changes, where cyclic logging at 1 s would create 86,400 identical rows per day.

On-demand trigger

Define a discrete tag, e.g., TriggerLog_M0.0, set to 1 from the PLC logic for one scan to request a snapshot. The HMI records all configured tags with the current timestamp and clears the trigger. Use this for batch-end logging, fault snapshots, or to implement the »Record« push-button pattern.

Storage Layout on the SD Card

The MP 377 mounts the SD card as the path \Storage Card SD\ in its own virtual file system. The runtime writes CSVs to that path using the FAT32 file system with a maximum file size of 4 GB. The default naming pattern is

\Storage Card SD\Logs\<LogName>_<YYYY-MM-DD>_<HH-mm-ss>.csv
\Storage Card SD\Logs\<LogName>_<YYYY-MM-DD>_<HH-mm-ss>.csv.bak

The .bak companion file is the previous segment kept for one cycle as a safety copy. Both files share the same column layout:

Timestamp,Millisecond,Temp_PV_C,Press_kPa,Flow_Lmin,BatchCount
2025-09-30 08:00:00,125,42.31,118.4,12.7,00128
2025-09-30 08:00:01,124,42.34,118.5,12.7,00128
...

Column order is fixed by the order you add tags in the log configuration. Do not reorder columns after commissioning: any downstream Excel macro will lose its anchor.

CSV File Size and SD Card Life Estimation

Use this calculation to size your storage media before ordering:

RowSize ≈ 25 (timestamp + ms + comma) + Σ(NumChars_i + 1) + 2 (CRLF)

RowsPerDay = 86400 / Cycle_s

BytesPerDay = RowsPerDay × RowSize

CardLife_days = CardCapacity_GB × 1024^3 × 0.7 / BytesPerDay

The 0.7 factor reserves 30 % of the card for wear leveling and project backups. Worked example for 10 tags averaging 8 characters each, 1 s cycle:

  • RowSize = 25 + 10 × (8 + 1) + 2 = 117 bytes
  • RowsPerDay = 86400
  • BytesPerDay = 86400 × 117 = 9,468,000 bytes/day ≈ 9.0 MB/day
  • CardLife = 1 × 0.93 / 9.0 = 103 days on a 1 GB card

At 5 s cycle the same setup lasts roughly 17 months on a 1 GB card. Plan replacement of the SD card every 12 months as preventive maintenance; industrial SLC cards are rated at 100,000 write cycles per block, and WinCC Flexible rewrites the same FAT blocks when the active segment rolls.

The Hidden IO Field Logging Pattern

Operators frequently want a value to be logged but never shown. WinCC Flexible supports this with two complementary techniques.

Pattern A - Layer ordering

  1. Place the IO field on the screen.
  2. Place a rectangle of the screen background color over the IO field.
  3. In the »Layer« property, ensure the rectangle is on a higher layer than the IO field.

The IO field is still active in the runtime: it reads the tag, evaluates scaling, and is included in the data log. The user simply cannot see it. This matches the pattern the original engineer used in the legacy project.

Pattern B - Dynamic visibility

  1. Open the IO field »Properties » Animations » Visibility«.
  2. Configure a discrete tag, e.g., ShowIO_M0.0, and set the visibility animation to »invisible when 1«.
  3. Keep the tag at 0 normally; flip it to 1 from the HMI for diagnostic sessions.

Visibility animations are evaluated on the same 100 ms cycle as tag acquisition, so the field stays fully logged. Both patterns are runtime-only and require zero changes to the PLC program.

Commissioning Verification

  1. Download the WinCC Flexible project to the panel via Ethernet or MPI.
  2. Insert a formatted SD card.
  3. Boot the panel, navigate to the process screen, and force a tag value from the S7-200 (use the »Monitor / Modify« tool in STEP 7 Micro/WIN).
  4. Wait for one logging cycle.
  5. Press the panel »Control Panel »Service »Backup/Restore »Open log path« shortcut, or remove the SD card and read it on a PC.
  6. Open the CSV in Excel and verify: timestamp column is local panel time, numeric columns are right-aligned (otherwise you have a decimal-vs-locale issue), and the row count equals (elapsed seconds / cycle) ± 1.
  7. If the panel has ProSave installed, run »ProSave »Log diagnosis« to pull the logs over Ethernet without removing the card.
Time synchronization: A panel that is not synchronized to the CPU clock drifts by up to 5 s/day. Enable the »Set time from PLC« option under »Device Settings »Time« so each logging cycle uses the S7-200 RTC as its source.

Troubleshooting Matrix

Symptom Likely cause Resolution
Log directory empty after one hour TP 177 panel in use, or wrong log location Upgrade to MP 277 or higher; verify »Storage location« is a writable path
CSV file present but rows are all zeroes Tag address bit/word mismatch Open tag in WinCC Flexible »Properties »Address« and confirm bit numbering (S7-200 counts bits as I0.0 .. I15.7)
CSV writes stop randomly SD card full or write-protected Check free space; remove write-protect tab; replace card
Timestamp jumps by 1 hour Daylight saving transition Disable »DST« under »Regional Settings« or switch to UTC
Alarm log works, data log does not Data log license / panel capability Confirm panel is MP or Comfort family, not TP 177
ProSave cannot find logs Panel and ProSave PC on different subnets Set static IPs on the same /24; disable Windows firewall
CSV row count larger than expected Multiple triggers active on same tag Combine into a single log; remove duplicate tag entries
Slow trend refresh on the panel Logging cycle set to < 1 s on a TP 177 Not supported on TP 177; switch panel or raise cycle to 1 s
Lost rows after panel reboot Logs stored on internal flash, not SD Move »Storage location« to \Storage Card SD\Logs\
WinCC Flexible compile error »Address out of range« VD address above VW10238 Reduce the address to within the S7-200 data range

Migrating to TIA Portal and Comfort Panels

WinCC Flexible 2008 SP5 was the final release that compiled a runtime for the MP 377, and SP5 reaches end of standard support in 2024 per the Siemens product lifecycle. New installations should use:

  1. STEP 7 (TIA Portal) V18 or later to program a replacement S7-200 Smart or S7-1200 CPU.
  2. WinCC Comfort (TIA Portal) for the HMI runtime on a Comfort Panel.
  3. The S7-200 project migrates through the »Migrate S7-200 project» wizard, which converts the Micro/WIN program to a S7-1200 equivalent and remaps VW to %DBW.

From the operator standpoint, the data log procedure is identical: select a tag, choose a trigger, set the path to \Storage Card SD\Logs\, download. The CSV format produced by WinCC Comfort is a superset of the WinCC Flexible format and is consumable by the same downstream Excel or Python pipelines.

Field-Commissioning Checklist

  • ✓ Panel is MP 277 / MP 377 / Comfort family - not TP 177
  • ✓ Industrial SD card installed, write-protect tab removed, formatted FAT32
  • ✓ WinCC Flexible version matches the panel image (SP5 for MP 377 12" / 15" / 19")
  • ✓ Connection test passes with the live S7-200
  • ✓ Log trigger matches the data rate (cyclic for trending, on-demand for snapshots)
  • ✓ Panel time synchronized to S7-200 RTC
  • ✓ Storage path is writable from the runtime (test by writing a single value first)
  • ✓ CSV file inspected in Excel; columns are correctly typed and timestamp matches panel clock

FAQ

Why does my TP 177 panel not write any log files?

The TP 177A and TP 177B runtime images do not include the data archive license. Their SD/MMC slot is reserved for recipe backup and project backup only. To record process values to CSV, replace the panel with an MP 277, MP 377, or any SIMATIC Comfort Panel.

Do I need to put an IO field on the visible screen for it to be logged?

No. WinCC Flexible logs any tag that is part of a configured data log, regardless of whether a screen object references it. The "hidden IO field under a black rectangle" pattern works because the IO field stays on the active screen layer; it is purely a cosmetic choice.

What is the smallest SD card I should use on an MP 377?

1 GB FAT32 is the practical minimum. The runtime reserves 8 MB for the active log and 4 MB for the ".bak" copy. Industrial SLC cards such as the Siemens 6AV6 671-1CB00-0AX2 are recommended over consumer cards for write endurance.

How do I retrieve logs without removing the SD card?

Install ProSave on a service PC, connect over Ethernet to the panel, and use »Log diagnosis«. ProSave streams the current log file plus the previous segment and lets you export them as ZIP. Both PC and panel must be on the same subnet and reachable on TCP/UDP port 102 and 135.

Can I log to a Windows network share instead of an SD card?

Yes on the MP 377 15"/19" and on all Comfort Panels. Configure the storage path as \\server\share\Logs\, supply credentials under »User Administration«, and enable »Write to network«. The MP 277 requires the Ethernet option module and the runtime add-on; the TP 177 family does not support network logging at all.

Back to blog