Configure CSV data logging in Siemens systems

A practical review of CSV data logging in Siemens controllers and HMIs: what the CSV format changes, how delimiters, decimals and encoding affect usability, and when another format fits better.

Logging process values to CSV is one of the most common ways to get data out of a Siemens automation system and into a spreadsheet, script or database. The format is simple, but whether the resulting file stays useful depends on choices made during configuration: delimiter, decimal separator, timestamp format, character encoding and where the file is stored. This review explains what CSV logging changes about your data, where it tends to break, and when a different format is the better choice.

Evidence note: no product-specific measurements, version numbers, storage limits or test results were supplied for this article. Feature descriptions below reflect general, documented concepts in Siemens tooling and general CSV behavior. Confirm the exact options, limits and menu names in the documentation for your controller firmware, TIA Portal version and HMI runtime before relying on them.

Where CSV logging happens in Siemens systems

In practice, “Siemens data logging to a CSV file” usually refers to one of two routes, and they differ in who writes the file and where it ends up.

  • Controller-side logging: S7-1200 and S7-1500 CPUs provide data log instructions (such as DataLogCreate, DataLogOpen, DataLogWrite, DataLogClose and DataLogNewFile) that let the PLC program write records to CSV files in the CPU's load memory, typically on the memory card. Where the CPU web server is enabled, these files can usually be downloaded through it.
  • HMI-side logging: WinCC runtimes on operator panels and PCs can archive tags to data logs. Depending on the runtime and device, the storage options may include a CSV file alongside other formats such as a database or Unicode text. Newer runtimes may favor database storage with export rather than direct CSV logging, so check what your specific runtime offers.

The controller route keeps logging independent of the HMI and is defined in the PLC program, which means you control the record structure directly. The HMI route is configured rather than programmed and is often easier to set up, but it depends on the HMI being powered and running, and its file layout is determined by the runtime.

Is CSV logging suitable for your intended use?

CSV is a good fit when you need moderate amounts of tabular data that people or scripts will open with ordinary tools, and when the people receiving it can agree on a delimiter, decimal convention and encoding. Its main benefit is portability: almost any spreadsheet, programming language or import tool can read it without Siemens software.

The decisive tradeoff is that CSV carries no type information and no settings. A value logged as a REAL, a timestamp or a status code becomes plain text, and the reader has to guess how to interpret it. When the writer and reader use different regional conventions, numbers and dates can be misread silently rather than producing an obvious error.

Another format is usually preferable when you need guaranteed data types, very high logging rates, concurrent access by several applications, long-term retention with querying, or audit-grade integrity. In those cases a database or historian, or a structured format agreed with the receiving system, is typically more robust. A simpler plain-text log without columns can also be preferable for event or alarm messages that are read by people rather than analyzed.

What converting process data to CSV actually changes

Writing a log record to CSV converts in-memory values into characters. That conversion is a stored change: the file contains text, not the original binary values. Several properties of the data are fixed at this point.

  • Numeric precision: floating-point values are written with a certain number of digits. Once written, any precision that was not included is gone.
  • Decimal separator: a value may be written with a period or a comma, depending on the writer's settings or locale.
  • Field delimiter: columns are separated by a comma, semicolon or another character. If the decimal separator is a comma, the delimiter is normally a semicolon to avoid ambiguity.
  • Timestamps: date and time are written in a particular format and, importantly, in a particular time reference such as local time or UTC. The file itself usually does not state which.
  • Encoding: tag names, units and text fields are stored in a specific character encoding. Non-ASCII characters such as degree signs or accented letters are where mismatches show up.
  • Header row: column names may be written once at file creation. If the record layout changes later, older files and newer files may no longer match.

It helps to separate these stored changes from presentation. When you open a CSV file in a spreadsheet, the spreadsheet interprets the text and displays it according to its own rules. It may drop leading zeros from codes, show long numbers in scientific notation, or reinterpret strings as dates. The file on disk is unchanged until you save it from the spreadsheet; at that point the spreadsheet's interpretation is written back and the original text may be permanently altered.

