Recovering Siemens LOGO! 8 Data Log CSV Files from Micro SD

David Krause17 min read
Data AcquisitionSiemensTutorial / 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

The Siemens LOGO! 8 Base Module logs process variables, alarms, and counters to a micro SD card as comma-separated value (CSV) text files. Each data log file holds up to 20,000 lines, and the LOGO! maintains a rolling archive of up to 50 files per base module. LOGO!Soft Comfort's Upload Data Log command only transfers the most recent (currently active) file from the LOGO! to the engineering station. To recover any earlier, sealed file the engineer must stop the base module, remove the micro SD card, and copy the CSV files directly to a PC using any FAT32-aware card reader.

This reference documents the LOGO! 8 (6ED1052-xXX08-0BAx family) data-logging subsystem, the file rotation rules, the manual recovery workflow that bypasses LOGO!Soft Comfort, capacity calculations for common logging cadences, the CSV schema written by the LOGO!, service-interval planning, and a troubleshooting matrix for the most common file-handling faults. Cross-references to the official LOGO! 8 System Manual and the LOGO! product page at siemens.com/logo are provided throughout.

Data Log Architecture

The LOGO! data log subsystem is documented in chapter 4 of the LOGO! 8 System Manual. A micro SD card inserted into the base module becomes the primary non-volatile storage for the on-board data logger while the LOGO! is in RUN mode.

Storage Limits

Parameter Value
Max lines per data log file 20,000
Max data log files per LOGO! Base Module 50
File format CSV (RFC 4180 compatible)
Line ending CR+LF (0x0D 0x0A)
Field separator Semicolon (0x3B) on most firmware; comma (0x2C) on older builds
Decimal separator Period (0x2E) regardless of regional settings
Timestamp format YYYY-MM-DD hh:mm:ss (local LOGO! time)
Trigger sources Time-based, edge, or program event
Encoding (firmware 1.08.x and later) UTF-8 without BOM

File Rotation

When the active log file reaches the 20,000-line limit and free space exists on the SD card, the LOGO! closes the current file and opens a new one. Rotation is automatic; the LOGO! does not pause logging during the switch. If the SD card fills or already holds 50 files, the LOGO! either overwrites the oldest file or stops logging, depending on firmware behaviour and the SD card write-protect state. This silent overwrite is the most common cause of lost historical data in the field.

Why Direct SD Card Read Is Required

LOGO!Soft Comfort (LSC) provides a Data Log upload command accessible from Tools → Transfer → Upload Data Log. The function only uploads the currently active log file (the file to which the LOGO! is currently writing). Historical files remain resident on the SD card until the SD card is removed or the active file rotates.

The LSC upload limitation is by design: the LOGO! exposes only its current write buffer to the programming port. Earlier files are sealed (closed) and not re-served. To recover the full archive, the engineer must access the SD card as a USB mass-storage device on a PC. There is no command, web server function, or S7-style block that reads the older CSV files from the LOGO! without physically accessing the card.

Prerequisites

  1. One Siemens LOGO! 8 Base Module (6ED1052-xXX08-0BAx family) with the data log feature configured in the LSC program.
  2. A micro SD card formatted as FAT32 with sufficient free space. The Siemens LOGO! Card (6ED1057-1AA00-0BA0) is qualified for the LOGO!; third-party SDHC cards up to 32 GB are supported by LOGO! 8 firmware 1.08.x and later.
  3. A PC running Windows 10/11 with a micro SD card reader (built-in or USB adapter).
  4. Spreadsheet software that opens UTF-8 CSV (Microsoft Excel, LibreOffice Calc) or a parsing tool (Python pandas, R, awk).
  5. LOGO!Soft Comfort V8.0 or later installed locally if re-downloading the most recent log via LSC is desired as part of the same workflow.
  6. Maintenance window scheduled with operations: the LOGO! must be placed in STOP mode and outputs will de-energise per the configured STOP behaviour.
Stop the LOGO! before removing the micro SD card. Hot-removal does not corrupt the active file but leaves the new file in an undefined state until the LOGO! is restarted and a new logging cycle begins. Always copy first, verify, then delete.

Recovery Procedure: Stop - Read - Restart

Step 1 - Stop the Base Module

