LOGO! VM Memory Mapping and MODBUS TCP Data Exchange

David Krause12 min read
HMI ProgrammingSiemensTechnical Reference
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

Why LOGO! Has No Data Blocks

The Siemens LOGO! family (LOGO! 8 / 0BA8, part numbers 6ED1052-xxxxx-0BA8) is a compact logic module, not a full SIMATIC PLC. It deliberately omits the Datenbaustein (DB) concept used by S7-300/400/1200/1500. A LOGO! program is a single FBD/LAD diagram that executes cyclically, with no separable loadable data containers.

Anything you would normally place in a DB on an S7 PLC is, on a LOGO!, expressed as:

  • Retentive flags (M, AM) that survive power-off
  • Non-retentive flags (VB) cleared on cold restart
  • The dedicated VM (Variable Memory) word area accessible over Ethernet
  • Process-image words VW / bytes VB that mirror the VM area

VM is the closest analogue to a global data block in a LOGO!; it is the only memory area the rest of the network can read or write without program involvement. This is the area to use whenever the question is "where do I put a buffer the other controllers can poll?".

Important: On LOGO! 8 (0BA8), VM is allocated in words and indexed from VW0. Hardware differs from the LOGO! 6/7 generation; older 0BA6/0BA7 devices do not expose VM over the network and have no MODBUS TCP support.

LOGO! 8 Hardware and Firmware Prerequisites

Data buffering over Ethernet and MODBUS TCP requires the LOGO! 8 platform. The minimum feature set is:

Feature Minimum requirement Notes
Hardware LOGO! 8 base module 0BA8 (e.g. 6ED1052-1MD00-0BA8) Ethernet RJ45 on the front
Firmware FS04 (8.FS04) or later MODBUS TCP server/client support was added in FS04
Programming LOGO!Soft Comfort V8.x (V8.3 recommended) Online connection via Ethernet
Network 10/100 Mbit Ethernet, IP addressing Up to 16 LOGO! 8 stations in one logical network
Max VM words VW0 ... VW850 (851 words / 1702 bytes) Same range on all LOGO! 8 variants

Confirm the firmware revision under LOGO! → Diagnostics → Device Information in LOGO!Soft Comfort. A device reporting FS02 or FS03 must be firmware-updated to FS04 or later before MODBUS TCP becomes selectable as a protocol.

VM Memory Map and Address Space

VM is the single namespace that bridges program variables and network exposure. The mapping is fixed and identical on every LOGO! 8 base module:

Range Width Typical use
VW0 ... VW15 16 words LOGO! reserved for internal diagnostics / operating hours counter (read-only)
VW16 ... VW849 834 words Free for user data buffers, HMI tags, peer-to-peer values
VW850 1 word LOGO! reserved (read-only)

You access VM from the program as VW<offset> on an Analog Flag block, a Math block, or a UDT-style block. The same value is exposed to the outside world at the matching MODBUS holding-register address:

  • VW0 ↔ Modbus Holding Register 0 (address 0)
  • VW16 ↔ Modbus Holding Register 16
  • VWn ↔ Modbus Holding Register n

The mapping is a 1:1 offset, zero-based, and word-sized (16 bits, big-endian on the wire per the Modbus specification). Bit-level read is via Modbus function 0x01 / 0x05 (coils) and uses byte addresses n*16 + bit derived from VW. Reference: Modbus Application Protocol V1.1b3.

Byte/word address trap: LOGO!Soft Comfort displays VM as VW words. When a master (S7-1200, S7-1500, WinCC, third-party SCADA) addresses Modbus, remember that the unit is a holding register, not a byte. If your S7 side is configured as "40001 + offset", you must subtract 1 (PLC convention) or use offset 0 (Siemens convention) – never mix both.

Implementing a Buffer in VM Memory

A traditional data block with array indexing does not exist on LOGO!; there is no indirect-addressing instruction. The practical workarounds are:

Option A: Fixed-slot ring buffer (recommended)

