WinCC V7.0 Excel Data Export: Tag Logging and CSV Configuration

David Krause13 min read
SiemensTutorial / How-toWinCC
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

WinCC V7.0 Excel Data Export: Tag Logging and CSV Configuration

WinCC V7.0 provides multiple mechanisms to move process data, alarm records, trend values, and tag definitions into Microsoft Excel. Engineers routinely need this capability for ad-hoc reporting, batch record archival, regulatory 21 CFR Part 11 compliant exports, and offline engineering. This reference consolidates the four primary export paths exposed in WinCC V7.0/V7.2/V7.3, the configuration steps for each, the cell-formatting pitfalls that corrupt numeric values, and a verification checklist that proves the export is correct before it reaches operations.

1. Overview of WinCC V7 Excel Exchange Methods

There is no single "Export to Excel" button that covers every scenario. The path you select depends on the data source, the trigger (manual, scheduled, event-driven), and the downstream consumer (Excel template, SQL, MES). Four methods are officially documented by Siemens:

Method Data Source Output Format Trigger Typical Use Case
Tag Export / Import (CSV) Tag Management CSV (semicolon) Manual / engineering Bulk tag editing, project migration
Online Trend Control Export Tag Logging runtime CSV (locale-dependent) Operator button Shift reports, trend snapshots
User Archive Export / Import User Archive (recipe / batch) CSV / DBF Manual / script Recipe management, parameter sets
VBScript / OLE Automation Any runtime tag, archive, alarm Native .xls/.xlsx Event / schedule Formatted reports, multi-sheet workbooks

Siemens' official entry point for choosing between them is the FAQ "What are the options for tag export/import?" — review it before locking in a method because licensing for the VBScript OLE path differs from the built-in CSV functions.

2. Prerequisites

Before configuring any export path, verify the following:

  • WinCC V7.0 SP3 or later (SP4 recommended). The CSV routines below apply unchanged to V7.2 and V7.3; older SP levels may lack the UTF-8 codepage handling needed for non-ASCII tag names.
  • Microsoft Excel 2007 SP3 / 2010 / 2013 / 2016 / 2019 / 2021 / 365. The VBScript OLE path requires Excel installed locally on the WinCC server; the runtime may be either 32-bit or 64-bit, but it must match the WinCC build (WinCC V7.0 is 32-bit only).
  • WinCC option licenses: "WinCC Connectivity Pack" and "WinCC OLE DB Provider" are not required for the CSV path, but the VBScript/OLE path using HMIRuntime.Tags + Excel.Application needs the standard WinCC runtime license. Connectivity Station licensing applies only when SQL clients read the archive externally.
  • Windows regional settings set on the WinCC server must match the desired CSV delimiter. German/European locales use ; as the list separator; US English uses ,. Either set the locale consistently across engineering and runtime, or override the separator in the VBScript (see Section 7).
  • Folder write permissions for the WinCC runtime user account on the target export directory. The default Siemens\WinCC\Logfiles path is pre-secured; custom paths need manual ACL grants.
Note: Running Excel interactively on a WinCC server is unsupported. Use the VBScript path with a hidden Excel.Application object and a dedicated SYSTEM-owned service account, never an interactive RDP session.

3. Method A — Tag Export / Import (CSV)

This is the fastest way to mass-edit tag names, limits, or address pointers. The official procedure is documented in Siemens FAQ entry 22016422.

3.1 Export Procedure

  1. Open WinCC Explorer on the engineering station.
  2. Right-click Tag Management → Export Tag… (or Edit → Export in the menu bar).
  3. Select the desired structure level. Sub-selections are remembered per project.
  4. Choose a target path. The default extension is .csv; the delimiter is taken from the Windows regional setting.
  5. Click Export. The file size scales with tag count — 5,000 tags typically produce a 600–900 kB CSV.

3.2 File Layout

The first row is a header. Columns are localized; on English installations you get Name;Type;Length;Connection;Address;…. On German installations the same column is Name;Typ;Laenge;Verbindung;Adresse;…. Cell formatting is always text, so REAL tag limits like 0,0;100,0 must be re-imported with a locale-aware import profile or the value 100.0 will be silently rejected.

3.3 Re-import

Right-click Tag Management → Import Tag…. Existing tags are overwritten if the Name column matches; new tags are appended. Tag addresses that conflict with the AS connection are flagged in the import log <project>_Import.log in the project root.