The following is an illustrative example, not output captured from a Siemens device. It shows the same two records written with two common conventions.

Timestamp,Temperature,Pressure
2026-01-15 08:00:00,21.5,1.013
2026-01-15 08:01:00,21.7,1.012

Timestamp;Temperature;Pressure
15.01.2026 08:00:00;21,5;1,013
15.01.2026 08:01:00;21,7;1,012

Both files describe the same values. A reader configured for the first convention will misparse the second: the comma inside 21,5 may be taken as a column break, or the value may be imported as text. A reader configured for the second may treat 1.013 as one thousand thirteen. This is the most frequent cause of “the CSV opens but the numbers are wrong.”

Configuration points to decide before logging starts

  • Choose the logging route: controller instructions for program-defined records, or HMI data logs for configured archiving.
  • Define the record layout once: which tags, in which order, with what header names. Plan for how a layout change will be handled, for example by starting a new file.
  • Agree on delimiter and decimal separator with whoever will consume the files, and document the choice alongside the files.
  • Fix the timestamp format and time reference. Record whether times are local or UTC and how daylight saving transitions are handled.
  • Confirm the character encoding the writer uses and whether the consuming tool expects a byte order mark.
  • Set file rollover and size behavior so a single file does not grow without bound, and decide how old files are removed or archived. Check the storage and file-count limits for your device in its documentation rather than assuming them.
  • Decide how files will be retrieved: web server download, file transfer from the HMI, removable media or an automated collector. Consider access control for each route.
  • Test with a realistic sample in the actual destination tool before deploying.

Will the file remain readable and usable after copying or sharing?

Because CSV is plain text, copying the file preserves its content exactly. Problems arise when it is opened, pasted or re-saved by a tool with different assumptions.

  • Opening by double-click: spreadsheets often apply the computer's regional list separator and decimal settings automatically. A file that opens cleanly on one computer can appear as a single column on another. Using the spreadsheet's explicit import function, where you choose delimiter, decimal separator and encoding, is more reliable.
  • Pasting into documents or chat: pasted CSV usually arrives as unaligned text. Converting to TSV can make pasting into spreadsheets more predictable, because tabs are rarely present inside values and many spreadsheets split tab-separated text into columns on paste.
  • Re-saving: saving from a spreadsheet can change the delimiter, encoding, date format and number formatting. Keep the original logged file as the reference and work on copies.
  • Search: plain-text CSV is easy to search with ordinary tools, but only for text as written. Searching for 21.5 will not find 21,5.

On accessibility, a CSV file has no visual styling or reading-order tricks; its content is sequential text. Raw CSV is not pleasant to listen to, though, because a screen reader may read every delimiter or run fields together. Opening the data as a proper table, where column headers are associated with cells, generally gives assistive technology users a better structure. No assistive technology was tested for this article, so confirm behavior with the specific screen reader and spreadsheet your readers use.

A separate plain-language summary is worth providing when logged data is shared with people who need conclusions rather than raw values, such as a report stating the period covered, units, time reference and any gaps or anomalies. The CSV remains the source data; the summary makes it understandable without parsing it.

CSV compared with alternatives at a glance

Need | CSV | TSV | Database or historian
Open without special software | Yes | Yes | Usually needs a client or export
Preserve data types | No | No | Yes
Robust to decimal-comma locales | Only if delimiter chosen carefully | Better, since tabs rarely conflict | Not affected
Paste into spreadsheets | Often needs import settings | Often splits into columns on paste | Not applicable
Querying and long-term retention | Limited | Limited | Designed for it

Open questions this review could not resolve

Without version-specific documentation or test results, this article cannot state the default delimiter, decimal handling, encoding, maximum file size, record limits or write performance for any particular Siemens CPU or HMI runtime. Those details vary by product and version and should be checked in the relevant system manual and tested on the target hardware. The same applies to how specific spreadsheet versions handle these files, and to any data retention or privacy implications of where log files are stored and how they are retrieved.