Reserve N consecutive VM words, e.g. VW200 ... VW249 for a 50-sample buffer. Use an Up/Down counter (block Counter) running 0..49 as the slot index. The slot is decoded with a 1-of-N demux built from a Shift Register or with parallel comparator blocks:

AI1 (analog input) --> [Math: /10] --> [Mux sel=Counter_out] --> VW200..VW249
                         Counter triggers on each scan-of-acquisition
                         (e.g. 1 Hz from Timer B=1 s)

For 16 or 32 slots this remains compact; beyond ~50 slots the FBD becomes impractical.

Option B: Block Move with explicit copies

If the buffer never needs to be searched or re-ordered, write each new value to a dedicated VW and let the master (S7-1500 / WinCC) build the time series:

AI1 --> [Analog Threshold x N] --> VW300
                                   VW302
                                   VW304 ...

This is the cleanest pattern for a "remote I/O with local snapshot" topology, which is exactly the use case in the original question.

Option C: Use the on-board Shift Register block

The Shift Register (8 bits wide, up to 32 stages) provides first-in/first-out behaviour for digital flags. It cannot hold analog values and is not network-accessible; treat it as scratchpad only.

Constraint: LOGO! 8 program cycle time is typically 8–20 ms for a moderate FBD. A 100-slot buffer written every 10 ms consumes 10% CPU just on writes and is not realistic. Sample at 100 ms or slower for any buffer > 20 entries.

Inter-LOGO! Communication with Network I/O (NI / NQ)

For LOGO!-to-LOGO! traffic without an external master, LOGO! 8 supports peer-to-peer Network Inputs (NI) and Network Outputs (NQ):

Direction Block Width Storage
Receive from remote LOGO! Network Input (NI) 32 digital + 8 analog per remote Locally available as NI1..NI32 / NAI1..NAI8
Send to remote LOGO! Network Output (NQ) 32 digital + 8 analog per remote Mapped to remote's NI on each cycle

Configuration: Tools → Ethernet Connections → Network I/O in LOGO!Soft Comfort. Up to 16 LOGO! 8 modules can be in a single network. Each remote must be on the same subnet and reachable on UDP port 50005 / 50006 by default. See the LOGO! 8 system manual, section on "Network communication" in SIOS entry 109741041.

For a "local remote I/O + central server LOGO!" topology this is the simplest data path:

  1. Each client LOGO! assigns 4–8 analog values to its NQ1..NQ8 block outputs.
  2. Server LOGO! declares matching NI1..NI32 / NAI1..NAI8 for each client IP.
  3. Values appear at the server every cycle (typical latency 20–100 ms).

