Configuring WinCC V7.0 Data Logging to Excel: Step-by-Step

David Krause12 min read
SCADA ConfigurationSiemensTutorial / 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

Configuring WinCC V7.0 Data Logging to Excel: Step-by-Step

Overview

Siemens WinCC V7.0 (and the wider V7.x family through V7.5 SP2) provides three independent mechanisms for persisting process values: the integrated Tag Logging subsystem (process value archive), the optional DataMonitor add-in for browser- and Excel-based reporting, and user-driven scripting through the Global Script / VBScript runtime object model. For HT panel metering where the requirement is to capture voltage, current, kVA, kW, and kVAR against a timestamp and produce an Excel-compatible record, all three layers are commonly combined: Tag Logging for the high-integrity time-series store, DataMonitor or a VBScript export routine to materialize the records into a workbook, and the WinCC scheduler for periodic printouts.

This reference covers the full commissioning flow used in the field: archive topology, tag parameter mapping, runtime display, Excel export via the official DataMonitor add-in, scripted fallback exports, 8-hour scheduled printouts, and a cross-reference to the newer TIA Portal WinCC Professional (RT Professional) flow documented at Data logging (RT Professional).

Architecture and Component Map

WinCC V7.0 splits logging into four editors that live inside the WinCC Explorer tree:

Editor Role Typical Use
Tag Management Process / internal tag definitions, drivers, channels Source of all logged values
Tag Logging Process Value Archive (SQL Server), segments, swap-out Long-term time-series of metering
Alarm Logging Message archive with acknowledge logic Optional event correlation
Report Designer / Print Jobs Layout files (.rpl) and Print Job orchestration Shift / 8-hour report export

The Archive Manager service (running under the SYSTEM account) is responsible for moving Tag Logging segments from the ring buffer into the configured storage path. By default segments live under <ProjectPath>\ArchiveManager\TagLogging\. For multi-user stations you also deploy WinCC Server / WinCC Client and can activate the Central Server Archive (CS Archive) so that the SQL Server is hosted on a single node and remote clients read it via the WinCC channel.

Prerequisites

  1. WinCC V7.0 base package installed and licensed on the engineering station.
  2. SQL Server 2005/2008 instance running locally or on the archive server (WinCC installs its own instance by default).
  3. Tags already defined in Tag Management with valid driver connections (e.g., SIMATIC S7 PROTOCOL SUITE, Modbus TCP, OPC).
  4. For Excel add-in flow: DataMonitor option package licensed and installed on the server, plus the Excel add-in installed on each client.
  5. User must be a member of the local Windows group SIMATIC HMI VIEWER (read) or SIMATIC HMI (write) for runtime access.
  6. File system write permission on the export folder (commonly D:\WinCC_Logs\ or a shared UNC path).
Note: The Tag Logging editor is only available with a valid WinCC RT license. Without RT the archive is created but no runtime data is captured.

Configuring Process Value Archives

  1. Open the WinCC Explorer and double-click Tag Logging.
  2. Right-click the Archives node and select Archive Wizard → Create Process Value Archive.
  3. Assign a descriptive name (e.g., HTPanel_Archive) and choose the archive type Tag Logging (process value archive).
  4. In the next wizard step select the tags from Tag Management that you want archived. Use Add Tags and filter by driver or prefix to locate HT panel variables quickly.
  5. Define the Acquisition cycle (the rate at which the runtime samples the tag) and the Archiving cycle (must be an integer multiple of the acquisition cycle).
  6. Configure Segmentation: 1 day, 1 week, or 1 month per segment. Daily segmentation is recommended for HT panel logging so that each shift's data is isolated for export.
  7. Set the Selection action: Actual value, Average, Sum, Min, or Max. Use Average for voltage / current and Sum for active / reactive energy counters.
  8. Configure Limits for segment size and total archive size to prevent uncontrolled disk growth.
Parameter Typical HT Panel Value Comment
Acquisition cycle 1 s Sufficient for 50/60 Hz RMS metering
Archiving cycle 5 s Multiple of acquisition
Segmentation 1 day One segment per shift / day boundary
Selection Average Smooths transients
Segment size limit 50,000 values ~70 h of 5 s values

Tag Parameters for HT Panel Power Monitoring