Caution: Never edit the CSV in Excel and save it as .xlsx expecting WinCC to read it. WinCC expects a literal CSV with line endings LF or CRLF; Excel's re-save converts to UTF-8 with BOM and adds a separator that breaks the parser.

4. Method B — Online Trend Control CSV Export

The runtime export from WinCC Online Trend Control is documented in FAQ 25533776. This is the path operators use to snapshot a trend window into a CSV that they can email or archive.

4.1 Configuration Steps

  1. Open the Graphics Designer and select the Online Trend Control.
  2. In the configuration dialog → General tab, enable "Operator can change the time range" and "Operator can save data".
  3. Switch to the Buttons tab and enable the Export data button (icon: floppy disk with arrow).
  4. Configure the export path in the Time Range / Export dialog. Two strings matter:
    • ExportFileName — base name; the runtime appends a timestamp, e.g. Trend_2024-05-12_14-22-08.csv.
    • ExportFilePath — absolute path; use \\<server>\Archive$ for a network share.
  5. Under Time Axis, set the desired sampling interval. The export inherits this interval; a 1 s axis on a 24 h window produces ~86,400 rows.

4.2 Resulting CSV Structure

Time;Tag1;Tag2;Tag3
12.05.2024 14:00:00.000;87.42;ON;1543.7
12.05.2024 14:00:01.000;87.45;ON;1543.9
12.05.2024 14:00:02.000;87.51;OFF;1544.1

The decimal separator follows the WinCC runtime locale. The timestamp is always dd.mm.yyyy hh:mm:ss.fff in V7.0; later SPs add ISO 8601 as an option.

5. Method C — User Archive Export / Import

User Archives (UA) hold recipe data, batch parameters, and operator-entered setpoints. The full procedure is in FAQ 8972156. Two formats are supported:

Format Extension Encoding Best For
CSV .csv ANSI / UTF-8 Exchange with non-WinCC tools
DBF .dbf dBASE III+ Legacy recipe managers, ODBC

5.1 Export Configuration

  1. Open WinCC Explorer → User Archive.
  2. Right-click the archive → Properties → Export tab.
  3. Set the export path and the column separator (default ;).
  4. Choose "Export all data records" or filter by index range.
  5. Click Apply. Runtime exports can also be triggered from a button via the C-script call UAArchiveExport(archivename, filename, separator) or VBScript HMIRuntime.DataArchives.Export.

5.2 Import Configuration

The header row is mandatory and must match the archive's column names exactly (case-sensitive in DBF mode). Boolean columns accept 0/1 or true/false in CSV mode; in DBF mode only T/F or Y/N are valid.

6. Method D — VBScript Dynamic Exchange with Excel

When you need native .xlsx output, formatted cells, formulas, multiple sheets, or triggered exports from an alarm, use the VBScript path. The official Siemens pattern is in FAQ 16514261.

6.1 Minimal Working Example

Place this in a button's Mouse Click VBS action:

' WinCC V7 VBScript: write three tags to Excel with formatted cells
Dim objExcel, objWorkbook, objSheet
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = False

Set objWorkbook = objExcel.Workbooks.Add
Set objSheet = objWorkbook.Worksheets(1)

' Header
objSheet.Cells(1, 1).Value = "Timestamp"
objSheet.Cells(1, 2).Value = "Temperature"
objSheet.Cells(1, 3).Value = "Pressure"

' Data
objSheet.Cells(2, 1).Value = Now
objSheet.Cells(2, 2).Value = HMIRuntime.Tags("Temp_01").Read
objSheet.Cells(2, 3).Value = HMIRuntime.Tags("Press_01").Read

' Cell formatting (the critical part)
objSheet.Cells(2, 1).NumberFormat = "yyyy-mm-dd hh:mm:ss"
objSheet.Cells(2, 2).NumberFormat = "0.00"
objSheet.Cells(2, 3).NumberFormat = "0.000"

' Save with timestamp
Dim sPath
sPath = "C:\WinCC_Export\Report_" & Replace(Replace(Now, ":", "-"), "/", "_") & ".xlsx"
objWorkbook.SaveAs sPath, 51   ' 51 = xlOpenXMLWorkbook (.xlsx)