Set the LOGO! to STOP mode by one of the following methods:

  • Press ESC and OK simultaneously on the LOGO! with on-board display.
  • Toggle the LOGO! operating state from LSC using Tools → Transfer → Set LOGO! to Stop Mode.
  • Open the LOGO! web server (LOGO! 8.3 and later, firmware ≥ 1.08.05) and click Stop on the home page.

The display shows STOP. All outputs de-energise per the configured STOP output behaviour. Plan the stop for a maintenance window; the process is offline for the duration of the procedure.

Step 2 - Remove the Micro SD Card

Open the small hatch on the right side of the base module. Press the SD card in to release the spring-loaded socket, then withdraw the card. Place the card in an anti-static envelope if it will not be re-inserted immediately.

Step 3 - Mount on PC

Insert the micro SD card into the PC's card reader. Windows assigns a drive letter (for example E:). Open the drive in File Explorer.

Step 4 - Locate the CSV Archive

The LOGO! stores data log files in the root directory. The file names follow one of two patterns depending on firmware:


data_log_001.csv
data_log_002.csv
...
data_log_050.csv

or, on older firmware, the LOGO!-prefixed variant:


LOGO_001.csv
LOGO_002.csv
...

Open one file in Notepad to confirm the CSV header. A typical LSC V8.4 header line is:


"LOGO!";"6ED1052-2MD08-0BA2";"V1.08.05"
"Date";"Time";"Variable 1";"Variable 2";...;"Variable N"

Step 5 - Copy Files to PC

Copy all .csv files to a folder on the PC's hard drive named with the timestamp of the recovery (for example D:\LOGO_archive\2024-03-15_0815\). Do not delete the originals from the SD card until the copies are verified.

Step 6 - Verify Each CSV File

Open each file in a spreadsheet application. Confirm:

  • The header row is present.
  • The last row corresponds to the expected log time.
  • The number of data rows (excluding header) does not exceed 20,000.
  • Numeric values parse correctly with the period as decimal separator.
  • No blank rows interrupt the file.

Step 7 - Manage the SD Card

Decide between two strategies:

  • Preserve all files: Re-insert the SD card unchanged. The LOGO! continues writing to the active file. When the active file rotates and 50 files already exist, the LOGO! will not create a 51st file and may stop logging or overwrite the oldest, depending on firmware.
  • Archive then clear: Copy files to the PC, verify, then delete the files from the SD card. Re-insert the card. The LOGO! starts a fresh file on next START. This guarantees uninterrupted logging going forward and is the recommended procedure for production sites.

Step 8 - Restart LOGO!

Re-insert the SD card. Switch the LOGO! from STOP to RUN using:

  • Front-panel START key (LOGO! with display).
  • LSC Tools → Transfer → Set LOGO! to Run Mode.
  • Web server START button (LOGO! 8.3+).

Verify the LOGO! is logging by examining the SD card after a few cycles or by inspecting the data log status word in the program. The first new record should appear within one logging interval.

CSV File Structure Reference

The LOGO! data log CSV is a plain-text file. The first line is a fixed header that identifies the file and the LOGO! part number. Subsequent lines contain the data records. Example (from a 230 V base module, firmware 1.08.05):


"LOGO!";"6ED1052-2MD08-0BA2";"V1.08.05"
"Date";"Time";"AI1 (degC)";"AI2 (degC)";"Q1";"Counter B003"
2024-03-15;08:00:01;21.4;22.1;0;0
2024-03-15;08:01:01;21.5;22.3;1;7
2024-03-15;08:02:01;21.5;22.3;1;14

The header line wraps every field in double quotes; data values are unwrapped unless they contain a separator. The LOGO! does not write a trailing footer or end-of-file marker.

Decimal Separator

Regardless of the LOGO!'s configured language or the PC's regional settings, the LOGO! emits the period as decimal separator. Configure the spreadsheet import wizard to honour this when the PC uses comma decimal notation (German, French, Spanish locales). In Excel use Data → From Text/CSV and select English (United States) as the locale.

Encoding

LOGO! 8 firmware 1.08.x and later writes CSV files in UTF-8 without a BOM. Earlier firmware may use Windows-1252. Check the file with a hex editor (look for EF BB BF at offset 0) if non-ASCII variable names appear corrupted in Excel.

Variable Types

The data log captures up to 32 variables per record, regardless of type. The CSV writes the current value of each variable at the trigger instant.