Map the metering signals coming from the HT panel PLC / multifunction meter into the WinCC tag namespace before archiving. The following table is a typical mapping using either SIMATIC S7 area pointers or Modbus registers. Adjust addresses to your panel and meter.

WinCC Tag Data Type Source (S7 Example) Engineering Unit Range
VL1_L1_N Float DB10.DBD0 (REAL) V 0 – 500
VL1_L2_N Float DB10.DBD4 V 0 – 500
VL1_L3_N Float DB10.DBD8 V 0 – 500
Current_Phase_A Float DB10.DBD12 A 0 – 2000
Current_Phase_B Float DB10.DBD16 A 0 – 2000
Current_Phase_C Float DB10.DBD20 A 0 – 2000
Total_kVA Float DB10.DBD24 kVA 0 – 5000
Active_Power_kW Float DB10.DBD28 kW -3000 – +3000
Reactive_Power_kVAR Float DB10.DBD32 kVAR -3000 – +3000
Power_Factor Float DB10.DBD36 — -1.0 – +1.0
Frequency_Hz Float DB10.DBD40 Hz 45 – 65
Sizing: For apparent power on a three-phase system the field-proven relation is kVA = sqrt(3) x V_LL x I_line / 1000. If the meter publishes 360 A as line current and V_LL = 415 V, the theoretical kVA = sqrt(3) x 415 x 360 / 1000 = 258.7 kVA. If 360 A is a per-phase RMS, multiply by 3 inside the PLC before publishing to keep the tag semantically clean.

Runtime Display with Online Table Control

Before exporting data the operator should be able to view the archive in runtime.

  1. Open Graphics Designer and open the target picture.
  2. From the Smart Library → Windows Controls palette insert WinCC Online Table Control.
  3. Configure the column properties to bind each column to one of the archive tags from the previous section.
  4. On the General tab set the time range (e.g., Last 1 hour) and refresh rate to match the archiving cycle.
  5. Optionally insert a WinCC Online Trend Control for graphical trend visualization; bind the same tags.
  6. Activate the project. The control will populate from the SQL Server archive and from the live runtime buffer.

The Online Table Control can also export a CSV directly via its context menu (Export → CSV / TXT). This is useful for ad-hoc operator exports but does not meet a scheduled, unattended Excel-record requirement.

Excel Export via DataMonitor Add-in

Siemens DataMonitor is the supported path for unattended Excel output. Install the DataMonitor server component on the WinCC server and the DataMonitor client on the workstation that needs Excel access.

  1. Run WinCC DataMonitor Server setup on the archive server. Restart the WinCC services when prompted.
  2. On the engineering station run Web Configurator (Start → SIMATIC → WinCC → Web Configurator) and publish the project. Tick DataMonitor and assign the WinCC users that should have read access.
  3. Verify that SQL Server Configuration Manager is running with the WinCC instance and that the TCP/IP listener is enabled on port 1433.
  4. On the operator workstation install Microsoft Excel 2010 or later and the DataMonitor Excel Workbook Add-in.
  5. Start Excel → DataMonitor ribbon → Connect. Enter the WinCC server name, project name, and credentials.
  6. Click Insert WinCC Values and choose the archive tags from the project tree. The workbook renders one column per tag with timestamp rows from the archive.
  7. Define the refresh interval (5 s, 10 s, 30 s, 1 min, …). The add-in polls the archive and refreshes the worksheet while Excel remains open.
  8. To save the workbook snapshot use Excel's native Save As or schedule an Excel macro that triggers at a fixed wall-clock time.
Note: DataMonitor does not natively push the workbook to disk without an open Excel instance. For a true unattended scheduler, pair DataMonitor with a Windows Task Scheduler job that opens the workbook, waits for the refresh, and saves it through the Excel COM interface.

Scripted Excel Export (VBScript Global Script)

Where DataMonitor cannot be licensed, or where the export must be fully unattended and self-contained inside WinCC, use a Global Script action bound to a 1-second, 1-minute, or 5-minute trigger. The script below writes a timestamped XLSX each cycle.

' ExportTagValues.vbs - Cyclic Excel export from WinCC V7.0
' Trigger: Global Script action, 1-minute cycle
Dim objExcel, objWorkbook, objSheet
Dim sFilePath, sTimestamp
Dim iRow