' Cleanup
objWorkbook.Close False
objExcel.Quit
Set objSheet = Nothing
Set objWorkbook = Nothing
Set objExcel = Nothing

6.2 Why Cell Formatting Matters

WinCC returns REAL tags as VT_R8 doubles. If you do not set NumberFormat, Excel renders a 6-decimal scientific value for 87.42 and the column width auto-fits to "8.74200E+01". Worse, a tag with leading zeros (e.g. a barcode 0012345) is delivered as a number and Excel truncates the zeros. Always set:

  • NumberFormat = "0.00" for process values,
  • NumberFormat = "yyyy-mm-dd hh:mm:ss" for timestamps,
  • NumberFormat = "@" for text/barcode columns (the @ forces text).

6.3 Triggering Exports from Events

For periodic exports, schedule a WinCC Global Script timer at 5–10 s and write to a rolling file. For event-driven exports (e.g. batch end), use an alarm-acknowledged or value-change trigger:

Sub OnTagChange(ByVal Tag)
    If Tag.Name = "BatchEnd" And Tag.Read = 1 Then
        Call ExportBatchReport()
    End If
End Sub
Important: Excel COM instantiation under the SYSTEM account requires a desktop session. Configure the WinCC runtime service to "Allow service to interact with desktop" and ensure the server's interactive session is not consumed by another Excel instance. A hung Excel under SYSTEM is the single most common cause of server slowdowns.

7. Locale & Decimal Separator Handling

The most common cause of "Excel shows wrong values" is the locale mismatch. If the WinCC server uses de-DE and the destination Excel uses en-US, the CSV value 87,42 is parsed as text, not as 87.42. Three mitigations:

  1. Force a constant CSV separator in WinCC. From V7.0 SP3 the registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\WinCC\RT\CSV] Separator=; or , overrides the system setting.
  2. Pre-format the cell as NumberFormat = "0.00" in the VBScript path — Excel then ignores the locale separator.
  3. Use the DataConnector ODBC text driver to read CSVs into Excel as a query — it applies the schema, not the locale.

8. Datalogging Configuration

Datalogging (the Tag Logging runtime database) feeds both Methods B and D. The configuration sequence:

  1. In WinCC Explorer, open Tag Logging → right-click → Properties on the desired archive.
  2. Set the acquisition cycle (e.g. 500 ms) and the archiving cycle (e.g. 1 s). The acquisition cycle is the polling rate from the AS; the archiving cycle is the write rate to the SQL store. The slower of the two defines the row rate.
  3. Add the tags. Each tag can have a compression setting: No compression, Swelling, or Deadband. Deadband mode (e.g. ±0.5 °C) reduces row count by 80–95 % for slow processes and is the single most effective disk-space optimization.
  4. Configure the segmentation: by time (day/week/month) or by size. Time-based daily segments are the default and produce one .ldf file per day in \WinCC\ArchiveManager\TagLogging.
  5. Define the retention in the Archive Manager. Without explicit retention, archives grow until disk full.

8.1 Storage Sizing Formula

For a back-of-the-envelope check, the data rate is:

Rows/s = min(AcquisitionHz, ArchivingHz) * NumberOfTags

Bytes/row ≈ 24 B header + 8 B/tag for REAL + 4 B/tag for BOOL. A 200-tag archive at 1 Hz with all REAL values produces 200 * 24 + 200 * 8 = 6.4 kB/s, or about 552 MB/day uncompressed. With deadband compression and a typical industrial signal profile, real storage lands between 30 and 80 MB/day.

8.2 Linking the Archive to the Online Trend Control

In the trend's configuration dialog → Data Source, set the time range to "Online" for live display or "Archive" for historical. The export operation described in Section 4 always operates on the displayed window — if the trend is in "Online" mode, only the in-memory buffer (~1,000 points) is exported.

9. Verification Checklist

Run these checks after every configuration change, before commissioning the export to operations:

# Check Expected Result
1 Open the exported CSV in Notepad Header row present, consistent delimiter, no trailing BOM
2 Open the CSV in Excel with the same locale as WinCC Numeric columns auto-detected as numbers, not text
3 Check row count vs expected (rows = duration × archiving rate × tags) Match within ±2 %
4 Trigger the VBScript export with a known tag value Workbook opens, cell shows raw value (e.g. 87.42), not 8.742E+01
5 Re-import the tag CSV and re-compile the OS No "address conflicts" in the import log; OS starts without tag errors
6 Verify file write permissions for the runtime user Export completes; ACL grants SYSTEM Modify on the target folder
7 Check Event Viewer "Application" log for WinCC errors No source "WinCC" entries during the export