Variable Type CSV Representation
Digital input / output / flag 0 or 1
Analog input / output Signed decimal (e.g. -12.50)
Counter current value Unsigned integer (e.g. 12345)
Timer current value Seconds remaining, unsigned integer
Message text (LOGO! 8.3+) Quoted UTF-8 string

Triggering a New Log File Without Removing the SD

A common request is to force the LOGO! to close the current file and start a new one without physically accessing the SD card. The reliable methods are:

  1. Program download: editing the LSC project and downloading to the LOGO! causes the data log to close the active file and open a new one on the next logging cycle. This is the only software-only trigger.
  2. Power cycle (OFF/ON): a cold restart closes the current file and opens a new file in the next RUN mode entry.
  3. STOP/RUN transition: this does not close the file or start a new one. The active file continues from the same buffer position when the LOGO! restarts.

There is no LSC menu command that closes the active data log file and opens a new one without a transfer or power cycle. The web server has no such command either. Plan the recovery cadence around these constraints.

Capacity Calculations

Use the following formulas to plan the SD card service interval.


T_full = 20000 * DeltaT_log
N_files_max = 50
T_archive = T_full * 50 = 1000000 * DeltaT_log

Where DeltaT_log is the configured logging interval in seconds, T_full is the time to fill one file, and T_archive is the time before the LOGO! must rotate or stop assuming files are not manually removed.

Worked Examples

Interval (DeltaT_log) T_full (one file) T_archive (50 files)
1 s 5.56 h 11.57 d
10 s 55.6 h 115.7 d
60 s (1 min) 13.89 d 694.4 d (approx 1.9 yr)
5 min (300 s) 69.4 d 9.49 yr
15 min (900 s) 208.3 d 28.5 yr
1 h (3600 s) 833.3 d 114 yr

At a 1-minute logging cadence, the LOGO! writes 20,000 lines in 13.89 days and fills the 50-file archive in approximately 1.9 years. A 1-second cadence fills one file in 5.6 hours and the archive in 11.6 days, so service intervals must be weekly at high cadences. A 1-hour cadence essentially never fills the archive in the equipment lifetime, but the engineer still needs a routine plan to copy and clear old files.

SD Card Specifications

Item Specification
Card type micro SDHC / micro SDXC
File system FAT32 (required)
Max capacity (LOGO! 8 firmware up to 1.08.05) 32 GB
Max capacity (LOGO! 8.3 / firmware 1.08.06+) 32 GB SDHC, SDXC subject to FAT32 limitation
Industrial-grade option Siemens LOGO! Card (6ED1057-1AA00-0BA0)
SLC vs TLC Industrial SLC strongly recommended for write-heavy data logs
Write endurance example (32 GB SLC) approx 100,000 P/E cycles per block
Write endurance example (32 GB TLC consumer) approx 1,000 P/E cycles per block
Operating temperature (industrial) -40 degC to +85 degC
Operating temperature (consumer) 0 degC to +70 degC
A data log written at 1 Hz produces approx 86,400 writes per day. A consumer-grade TLC card rated at 1,000 P/E cycles per block can fail within months under continuous 1 Hz logging. Use SLC or pSLC cards in production data logging applications, especially at sub-10-second cadences.

SD Card Partitioning

When the SD card holds the LSC program in addition to the data log, the LOGO! creates a fixed partition layout:

Partition Contents
\ (root) Program file (LOGO_001.bin or LOGO_UPD.bin), recipe files
\data_log\ CSV files (data_log_001.csv ... data_log_050.csv)
\web\ User-defined web server pages (LOGO! 8.3+)

Do not delete files from the root partition. Removing LOGO_001.bin erases the on-board program and forces a download from LSC. Only clear files from the data_log subdirectory.

Formatting the SD Card

  1. Insert the SD card into the PC's card reader.
  2. Open Disk Management (diskmgmt.msc).
  3. Locate the SD card (typically the last removable disk).
  4. Right-click each partition and choose Delete Volume.
  5. Right-click the unallocated space and choose New Simple Volume.
  6. Set file system to FAT32 (not exFAT, not NTFS), allocation unit size Default, volume label optional.
  7. Finish and verify the drive letter.