sTimestamp = Year(Now) & "_" & Right("0" & Month(Now), 2) & "_" & _
             Right("0" & Day(Now), 2) & "_" & Right("0" & Hour(Now), 2) & _
             Right("0" & Minute(Now), 2) & Right("0" & Second(Now), 2)
sFilePath = "D:\WinCC_Logs\HTPanel_" & sTimestamp & ".xlsx"

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible  = False
objExcel.DisplayAlerts = False

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

objSheet.Cells(1,1).Value  = "Timestamp"
objSheet.Cells(1,2).Value  = "VL1 (V)"
objSheet.Cells(1,3).Value  = "VL2 (V)"
objSheet.Cells(1,4).Value  = "VL3 (V)"
objSheet.Cells(1,5).Value  = "IL1 (A)"
objSheet.Cells(1,6).Value  = "IL2 (A)"
objSheet.Cells(1,7).Value  = "IL3 (A)"
objSheet.Cells(1,8).Value  = "kVA"
objSheet.Cells(1,9).Value  = "kW"
objSheet.Cells(1,10).Value = "kVAR"
objSheet.Cells(1,11).Value = "PF"

iRow = 2
objSheet.Cells(iRow,1).Value  = Now
objSheet.Cells(iRow,2).Value  = HMIRuntime.Tags("VL1_L1_N").Read
objSheet.Cells(iRow,3).Value  = HMIRuntime.Tags("VL1_L2_N").Read
objSheet.Cells(iRow,4).Value  = HMIRuntime.Tags("VL1_L3_N").Read
objSheet.Cells(iRow,5).Value  = HMIRuntime.Tags("Current_Phase_A").Read
objSheet.Cells(iRow,6).Value  = HMIRuntime.Tags("Current_Phase_B").Read
objSheet.Cells(iRow,7).Value  = HMIRuntime.Tags("Current_Phase_C").Read
objSheet.Cells(iRow,8).Value  = HMIRuntime.Tags("Total_kVA").Read
objSheet.Cells(iRow,9).Value  = HMIRuntime.Tags("Active_Power_kW").Read
objSheet.Cells(iRow,10).Value = HMIRuntime.Tags("Reactive_Power_kVAR").Read
objSheet.Cells(iRow,11).Value = HMIRuntime.Tags("Power_Factor").Read

objWorkbook.SaveAs sFilePath, 51     ' xlOpenXMLWorkbook (.xlsx)
objWorkbook.Close False
objExcel.Quit

Set objSheet    = Nothing
Set objWorkbook = Nothing
Set objExcel    = Nothing

Attach this action to a Global Script trigger with cycle = 60 s (or call it from a Print Job "On Print" event to bundle the export with the printout). For continuous append logging replace Workbooks.Add with Workbooks.Open against a persistent file and append a row at the next empty cell.

Scheduled 8-Hour Print Job Configuration

WinCC V7.0 print jobs are native to the runtime and do not require a third-party scheduler. Use them for the customer's "printout every 8 hours" requirement.

  1. In Graphics Designer build a layout using the Report Designer. Insert a WinCC Online Table Control bound to the HT panel archive and a header line for Printed at.
  2. Save the layout as @HTPanel_8h.rpl in the project PRT folder.
  3. Open WinCC Explorer → Print Jobs. Right-click and select New Print Job. Choose Report as the type and select the layout file from step 2.
  4. Tick Print at start of Runtime off; we want event-driven printing.
  5. Switch to Global Script → Actions and create a new action that calls the print job on an 8-hour boundary:
' ScheduleHTPanelPrint.vbs - Trigger at 00:00, 08:00, 16:00 local
If Hour(Now) Mod 8 = 0 And Minute(Now) = 0 And Second(Now) = 0 Then
    Dim sJob
    sJob = "HTPanel_8h_Report"
    HMIRuntime.Print sJob
End If
  1. Configure the trigger cycle to 1 second so the condition is checked frequently enough.
  2. Bind the print job's output target to File with path D:\WinCC_Logs\Reports\HTPanel_8h_<Date>.pdf, or to a physical printer share for hard-copy delivery.

To make the export bulletproof against script timing jitter, prefer a Windows Task Scheduler job calling the same layout through WinCC Reporter or a separate WinCC runtime instance launched with /PRINT command-line arguments. The Global Script approach is simpler and is sufficient for most HT panel deployments.

TIA Portal WinCC Professional Cross-Reference