10. Troubleshooting Matrix

Symptom Likely Cause Fix
CSV opens as one column in Excel Locale delimiter mismatch Use Data → Text to Columns with the correct separator, or set the WinCC CSV registry override
Numeric values show as 8.74E+01 Missing NumberFormat in VBScript path Apply NumberFormat = "0.00" to numeric cells
Tag import shows "address already in use" Tag has same AS address as an existing tag in a different connection Verify the Connection column in the CSV before re-import
Trend export creates a 0-byte file No tags selected, or archive is not in "Archive" mode Switch trend data source to "Archive" and confirm tag assignment
VBScript hangs at CreateObject("Excel.Application") Excel running under SYSTEM with no desktop session Enable "Allow service to interact with desktop" on the WinCC service; kill orphan EXCEL.EXE processes
User Archive import skips rows silently Header row does not match archive columns exactly Re-export the archive, copy the header verbatim, and re-import
Decimal separator wrong after re-import (0.00 vs 0,00) Locale change between export and import workstations Lock the locale to one value (e.g. en-US) on both stations
Trend export loses time stamp precision (no ms) WinCC < V7.0 SP2 Update to SP3 or later; upgrade project

11. Performance & Licensing Notes

The VBScript OLE path carries the highest runtime cost. A single Excel.Application instantiation under WinCC V7.0 typically consumes 60–90 MB of private working set and 1–3 % CPU even when idle. For shift reports generated every 30 min, instantiate once at runtime start, reuse the objWorkbook reference, and call SaveAs on a timer. This pattern keeps Excel resident but reduces the per-export overhead from ~2.5 s to ~250 ms.

For archives that exceed 500 MB/day, retire the OLE path entirely and use a dedicated reporting tool (Siemens WinCC/PerformanceMonitor or Information Server) that reads the SQL store directly. The Information Server stack is the recommended path for plant-wide reports and supports both .xlsx and PDF without invoking Excel on the WinCC server.

Which WinCC V7 export method gives me a real .xlsx file with formatting?

Use the VBScript / OLE path (Method D in this article). The built-in CSV exports always produce plain text; only Excel.Application COM can write native .xlsx, apply NumberFormat, formulas, and multi-sheet layouts. See Siemens FAQ 16514261 for the canonical example.

Why do my numeric tags show as scientific notation in Excel?

You did not set NumberFormat on the destination cell. Add objSheet.Cells(r, c).NumberFormat = "0.00" for process values and "yyyy-mm-dd hh:mm:ss" for timestamps before writing the value. The default Excel general format renders doubles with up to 11 significant digits, producing 8.742E+01 for 87.42.

How do I export all logged trend values, not just the visible window?

Switch the Online Trend Control's data source to Archive mode and set the time range to cover the desired window, then click the export button. The runtime writes the full range to CSV, not just the currently displayed points. Details are in FAQ 25533776.

Can I edit the exported tag CSV in Excel and re-import it?

Yes for tag names, limits, and comments; risky for addresses and connections. Save the file as plain CSV (UTF-8 without BOM) using a text editor or Excel "CSV UTF-8 (Comma delimited)", never the default xlsx. Re-import via Tag Management → Import Tag. Inspect the project _Import.log for any rejected rows. The full procedure is in FAQ 22016422.

What is the difference between User Archive export and Tag Logging export?

User Archives hold operator-entered or recipe-type data (discrete records, indexed). Tag Logging holds time-series process values with a fixed acquisition cycle. Use User Archive export (CSV or DBF) for recipe and batch data per FAQ 8972156; use Online Trend Control export for time-series data per FAQ 25533776.

How much disk space does the Tag Logging archive need per day?

Uncompressed, a 200-tag REAL archive at 1 Hz consumes roughly 550 MB/day (200 × 24 B header + 200 × 8 B value = 6.4 kB/s). With deadband compression on slow process signals, real-world usage typically lands between 30 and 80 MB/day. Always configure an explicit retention policy in the Archive Manager to prevent disk-full conditions.

Back to blog