SDXC cards ship with exFAT. Windows can format them to FAT32 only if their capacity is 32 GB or below. For cards larger than 32 GB, use fat32format (a third-party utility) or partition with a smaller FAT32 partition followed by an unused remainder. The LOGO! will only read the first FAT32 partition.

Triggering the Data Log in the LSC Program

Configure the data log in LOGO!Soft Comfort by inserting the Data Log function block into the FBD or Ladder diagram:

  1. Drag the Data Log block from the Special Functions palette onto the program.
  2. Set the Parameter input to the value 01 for one log trigger source, or extend with additional triggers by appending values.
  3. Wire the enable (EN) input to a digital flag that runs while the LOGO! is in RUN mode.
  4. Click the block to open the Properties dialog and select up to 32 variables to capture per record.
  5. Set the logging interval on the Time tab (1 s to 24 h).
  6. Compile and download to the LOGO!.

When the block EN transitions from 0 to 1, the LOGO! opens the first file. When 20,000 records have been written, the LOGO! closes the file and opens the next sequential index.

Recommended Service Procedure for Production Sites

  1. Schedule a maintenance window long enough to stop the process safely.
  2. Stop the LOGO! and remove the SD card.
  3. Mount the card on a PC and copy all *.csv files from the \data_log\ folder to a timestamped backup folder on the engineering file server.
  4. Verify the file count, the most recent record timestamp, and the absence of any zero-byte files.
  5. Delete files from the SD card only after backup verification. Leave the program partition untouched.
  6. Re-insert the SD card and restart the LOGO!.
  7. Log the service action with operator signature, SD card serial number, and verification timestamp.
  8. Archive the recovered CSVs to the plant historian or document management system within 24 hours.

Integration with Plant Historian

Recovered CSV files can be ingested directly into a historian using standard utilities.

Python (pandas)


import pandas as pd

df = pd.read_csv(
    'data_log_001.csv',
    sep=';',
    skiprows=2,
    encoding='utf-8',
    decimal='.'
)
df.columns = ['Date','Time','AI1','AI2','Q1','Counter']
df['timestamp'] = pd.to_datetime(df['Date'] + ' ' + df['Time'])
df = df.drop(columns=['Date','Time'])
print(df.head())

InfluxDB


influx write \
  --bucket plant \
  --org maintenance \
  --file data_log_001.csv \
  --header '#datatype,string,string,double,double,boolean,long' \
  --header 'measurement,tag,time,field,field,field,field' \
  --header 'logo_archive,,,AI1,AI2,Q1,Counter'

AVEVA PI

Use the PI Interface for OPC with a CSV relay, or PI Connector with the CSV_UFL interface. Configure the INI to point at the archived folder and add a periodic re-scan trigger.

SD Card Recovery from a Corrupt File System

If the SD card file system is corrupted (often after a power loss during a write), Windows may prompt to format the card. Do not format immediately. Follow this recovery sequence:

  1. Connect the SD card to a Linux or Windows machine that does not auto-mount it writeable.
  2. Use ddrescue to create a bit-for-bit image of the card to a file: ddrescue /dev/sdX logo_sd.img logo_sd.log
  3. Mount the image read-only: mount -o ro,loop logo_sd.img /mnt/recover
  4. Copy any readable *.csv files from /mnt/recover/data_log/.
  5. For files that did not survive, run testdisk or photorec against the image to carve CSV-like text fragments.
  6. Reconcile fragmented records by timestamp and variable signature before re-ingestion.
Always work from an image, never the original card. A recovery attempt that writes to the corrupt card can overwrite the very sectors holding the unsealed CSV files. Once the image is captured, multiple recovery attempts are safe.

Troubleshooting Matrix