The server can then copy NAI1..NAI8 of every client into its own VM area (e.g. VW200 for client #1 AI1, VW208 for client #2 AI1, ...) to expose the aggregate buffer to MODBUS / WinCC / S7 master.

MODBUS TCP Server Mode (FS04 Firmware)

From FS04, the LOGO! 8 base module runs a MODBUS TCP server on TCP port 502 by default. The server is permanently active and cannot be disabled per device – there is no licence flag. Supported function codes are the standard subset:

FC Name Address range in LOGO!
0x01 Read Coils Bit view of VW0..VW850 (16 bits per VW)
0x02 Read Discrete Inputs Same address space, read-only (LOGO! 8 maps to I / M flags)
0x03 Read Holding Registers VW0..VW850 directly
0x04 Read Input Registers Analog inputs AI1..AI8 (mapped to fixed register window)
0x05 Write Single Coil Bit write to VW bit
0x06 Write Single Register Write to a single VW (no implicit byte swap)
0x0F Write Multiple Coils Bit write
0x10 Write Multiple Registers Write to a VW block

To expose a buffer of 50 analog samples to an external master, allocate VW200..VW249, write to it from the program, and the master reads the same range with FC 0x03 starting at register address 200. No additional configuration is required on the LOGO! side – VM is the Modbus data model.

If you need write access from the master, FC 0x06 and FC 0x10 will overwrite the VW. Make sure no FBD output writes to the same VW in the same cycle; the program always wins the arbitration, so the master write is silently overridden. Use a guarded region (a flag that gates the FBD write) to avoid that race.

MODBUS TCP Client Mode (FS04 Firmware)

LOGO! 8 FS04 can also act as a client (master) and poll up to 8 MODBUS TCP servers. Configuration is via the MODBUS Master function block in LOGO!Soft Comfort. Each block instance defines:

  • Target IP address (any IPv4 in the local subnet)
  • Target port (default 502)
  • Function code (0x03, 0x04, 0x06, 0x10)
  • Starting register address and word count
  • Local destination VWn..VWn+k

The block triggers on a Boolean input and stores the result in the destination VWs within one or two program cycles. With a 200 ms trigger this comfortably supports 8 polled servers at 25–50 samples per second aggregate.

Configuring a Data-Collector LOGO! Architecture

For the original application – multiple field LOGO!s acting as local remote I/O, one central "server" LOGO! – the proven configuration is:

  1. Every field LOGO! publishes up to 8 analog values to its NQ block (digital flags limited to 32 per remote).
  2. Server LOGO! declares a Network Input block for every field LOGO! IP, mapping the remote NQs into local NAIs (NAI1..NAI8 per client).
  3. Server LOGO! copies each client NAI group into a contiguous block of its own VM (e.g. VW200 = client #1 AI1, VW208 = client #2 AI1, ...). Use 8-VW gaps so that future expansion to 8 AIs per client does not require moving the layout.
  4. Optional: connect an S7-1200 / S7-1500 as MODBUS TCP master to the server LOGO! to bring the aggregate buffer into the SIMATIC world. Function block MB_CLIENT in TIA Portal (instruction manual SIOS 109751348) handles the request and writes the result into a global DB on the S7 side.
Multi-LOGO! data-collector topology LOGO! Client #1 (field remote I/O) LOGO! Client #2 (field remote I/O) LOGO! Server VM buffer VW200..VW249 Modbus server :502 S7-1200/1500 MB_CLIENT → DB HMI / WinCC NI / NQ UDP NI / NQ UDP Modbus TCP

Programming in LOGO!Soft Comfort

The minimum project to publish a 4-sample buffer over MODBUS TCP is roughly 12 FBD blocks. Step-by-step:

  1. Create a new project in LOGO!Soft Comfort V8.3 and select device LOGO! 8 (0BA8) Standard.
  2. From the analog input list, drag AI1 onto the diagram. Wire it to an Analog Flag named BufferSlot0 with address VW200.
  3. Add a 1-Hz timer (block On-Delay, parameter T = 1 s). Use its output to latch a Counter block (range 0..3, threshold 4). The counter's CV drives the select input of a four-way Analog Mux block whose four inputs are wired to four successive Analog Flags VW200, VW201, VW202, VW203. (Without the Mux, you must hard-code the slot from outside; the Mux gives a moving snapshot.)
  4. For network exposure, no further work is required – the values in VW200..VW203 are automatically at MODBUS holding-register addresses 200..203.
  5. On the S7-1500 side, instantiate MB_CLIENT with MB_MODE=1 (read), MB_DATA_ADDR=200, MB_DATA_LEN=4, target IP = LOGO! server address, port 502. The destination MB_DATA_PTR points to a tag in a global DB sized at least 4 words.
Tip: Enable Retain on the Analog Flag block if you want the buffer to survive a power cycle. Without the Retain attribute, every cold restart zeros the VM block and the master's first poll returns all-zero until new samples are written.

Verification, Diagnostics, and Common Faults

After download to the LOGO! and restart, validate in this order:

  1. From a PC, ping the LOGO! IP. No reply means IP/DHCP or cable problem.
  2. Run Modbus Poll or QModMaster against <LOGO IP>:502, FC 0x03, address 200, length 4. You should see live counts.
  3. In LOGO!Soft Comfort open Online → Online Test, tab VM Area. The same values must show under VW200..VW203. If they don't, the FBD is not actually writing to those addresses (e.g. you wired to a local M flag instead of an Analog Flag with the VM address).
  4. On the S7-1500, put a watch table on the destination DB. Values should update every MB_CLIENT cycle.
Symptom Likely cause Fix
Modbus timeout from master LOGO! firmware < FS04 Update firmware; verify under Device Information
Reads return 0xFFFF FC 0x04 used where 0x03 expected, or off-by-one in address Switch to FC 0x03 for VM, address = exact VW offset (zero-based)
Values flash and reset FBD overwrites VW each cycle after master writes Gate FBD write with a flag; let master hold the value
Wrong endianness on S7 Modbus is big-endian, S7 word is little-endian Use SWAP or read into a byte array and reorder
NI/NQ values absent at server IP or subnet mismatch between field and server LOGO! Check both modules' IP and subnet mask; both must be in the same /24
Only first 16 VWs reachable Device is LOGO! 7 (0BA7) or LOGO! 6 (0BA6) Replace base module with 0BA8 hardware
HMI shows stale data Polling interval too long for VM update rate Reduce master poll to 200–500 ms; verify LOGO! scan < 50 ms

Performance Limits and Migration to S7-1200

LOGO! 8 is rated for 200 blocks / 400 I/O max per program, cycle time 8–20 ms, and a 1-second minimum retain interval. If a project outgrows these – typical signs are buffers > 50 entries, cycle time > 50 ms, or the need for indirect addressing – migrate to an S7-1200 with a real DB. The S7-1200 can act as MODBUS TCP master/peer and expose the buffer via OPC UA, S7 comm, or Profinet, none of which the LOGO! can do natively.

A staged migration is straightforward:

  1. Keep the LOGO! field stations; their analog inputs are still useful as remote I/O.
  2. Replace the server LOGO! with an S7-1200 CPU 1214C or 1215C. Use MB_CLIENT on the S7-1200 to poll the existing field LOGO!s (they continue to publish via NI/NQ if the new master supports it, or fall back to MODBUS TCP server on the field LOGO!s directly).
  3. Move the buffer into a proper DB on the S7-1200; index with the standard POKE_BLK / PEEK_BLK instructions.

Frequently Asked Questions

Does LOGO! 8 support S7 data blocks (DB)?

No. The LOGO! 8 family is a logic module, not a SIMATIC PLC. Use the VM memory area (VW0..VW850) as the global data store. VM is automatically exposed at the same offset as a MODBUS TCP holding register, so an S7-1500 with MB_CLIENT can read it as if it were a DB.

Which LOGO! firmware first supports MODBUS TCP?

MODBUS TCP server and client functionality were introduced in firmware FS04 (8.FS04) of the 0BA8 base module. Check the version under LOGO! → Diagnostics → Device Information. Older 0BA7 or 0BA6 hardware cannot be updated to FS04.

How many LOGO! 8 modules can be networked together?

A single Ethernet network can contain up to 16 LOGO! 8 base modules. Each client LOGO! can publish 32 digital and 8 analog Network Outputs (NQ); the server declares matching Network Inputs (NI). For data beyond 8 analogs per client, switch to MODBUS TCP polling and read from each VM directly.

What is the address of VW0 in Modbus register terms?

VW0 is Modbus holding register 0 (zero-based), or 40001 in the PLC-style "1-based" notation. VW200 is holding register 200, or 40201. Both notations are seen in tooling; stay consistent across the project.

Can the master write values into the LOGO! VM?

Yes, with FC 0x06 (single register) or FC 0x10 (multiple registers) the master writes directly to the target VW. The LOGO! program continues to execute; if the FBD also writes to the same VW the program wins the cycle arbitration. Use a guard flag in the FBD to give the master exclusive access for the duration of the write.

Back to blog