Projects migrating to TIA Portal WinCC Professional (RT Professional) use a slightly different model. The logging system is configured from the project tree under Logs → Data logs; each log references one or more logging tags, a logging cycle, and a backing SQLite or SQL database. The official Siemens engineering documentation for the V20 release is available at Data logging (RT Professional). Export to Excel in that environment is handled either through the runtime's Export function on the table control or via the Reports editor. The conceptual mapping between the two product lines is:

Concept WinCC V7.x TIA Portal WinCC Professional
Time-series store Process Value Archive (SQL Server) Data log (SQLite / SQL)
Tag binding Tag Logging editor → Add Tag Data log → Logging tags
Excel integration DataMonitor add-in Online Table Control → Export
Scripted export VBScript + HMIRuntime object VBScript or C# via RT Professional API
Periodic report Print Job + Global Script trigger Scheduled task + Reports editor

Commissioning and Verification

Run the following checklist before handing the panel over to operations:

  1. Confirm every tag in the HTPanel_Archive shows non-zero values in the WinCC Online Table Control after one full archiving cycle.
  2. Force a print job manually from Print Jobs → Run and inspect the resulting PDF / printed page for correct units and decimals.
  3. Verify that the archive segment files appear under <ProjectPath>\ArchiveManager\TagLogging\ at the configured boundary (e.g., midnight).
  4. Check the WinCC Explorer → Tools → Status of Server / Drivers dialog for red or yellow entries on the Tag Logging channel.
  5. Trigger a sample Excel export via the script action and confirm the file opens in Excel without prompts.
  6. Validate the 8-hour scheduled printout by temporarily setting the trigger to 1 minute and reverting after confirmation.
  7. Inspect Windows Event Viewer → Application for any WinCC or SQL Server errors during the test window.

Troubleshooting Matrix

Symptom Likely Root Cause Corrective Action
Archive columns empty in runtime Tag Logging runtime not started / archive not activated Right-click archive in Tag Logging → Properties → Start Archive = ON
Tags show ### in table Column width too narrow or unit mismatch Stretch column; verify engineering units in Tag Management
DataMonitor connection refused Web Configurator not run / firewall on port 80/443 Re-run Web Configurator, open the port, restart IIS
Excel file locked after script run Excel instance not Quit or process orphaned Add objExcel.Quit + Set objExcel = Nothing; check Task Manager
Print job fires at wrong time Trigger cycle too coarse / system clock skew Use 1 s cycle, sync server with NTP
Segments not swapped out Archive Manager service stopped Restart CCArchiveManager service under SYSTEM account
VBScript error "Permission denied" on SaveAs WinCC service user lacks write permission on target Grant Modify on the export folder to the WinCC runtime user
kVA reads zero despite current flowing Voltage tag scaled wrong or PF signed incorrectly Re-check meter scaling; remember kVA = sqrt(3) * V_LL * I_line / 1000

Frequently Asked Questions

Can WinCC V7.0 export directly to .xlsx without scripting or DataMonitor?

No. WinCC V7.0's built-in Online Table Control exports CSV/TXT only. To produce true .xlsx files you must either install the DataMonitor Excel add-in or run a Global Script VBScript that drives the Excel COM interface, as shown in the Export script above.

What is the minimum archiving cycle for HT panel metering?

1 s acquisition with 5 s archiving is the field-proven baseline for 50/60 Hz RMS metering. Faster cycles (250 ms / 500 ms) are supported but require sufficient disk I/O and may exceed WinCC's license-point budget on large installations.

How do I schedule an Excel export every 8 hours?

Bind a Global Script action to a 1-second trigger and evaluate Hour(Now) Mod 8 = 0 And Minute(Now) = 0; inside the conditional branch call your export routine. Alternatively, pair DataMonitor with Windows Task Scheduler to open, refresh, save, and close the workbook.

Where are the archived segments physically stored?

By default under <WinCC ProjectPath>\ArchiveManager\TagLogging\. For multi-user deployments enable the Central Server Archive so all clients read from a single SQL Server instance on the WinCC server.

Does this procedure apply to TIA Portal WinCC Professional?

The conceptual flow is identical (define tags → create data log → bind to table control → export), but the editor names differ. Refer to the official Siemens RT Professional documentation at Data logging (RT Professional) for the TIA Portal V20 configuration steps.

Back to blog