Symptom Likely Cause Resolution
LOGO! does not write a CSV file SD card not inserted, write-protected, or not FAT32 Re-format as FAT32 on PC; disable write-protect tab; reinsert
Only one file is ever visible on the SD Active file not yet full; LOGO! does not rotate Wait until 20,000 lines or trigger rotation by power cycle / program download
Old files disappear after re-inserting SD 50-file limit reached; LOGO! overwrites oldest Service the SD card more frequently; copy and delete old files on schedule
CSV opens in Excel with dates as numbers Excel auto-converts ISO date Import with "Text" column type or use "From Text/CSV" wizard
Decimal separator appears as comma in Excel Regional settings differ from LOGO! Specify English (United States) locale in import wizard
File header shows truncated variable names Firmware version writes legacy header Upgrade firmware to at least 1.08.05 or use the parser to handle both formats
LSC Upload Data Log returns error "No data log found" SD card removed before upload, or no data log configured Re-insert SD card; configure data log block in LSC program
Active file size exceeds expected row count Multi-line variable values or pre-header lines Open in text editor; reconcile with the LOGO! firmware release notes
SD card unreadable on Windows File system corruption from hot-removal during write Image the card with ddrescue; recover CSVs from the read-only image
Web server shows SD card full 50-file limit reached or card write-protected Service the SD card; remove write-protect tab
New file does not appear after STOP/RUN STOP/RUN does not trigger rotation Download program from LSC or power cycle the LOGO!
File count exceeds 50 on the card SD card was used in a different LOGO! Clear the data_log folder, then reinsert and restart
CSV shows only the header, no data Data Log block EN not active in program Verify the EN input of the Data Log block in LSC

Safety Considerations

  • Placing the LOGO! in STOP de-energises outputs per the configured STOP output behaviour. Verify that the process tolerates an offline state for the duration of the SD swap.
  • If the LOGO! controls a safety function, perform the SD recovery only after the safety function has been transferred to a redundant system or the process has been placed in a safe state.
  • Always verify the recovered CSV data against an independent measurement (e.g. panel meter) before deleting the files from the SD card.
  • Do not connect the SD card to a PC that has autorun enabled. Disable autorun via Group Policy before inserting unknown media.

Differences Across LOGO! 8 Generations

Generation Typical Part Number Firmware Notable Data Log Differences
LOGO! 8 (0BA8) 6ED1052-xXX08-0BA8 1.08.01 Up to 20,000 lines/file, 50 files, no web server
LOGO! 8.1 (0BA1) 6ED1052-xXX08-0BA1 1.08.02 Same data log limits, improved SD card handling
LOGO! 8.2 (0BA2) 6ED1052-xXX08-0BA2 1.08.03 Same data log limits, faster SD card write
LOGO! 8.3 (0BA3) 6ED1052-xXX08-0BA3 1.08.05 Web server, message text logging, UTC option
LOGO! 8.4 (0BA4) 6ED1052-xXX08-0BA4 1.08.06 Improved SDXC handling, larger recipe storage

FAQ

Can I read the older LOGO! data log files without removing the SD card?

No. LOGO!Soft Comfort's Upload Data Log function transfers only the currently active file from the LOGO! to the engineering station. Earlier, sealed files are not exposed by the programming protocol. The only supported method to read more than one file is to stop the LOGO!, remove the micro SD card, and copy the CSV files directly to a PC.

How many lines can a single LOGO! data log file contain?

Up to 20,000 lines per file. The LOGO! automatically closes the file and opens a new one when this limit is reached, provided the SD card has free space and the 50-file-per-base-module limit has not been reached.

How many data log files can the SD card hold?

Up to 50 data log files per LOGO! Base Module. Beyond this limit, the LOGO! overwrites the oldest file or stops logging depending on firmware version and available SD capacity. Plan a service interval that copies and clears files before the limit is reached.

Does a STOP/RUN transition start a new data log file?

No. The STOP/RUN transition alone does not close the active log file. The LOGO! continues the same file when restarted. To force a new file, perform a program download from LOGO!Soft Comfort or a full power cycle.

What file format does the LOGO! use for data logs?

Plain-text CSV. The decimal separator is the period, and the timestamp format is YYYY-MM-DD hh:mm:ss in the LOGO!'s local time. The file is encoded in UTF-8 without BOM on firmware 1.08.x and later.

How long will a 1 Hz data log take to fill the SD card archive?

At a 1-second logging cadence, one file of 20,000 lines fills in 5.56 hours. With 50 files per base module, the full archive fills in approximately 11.6 days if files are not removed. Plan the service interval accordingly, and use an SLC or industrial-grade SD card to avoid premature write-endurance failure.

What happens if I hot-remove the SD card while the LOGO! is writing?

The active file may be truncated to the last successfully flushed block. The LOGO! does not write a partial record after reinsert, but the CSV header may be missing if the rotation was mid-file. Always recover from an image if the SD card file system reports errors after a hot removal.

Back to blog