1. Problem Summary
Engineers using the Siemens LOGO! 8 (6ED1052-xxx08-0BA8) base module for process data acquisition occasionally observe two related anomalies when reviewing the comma-separated value (CSV) files produced by the on-board Data Log function block:
-
Missing records at the start, end, or middle of a capture session when the micro SD card is pulled while the LOGO! is in
RUNmode. -
Spurious digital ones (1) appearing in the logged column for
I1,I2,I7, orI8even though no discrete field wiring is connected to those terminals and the analog voltage is changing between 0 V and 10 V.
Both symptoms are not application bugs; they are the documented behavior of the LOGO! 0BA8 firmware combined with operator handling that does not follow the device manual. This guide walks through the exact root causes, the firmware-level buffer mechanism, the dual-function input behavior, and the verified handling procedure that prevents the loss of logged rows.
STOP through the on-board display) before inserting or removing the micro SD card. Hot-removal can corrupt the FAT file system, damage the card, or leave the LOGO! executing a program that requires a missing card.2. Hardware Identification and Data Log Architecture
Confirm the exact module before applying the fix. The Data Log architecture described here applies to the LOGO! 8 generation (order suffix 0BA8) — for example:
| Module | Order Number (example) | Data Log Buffer | Card Interface |
|---|---|---|---|
| LOGO! 8 BM (no display) | 6ED1052-1MD08-0BA8 | 1024 bytes RAM | micro SD, up to 32 GB |
| LOGO! 8 BM (with display) | 6ED1052-1HB08-0BA8 | 1024 bytes RAM | micro SD, up to 32 GB |
| LOGO! 8.3 BM (with Ethernet) | 6ED1052-1MD08-0BA8 | 1024 bytes RAM | micro SD, up to 32 GB |
The Data Log block is configured in LOGO! Soft Comfort V8.x (program file extension .lsc) and writes a single CSV file per session to the \LOGO\ directory on the micro SD card. A typical line in the file looks like:
Date;Time;AI1;AI2;AI3;AI4;I1;I2;I3;I4;I5;I6;I7;I8;Q1;Q2
2024-04-12;08:00:01.234;1.245;0.000;2.100;8.640;0;1;0;0;0;0;0;0;1;0
The data path is:
- Data Log block samples the configured tags at the configured interval.
- Records are pushed into a 1024-byte ring buffer in the LOGO! RAM.
- When the buffer reaches 512 bytes (half full), the firmware automatically flushes the buffered records to the SD card.
- When the Data Log block receives a stop signal (session end), the remaining buffered records are flushed.
This two-stage architecture is the entire root cause of the missing-entries symptom.
3. Root Cause #1 — SD Card Buffer Flush Behavior
Per the Siemens Industry Online Support article Data log - LOGO! (ID 109741041), the LOGO! 0BA8 stores data logs in a 1024-byte internal buffer. Only when the buffer content reaches 512 bytes does the firmware open the CSV file on the SD card, append the accumulated rows, and close the file again.
The consequences of this design are:
- At session start, between one and N records can sit in the buffer waiting for the half-full mark. If the operator pulls the card before that threshold is reached, those records are lost because they were never written.
- At session end, between one and N records can remain in the buffer. If the card is removed while the LOGO! is still in
RUN, the firmware does not perform a final flush and the closing rows are lost. - If power is removed abruptly (24 V drop-out, breaker trip, emergency stop), the unwritten buffer contents are lost because RAM is volatile.
The Siemens manual section 9.2 Inserting and removing the card from LOGO! is explicit:
"A removal of the card during RUN mode can lead to impermissible operating states. LOGO! can only execute the circuit program stored on the card if the card remains inserted during system runtime."
The mitigation recommended by Siemens (and confirmed in field installations) is to stop the LOGO! before removing the card. Stopping the LOGO! causes the Data Log block to write all pending buffered rows and close the CSV file cleanly.
00:00:00) until the clock is updated from LOGO! Soft Comfort or the web server.4. Root Cause #2 — Dual-Function Digital/Analog Inputs
On every LOGO! 0BA8 base module, the four fast inputs I1, I2, I7, and I8 are dual-function:
| Terminal | Digital Mapping | Analog Mapping | Voltage Range (Analog) |
|---|---|---|---|
| I1 | DI1 (fast) | AI1 | 0 – 10 V |
| I2 | DI2 (fast) | AI2 | 0 – 10 V |
| I7 | DI7 (fast) | AI3 | 0 – 10 V |
| I8 | DI8 (fast) | AI4 | 0 – 10 V |
Only one of the two functions is usable per terminal at a time — they cannot be sampled independently. The selection is made inside LOGO! Soft Comfort through the block configuration (analog amplifier, analog threshold trigger, or just a digital input contact).
For the digital interpretation, the LOGO! hardware uses an analog comparator with a fixed threshold:
- Voltage at the terminal < 5 V: digital value =
0 - Voltage at the terminal > 8.5 V: digital value =
1 - Voltage between 5 V and 8.5 V: undefined (hysteresis region — should be avoided in wiring)
Now consider a real installation: a 0 – 10 V process transmitter is wired to terminal I2, and the analog value AI2 is logged through the Data Log block. The LOGO! firmware also evaluates the digital interpretation of I2 on every scan and writes the resulting 0 or 1 to the digital column of the same row.
If the transmitter swings to 8.64 V (as in the original field report), the comparator declares the digital value 1 even though the engineer intended the terminal to be used purely as analog. The CSV row therefore shows:
...;AI2;I2;...
...;8.640;1;...
This is not a logging bug and not a memory corruption. It is the documented dual-function behavior. The "inconsistency" disappears the moment the transmitter is re-ranged so that its normal operating voltage is well below 5 V or well above 8.5 V, with margin.
5. Diagnostic Procedure
When a customer reports missing or inconsistent rows in the Data Log CSV, follow this decision tree before changing any wiring:
-
Verify module generation. The Data Log block exists in LOGO! 0BA6 (older) and 0BA7 as well, but the 1024-byte buffer with 512-byte half-flush is the documented behavior of 0BA8. Read the order number on the side label and confirm the last four characters are
0BA8. - Verify card presence during logging. Open the most recent CSV on a PC. If the file is truncated in the middle of a row or the last line has no linefeed, the card was removed mid-write.
-
Compare log interval to flush interval. At a 5 s log interval with 16 tags, each row is roughly 80 bytes. The half-buffer of 512 bytes fills in roughly
512 / 80 ≈ 6.4rows, i.e. about 32 seconds. Any card removal within the first 30 seconds of a session will lose those rows. -
Check dual-function terminals. Cross-reference the wiring diagram against the I/O configuration. If any of
I1,I2,I7,I8carry 0 – 10 V analog while the digital column shows spurious ones, range the transmitter or add a divider resistor so the high end is below 5 V, or add a 10 V zener clamp if the signal must reach 10 V. - Check the on-board clock. If the time column is suspect, push the time from LOGO! Soft Comfort (Tools → Set Clock) and re-arm the Data Log block.
6. Safe SD Card Handling Procedure
Use this procedure every time the SD card must be exchanged while the LOGO! remains powered and the process cannot tolerate a full shutdown.
- From LOGO! Soft Comfort (online) or from the on-board operator panel, navigate to Card → Stop (or place the LOGO! in
STOP). - Wait for the LOGO! to confirm
STOPon the display. The Data Log block will flush the 1024-byte buffer to the card during this transition. - Verify the CSV file on the card is no longer
locked(Windows will not show the file in use). - If the card itself must remain in the LOGO!, transition it back to
RUN. If the card is being swapped, power down the base module, swap the card, power up, and verify the program loaded from internal memory matches the original circuit. - After the swap, open the first new CSV on a PC and confirm the first row carries a valid timestamp and at least one analog sample.
7. Data Log Configuration in LOGO! Soft Comfort
The Data Log block is dragged from the catalog into the circuit diagram. Recommended parameters for a clean capture:
| Parameter | Recommended Value | Reason |
|---|---|---|
| Log interval | 5 s – 60 s | Longer interval = larger file, fewer rows in the 512-byte half buffer = less impact from hot removal |
| Maximum rows per file | 10 000 – 50 000 | Limits file size; Data Log creates a new CSV when the limit is reached |
| File name prefix | Project tag (e.g. TANK01_) |
Simplifies retrieval on the SD card |
| Enable signal | Tag in circuit, not always-on | Allows clean session boundaries |
| Logged tags | Avoid double-logging the same terminal as both DI and AI | Prevents confusion from dual-function behavior |
When wiring the block, the on-line help in LOGO! Soft Comfort explicitly warns that only outputs and tags used in the circuit program can be logged. If a programmer drags Q3 into the Data Log tag list but the circuit never references Q3, the firmware writes a constant 0 for that column or refuses to compile depending on the Soft Comfort version. Always re-validate the circuit after wiring the Data Log block.
8. Verification and Test Plan
After applying the fix, run a controlled capture to confirm the data path is clean.
- Insert a freshly FAT32-formatted micro SD card (32 GB or smaller, class 10 or better) into the LOGO! 0BA8.
- Configure the Data Log block with a 5 s interval and 10 000 row limit.
- Arm the block and let it run for 5 minutes (60 rows).
- Place the LOGO! in
STOPthrough the on-board panel, wait 5 s, then remove the card. - Open the CSV in a spreadsheet and confirm exactly 60 rows are present with a valid timestamp on every line.
- Re-insert the card, place the LOGO! in
RUN, and let it run for another 5 minutes. Repeat the inspection to confirm continuous recording across multiple sessions.
If any rows are still missing, verify the SD card is genuine and not a counterfeit. Counterfeit cards often report a larger capacity than they actually have; the LOGO! firmware will then write past the physical end of the flash and the file system becomes inconsistent. Use SD Card Formatter for a clean FAT32 baseline before each deployment.
9. Preventive Best Practices
- Document the half-buffer rule on the loop sheet. New technicians should know that the first 30 seconds of any Data Log session are at risk if the card is pulled hot.
- Set the on-board clock from LOGO! Soft Comfort every time the project is changed. Stale clocks make the timestamp column useless for root-cause analysis.
-
Range analog transmitters to 0 – 5 V when the digital column of the same terminal is also logged. This keeps the digital comparator firmly in the
0state. - Use the STOP button, not the breaker, for routine card swaps. Stopping the LOGO! triggers a clean buffer flush; the breaker does not.
- Add a watchdog tag to the Data Log column list. A constant, slowly incrementing counter (e.g. a pulse relay feeding a counter block) makes it trivial to see on the CSV which rows are consecutive and which are missing.
- Validate the card on first deployment with the verification procedure in section 8. Repeat annually — flash wear on consumer-grade micro SD cards in industrial service is a known failure mode.
10. Quick Reference Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| First N rows missing from CSV | Card removed before 512-byte flush | Use STOP mode before card removal |
| Last N rows missing from CSV | Session ended without final flush | Use STOP mode to end the session |
Spurious 1 in digital column of I1/I2/I7/I8 |
Analog voltage crossed 8.5 V digital threshold | Re-range transmitter to 0 – 5 V or accept as analog-derived diagnostic |
Time column shows 00:00:00
|
LOGO! clock never set | Set clock from LOGO! Soft Comfort or web server |
Output column always 0
|
Output not used in the circuit program | Reference the output in the circuit diagram |
| CSV truncated mid-row | Card removed during write | STOP before removal, replace counterfeit card if present |
11. FAQ
Why does my LOGO! 8 data log file lose the first few records every time I swap the SD card?
The LOGO! 0BA8 stores records in a 1024-byte RAM buffer and only writes to the card once the buffer reaches 512 bytes. If the card is removed (or the module is powered down) before that threshold is reached, the unwritten records are lost. Always place the LOGO! in STOP mode through the on-board panel or LOGO! Soft Comfort before removing the card — the transition triggers a clean flush.
Why does the digital column for I1, I2, I7, or I8 show a 1 even though I only wired a 0-10 V analog signal?
Those four terminals are dual-function: each one is read either as a digital input or as a 0-10 V analog input, never both independently. The digital comparator declares a 1 above 8.5 V. A transmitter swinging to 8.64 V will produce a digital 1 in the same row. Either re-range the transmitter to 0-5 V or document the column as an analog-derived diagnostic.
Can I hot-swap the micro SD card on a running LOGO! 8?
No. Siemens states explicitly in the manual section 9.2 that removal of the card during RUN mode can lead to impermissible operating states and is not supported. The correct procedure is to use the on-board STOP command, wait for the buffer flush, then remove the card. A full 24 V power-down is the only other safe option.
Why are my output columns all 0 in the CSV even though the outputs are energized?
The Data Log block only records outputs that are actually used in the circuit program. If you drag Q3 into the tag list but the circuit never references Q3, the firmware writes a constant 0. Reference the output somewhere in the ladder or FBD and recompile.
How do I add a proper timestamp to every row in the LOGO! data log?
Set the LOGO! on-board clock from LOGO! Soft Comfort (Tools → Set Clock) or through the integrated web server of the LOGO! 8.3 base module. The Data Log block automatically prepends a date and time column to every row once the clock is valid. See the official thread LOGO! Data Log timestamps for a worked example.