Overview: Why VM Mapping Is Required to Read Counter Values
Siemens LOGO! base modules expose a fixed set of operands in the on-screen I/O Status panel of LOGO!Soft Comfort (Tools → Transfer → I/O Status): digital inputs (I1…I24), digital outputs (Q1…Q16), analog inputs (AI1…AI8), analog outputs (AQ1…AQ2), and the marker/flag bytes (M1…M27). The actual value of a function block such as a Counter (Cnt, block number B001…B999) is, however, an internal block parameter — it is not part of the I/O image and is therefore not directly visible in the I/O Status window.
To make the counter's current count appear in the I/O Status (and in any external Modbus/TCP or HMI client that talks to the base module), you must map the counter parameter to a Variable Memory (VM) address. The Parameter VM Mapping dialog in LOGO!Soft Comfort is the engineering tool for this task, and it has been available on every 0BA7 (LOGOI/O 8) and later base module, including the 0BA7, 0BA8, 0BA8.FS4, and 0BA9 families. Each base module supports up to 64 VM mapping entries.
VW) using the analog flag / shift-register workaround — a poor practice that breaks scaling and is unsupported on later firmware. Upgrade to 0BA7+ before deploying this procedure.Prerequisites: Hardware, Firmware, and Software
| Component | Required minimum | Notes |
|---|---|---|
| LOGO! Base Module | 6ED1052-***08-0BA1 (0BA8 standard) or 0BA7, 0BA8.FS4, 0BA9 | VM mapping introduced in 0BA7; expanded in 0BA8 |
| LOGO! Firmware | FS04 or later (0BA8); FS10 recommended for 0BA9 | Web server requires 0BA8+ |
| LOGO!Soft Comfort | V8.0 (for 0BA7), V8.1 (0BA8), V8.2 (0BA8.FS4), V8.3 / V8.4 (0BA9) | PC suite version must match base module generation |
| PC Connection | Ethernet (RJ45) for 0BA8/0BA9; USB cable 6ED1057-1AA01-0BA0 or Ethernet for 0BA7 | Set the LOGO! IP address to a fixed value first |
| Counter function block | Counter / Up-Down Counter (Cnt) — any block B### that produces a Word actual value | Same procedure works for Analog Threshold, Max/Min, Average, PI controller, and ramp blocks |
Before mapping, verify that the LOGO! program is downloaded and running (LOGO!Soft Comfort: Tools → Transfer → Start LOGO! in Run Mode) and that the counter is actually counting. An open-circuit I1 will keep the counter at zero and you will not see what you expect in the I/O Status.
Variable Memory (VM) Address Space — The Reference Map
LOGO!'s VM area is a flat 16-bit word array used purely as a publication mechanism. Think of it as a small tag database (max 64 entries) that you pre-populate with the values you want the outside world to see. The base module does not execute the VM area — it is read-only from the perspective of the LOGO! program, and writeable from the HMI / SCADA / LOGO!Soft Comfort side.
| VM Address | Default Symbolic Name | Data Type | Typical Use |
|---|---|---|---|
| VW0 | — | WORD | Reserved by LOGO!Soft for boot handshake |
| VW2 | — | WORD | Cycle time / heartbeat (read-only, populated by firmware) |
| VW4…VW126 | User-defined | WORD | Available for parameter mapping (62 user words) |
| VW128…VW510 | User-defined | WORD | Available on 0BA8+ with 64 mapping entries enabled |
Counter_Production). The raw VM address (VW0…VW510) is only visible to Modbus/TCP clients (registers 0…510 of the LOGO! holding register map, function code 03/04).Step-by-Step: Mapping a Counter Actual Value to VM
-
Open the program in LOGO!Soft Comfort and identify the counter function block (e.g.
B001 — Up-Down Counter) that you want to expose. - Open the VM mapping editor: from the menu bar, choose Tools → Parameter VM Mapping (or Edit → Parameter VM Mapping depending on LOGO!Soft version). The dialog shows the 64 slots as a table.
-
Add a new mapping row. Click the first empty row and set the following fields:
Column Value to enter Example VM Address Next free VW word VW100Block Number The counter's B-number B001Parameter Select Actual Value (sometimes labelled Cnt or CV) Actual Value Symbolic Name Free-text, 16 chars max, no spaces Cnt_ProductionData Type Auto-detected; for a counter this is WORD(0…65535) orINT(-32768…+32767)WORD - Save the project and download it to the LOGO! base module. The VM mapping becomes active immediately after a STOP → RUN transition.
-
Verify on the LOGO! built-in display (if the unit has one): navigate to Menu → Diagnostics → Variables — the new symbolic name
Cnt_Productionshould appear with the live counter value.
--. Always open the VM dialog after structural edits and re-validate the block numbers.Reading the Counter via I/O Status (Online)
Once the mapping is downloaded, the counter value is available in the on-screen I/O Status dialog of LOGO!Soft Comfort:
- With the project open and the base module connected, choose Tools → Transfer → I/O Status (alternatively the toolbar button I/O Status).
- The I/O Status window opens with three tabs: Inputs / Outputs, Flags, and Variables. Click the Variables tab.
- The
Cnt_Productionrow now shows the live counter value, updated every scan cycle (typically 50–200 ms on 0BA8). - The value column also exposes the raw VM address (e.g.
VW100) and the engineering unit if one was assigned in the function block.
Data-Flow Diagram (Counter → VM → I/O Status → CSV)
CSV Export: Five Field-Tested Workflows
LOGO!Soft Comfort does not provide a single "Export I/O Status to CSV" button. The values must be captured by one of the following five methods, ordered from simplest (manual, no extra hardware) to fully automated (industrial-grade data historian):
Method 1 — Manual copy/paste from I/O Status (smallest effort)
- Open the I/O Status window in the Variables tab.
- Right-click the value cell of
Cnt_Productionand select Copy. - Paste into Excel / LibreOffice Calc, then add the timestamp manually in column A.
- Save as
.csv. This is the workflow used in the original question and is fine for a few readings per day.
Method 2 — LOGO! 0BA8+ data logging to micro-SD card (automated, no extra hardware)
- Insert a micro-SD card (max 32 GB, FAT32, ≤ 32 GB) in the LOGO! base module.
- In LOGO!Soft Comfort, add a Data Log function block (File → New → Data Log) and bind it to the same VM word (VW100).
- Set the trigger source (e.g. on a rising edge of I3) and the sample interval. The LOGO! writes a CSV line to
/LOGO/SD/DATALOG.CSVon the card. - Pull the card, open the CSV in Excel. The file already contains
YYYY-MM-DD HH:MM:SS, valuerows.
SD Card Formatter from the SD Association.Method 3 — Web server polling (0BA8+ with Web Server licence enabled)
- Activate the Web Server on the LOGO! (Setup → Web Server Access → Enable). Default port 80.
- In a browser, navigate to
http://<LOGO_IP>/→ the Variables page lists every VM-mapped parameter with its current value. - Use a small PowerShell or Python script to poll the JSON endpoint (
http://<LOGO_IP>/status.xmlon 0BA8.FS4+) and append each reading to a CSV:import requests, csv, datetime url = "http://192.168.0.10/status.xml" with open('counter.csv', 'a', newline='') as f: w = csv.writer(f) while True: r = requests.get(url, timeout=2).text # parse the <Cnt_Production> element; XML structure varies by FS level value = r.split('<Cnt_Production>')[1].split('</Cnt_Production>')[0] w.writerow([datetime.datetime.now().isoformat(timespec='seconds'), value]) time.sleep(1)
Method 4 — Modbus/TCP pull from a SCADA tag (Ignition, WinCC, Node-RED, etc.)
- LOGO! 0BA8/0BA9 acts as a Modbus/TCP server on port 502. VM word 0 maps to holding register 0, VM word 100 maps to register 100, and so on.
- Add a Modbus TCP device in the SCADA, point it at the LOGO! IP, and create a tag at Holding Register 100.
- Enable the SCADA's built-in historian (e.g. Tag History in Ignition, Tag Logging in WinCC) to write 1-second samples to a CSV/SQL store automatically.
| VM Word | Modbus Register (FC03/FC04) | Access |
|---|---|---|
| VW0 | 40001 | Read-only (heartbeat) |
| VW100 | 40101 | Read-only (mapped counter) |
| VW110 | 40111 | Read/write (if mapped to a settable parameter) |
Method 5 — LOGO! + external HMI with local data logging
Pair the LOGO! with a Siemens SIMATIC HMI Basic Panel (KTP400, KTP700, KTP1200) or any Modbus/TCP master. Configure the HMI tag to poll the LOGO! VM register every 200 ms and enable the HMI's Data Log function. The panel writes a CSV to a USB stick or to a network share, which is the most robust industrial method for shift-long trend recording.
Hardware-Specific Notes: 0BA7 vs 0BA8 vs 0BA8.FS4 vs 0BA9
| Feature | 0BA7 | 0BA8 | 0BA8.FS4 | 0BA9 |
|---|---|---|---|---|
| Max VM mapping entries | 64 | 64 | 64 | 64 |
| Variable tab in I/O Status | Yes | Yes | Yes (extended columns) | Yes (with units) |
| Web server | No | Optional add-on (6ED1057-3BA02-0AA0) | Built-in | Built-in |
| Data Log to SD card | No | Yes | Yes (faster flush) | Yes (CSV + JSON) |
| Modbus/TCP server | Optional module 6ED1057-3BA00-0AA0 | Built-in | Built-in | Built-in (with authentication) |
| I/O Status refresh | ~200 ms | ~100 ms | ~50 ms | ~50 ms |
For a pure read counter and dump to CSV use case, the 0BA8.FS4 (article number 6ED1052-1MD08-0BA2) is the sweet spot: built-in web server, built-in Modbus/TCP, micro-SD data logging, and the lowest cost. The 0BA9 is justified only when you need the S7-style tag import or HTTPS authentication.
Diagnostic and Troubleshooting Matrix
| Symptom | Likely Root Cause | Diagnostic Step | Corrective Action |
|---|---|---|---|
| Variables tab in I/O Status is empty | Project not downloaded with VM mapping, or LOGO!Soft version mismatch | Open Tools → Parameter VM Mapping; confirm mapping rows exist | Save → Download → STOP/RUN transition |
Mapped variable shows --
|
Block number changed or parameter renamed | Cross-check B-number in mapping dialog vs ladder diagram | Re-bind the row to the current B-number |
| Counter increments in I/O Status but CSV file stays empty | Data Log block not bound to VM address, or SD card full | Remove SD card → check directory /LOGO/SD/ for DATALOG.CSV
|
Re-insert card, verify trigger edge, format with FAT32 |
| Modbus client reads 65535 / 32767 | Byte-swap mismatch (LOGO! is big-endian / Modbus is little-endian word) | Read register 101 alongside 100 in the client | Swap the two 16-bit words in the SCADA tag driver |
Web server returns 404 on /status.xml
|
Firmware below FS04 or web server not enabled | Check Setup → Web Server Access on the LOGO! display | Enable web server; upgrade firmware to FS04+ |
| Mapping dialog greyed out | Project opened from a 0BA6 .lsc file | File → Properties → Hardware → confirm 0BA7 or later | Convert or re-create the project in the right LOGO!Soft version |
| 64-entry limit hit | All VM slots used | List mappings: Tools → Parameter VM Mapping → Export CSV (0BA8.FS4+) | Consolidate counters into a shift-register block, free up slots |
Field-Commissioning Checklist
- After downloading, power-cycle the LOGO! to clear the volatile VM cache.
- Force the counter to a known value by pulsing I1 five times; verify that the I/O Status Variables tab shows 5.
- Toggle the trigger source for the Data Log block and confirm a new row appears in
DATALOG.CSVwithin 1 s. - If a SCADA/HMI is in the loop, read holding register 40101 (VW100) with a Modbus/TCP test client (e.g. modpoll) and confirm the value matches the I/O Status display.
- Document the symbolic name, VM address, block number, and engineering unit in a register sheet — handover without this table causes endless support calls.
Frequently Asked Questions
Does VM mapping exist on LOGO! 0BA6 or earlier?
No. Parameter VM Mapping was introduced with the 0BA7 (LOGOI/O 8) generation. On 0BA6 you can route a counter actual value to a marker word (M-word) using the analog flag path, but the I/O Status display will still not show the block parameter directly. Upgrade to a 0BA7+ base module for the clean solution described in this article.
How many parameters can I map per LOGO! base module?
Each base module supports a maximum of 64 VM mapping entries, regardless of the LOGO!Soft version. The limit is enforced by the firmware, not the PC tool. If you need more, consolidate parameters with a shift-register or PI-controller block before mapping.
Can I write a value back to the LOGO! through a mapped VM word?
Yes, but only if the mapped block parameter is declared writable (for example, the setpoint of a Counter, a Threshold's On/Off values, or a PI controller's setpoint). The I/O Status window itself is read-only; writes must come from a Modbus/TCP client, the web server, or an HMI tag bound to the same VM address. Always protect writeable parameters with the LOGO! password.
Why does my mapped counter read 65535 even when the real counter shows 0?
The most common cause is a byte-swap error on the Modbus/TCP client side: LOGO! stores words in big-endian order while many SCADA drivers expect little-endian. Read the adjacent register (40100 or 40102) and you will see the actual value. Configure the driver to word-swap or big-endian.
What is the fastest way to get the counter into Excel on a laptop with no network?
Use the micro-SD Data Log on 0BA8+. Insert the card, bind a Data Log block to the VM word (VW100), and let the LOGO! write DATALOG.CSV on every trigger edge. Remove the card, open the CSV directly in Excel — no script, no SCADA, no extra hardware. The card must be FAT32 and ≤ 32 GB.