Siemens LOGO! 8.FS4 VM Mapping: Counter to AM and OPC Integration

David Krause14 min read
HMI / SCADASiemensTutorial / 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

Siemens LOGO! 8.FS4 Parameter VM Mapping for Counters, AM Flags, and OPC/SCADA

Siemens LOGO! 8.FS4 (0BA8) logic modules expose a dedicated Variable Memory (VM) area for parameter access from S7 and Modbus masters. The VM area is the only way to read a 32-bit counter value from a third-party HMI, OPC server, or SCADA system, because the standard flag area and the analog flag (AM) area are limited to 16 bits (max. 32,767). This reference covers the full procedure: enabling VM mapping in LOGO!Soft Comfort V8.4, selecting the right address slot for a counter, choosing between S7 and Modbus TCP, and exposing the value to Ignition or any OPC-UA-capable SCADA.

1. Overview of VM Mapping on LOGO! 8.FS4

LOGO! 8.FS4 firmware introduces two simultaneous Ethernet connection types — S7 communication and Modbus TCP — and supports up to 64 parameter mappings into the VM area for each project. The VM area is independent of the standard process image (I, Q, AI, AQ, M, AM) and is reserved for values that need to be polled by an external client (HMI, SCADA, PLC, gateway).

The native flag types in LOGO! are:

  • Digital flags (M) — 1 bit, used for boolean values.
  • Analog flags (AM) — 16-bit signed integer, range −32,768 to +32,767.
  • Counters (C) — internally 32-bit signed integer (DINT), range −2,147,483,648 to +2,147,483,647.
  • Variable Memory (VM) — a published area containing values explicitly mapped by the user in LOGO!Soft Comfort; accessible via S7 and Modbus.

The 16-bit ceiling on AM is the first design decision point: if a counter's expected count is < 32,768, the value can be passed directly to an AM block and read through the standard S7 area. Anything beyond that requires Parameter VM Mapping, which transfers the full DINT to a VM address readable from the outside.

Engineering rule of thumb: Use an AM block only for short-cycle counters (production batches, daily totals, throughput within a shift). Use VM mapping for totalizers, lifetime counts, and any value that is expected to grow past 32,767.

2. Prerequisites

  1. LOGO! hardware: 0BA8 module (6ED1052-xxx08-0BA0 series) with firmware 8.FS4 or later. Earlier FS levels (8.FS0–8.FS3) support S7 only; Modbus TCP was added in 8.FS4.
  2. LOGO!Soft Comfort V8.4 (or later) for the parameter VM mapping dialog under Tools → Parameter VM Mapping. The dialog is hidden on older versions and on projects targeting 0BA6 modules.
  3. Ethernet connectivity: 10/100 Mbit RJ45 on the LOGO! base module, fixed IP or DHCP, and a route to the SCADA/OPC client.
  4. SCADA client driver: Ignition with the Siemens TCP driver (S7) or the Modbus TCP driver; or any OPC-DA/UA server that speaks S7-300/400 protocol over TCP port 102.
  5. Program structure: A Counter block (or Up/Down counter) already in the circuit program with its reference number (e.g. C001–C028 depending on program size).

3. LOGO! 8.FS4 Memory Model and Address Ranges

The address model exposed by LOGO! 8 to a remote S7 or Modbus client differs from the internal project view. The table below summarizes the access types available from firmware 8.FS4 onward. Confirm the exact address map against the official LOGO!Soft Comfort Online Help (ID 100782807) when commissioning.

Area Mnemonic Bit width Read/Write Access from S7 Access from Modbus
Digital inputs I 1 R I0.0 – In.7 Coil / Discrete Input
Digital outputs Q 1 R Q0.0 – Qn.7 Coil / Holding Register bit
Digital flags M 1 R/W M0.0 – Mn.7 Coil / Holding Register bit
Analog inputs AI 16 R IW0 – IWn Input Register
Analog outputs AQ 16 R/W QW0 – QWn Holding Register
Analog flags AM 16 (signed) R/W MW area via VM Holding Register
Variable Memory (mapped) VM 16 or 32 R/W DB1 / DB2 area Holding Register (per mapping)

Counter and timer running values are not in the regular process image. They live inside the program block and can be read by a remote client only through Parameter VM Mapping. The mapping dialog creates a window from the block's internal DINT into a published VM word or double-word.

4. Counter Limits: Why AM Is Not Always Sufficient

LOGO!Soft Comfort displays the counter value as a DINT (32-bit signed). When you wire the counter's CQ or parameter output to an Analog Flag (AM) via the function block, the LOGO! runtime truncates the high word. The AM block holds only 16 bits of the value:

  • AM valid range: −32,768 to +32,767
  • Counter valid range: −2,147,483,648 to +2,147,483,647

For a station that counts parts at a rate of one unit per second, the AM overflow occurs after approximately 9 hours of continuous counting. Any application requiring an end-of-shift, daily, or lifetime total must therefore use VM mapping.

Diagnostic tell: If the SCADA value freezes at exactly 32,767, 32,768 (wraps to −32,768), or shows an obviously clamped value, the source is almost certainly a 16-bit AM block, not a 32-bit VM mapping.

4.1 Selection rule

Condition Recommended target Data width External access
Counter < 32,768 expected, need simple SCADA display Analog flag (AM) 16-bit INT Direct via S7/MB on AM area
Counter > 32,768, lifetime total, or value written by SCADA VM mapping 32-bit DINT DB area on S7, Holding Register pair on Modbus
Bit status (overflow, gate, reset) Digital flag (M) or VM bit 1 bit Direct via S7/MB

5. Enabling Parameter VM Mapping in LOGO!Soft Comfort V8.4

Open the project in LOGO!Soft Comfort and navigate to:

Tools → Parameter VM Mapping (0BA7 and later versions only)

The dialog window lists up to 64 mapping rows. Each row binds a source symbol in the LOGO! program to a target VM address. The dialog also exposes two connection-type columns, which is where you select S7 or Modbus TCP exposure per parameter.

Reference: LOGO!Soft Comfort Online Help (ID 100782807), section "Parameter VM Mapping (0BA7 and later versions only)".

The dialog requires:

  1. The circuit program has at least one functional block whose value is to be published.
  2. The target LOGO! is an 0BA7 or 0BA8 device. 0BA6 and earlier ignore the mapping.
  3. The project setting under File → Properties → Target Hardware must reflect 0BA8.
If the Parameter VM Mapping menu entry is greyed out, the program is targeted to an 0BA6 module or the project was created in a pre-V8 version of LOGO!Soft Comfort. Re-create the program with the V8.4 template or change the target hardware to 0BA8 to enable the dialog.

6. Step-by-Step: Mapping a Counter to the VM Area

The following procedure publishes a counter (e.g. C001) to a VM address for S7 read access, and is then re-exposed for Modbus TCP on the same VM slot.

6.1 Add the VM mapping row

  1. Open Tools → Parameter VM Mapping.
  2. Click the first empty row in the mapping table.
  3. In the Symbol column, select the counter block (e.g. Counter 001 — C001). LOGO!Soft Comfort only offers block names defined in the circuit program.
  4. In the Address column, choose a free VM word. The default starting address is VW0; subsequent rows increment in word steps.
  5. Set the Connection checkbox: enable S7 and/or Modbus per the SCADA driver. The address is reused on both protocols with the appropriate encoding.
  6. Click OK to apply.

6.2 Verify the binding

  1. Right-click the counter block in the FBD view and select Block Properties → Parameters.
  2. The actual counter value field is read-only on the LOGO! HMI, but LOGO!Soft Comfort will display a VM annotation indicating the binding address.
  3. Compile and download the program to the LOGO! 8.FS4 device.

6.3 Read from an S7 client

An S7-300/1200/1500-compatible client reads the counter through a data block. With LOGO! 8, parameter VM-mapped values are published in DB1 (or DB2 when an additional S7 connection is configured). The exact DB number depends on the connection slot in the LOGO!'s IP & Connection configuration.

Example read in a Siemens S7-1200 user program (TIA Portal):

// Read 32-bit DINT counter from LOGO! VM area
// DB number is the LOGO! parameter DB (typically 1 for first S7 connection)
#CounterValue := DB1.DBD0;   // Counter 001 mapped to VW0/VW1

The client must use PUT/GET access permission on the LOGO! side, and the LOGO! must be configured to allow the S7 connection in Tools → Ethernet Connections.

6.4 Read from a Modbus TCP client

The same VM word is also exposed as a Modbus Holding Register. 32-bit DINTs are encoded as two consecutive 16-bit registers; LOGO! emits them in big-endian (high word first) — verify endianness against the SCADA driver; some drivers default to little-endian and require a byte-swap.

Function code: 0x03 (Read Holding Registers)
Starting address: 0 (mapped to first VM word)
Quantity: 2 registers  → 32-bit DINT
Byte order: High word @ offset 0, Low word @ offset 1

For Ignition, configure a Modbus TCP device with unit ID 255 (LOGO! default) and add two registers per 32-bit VM value with Word Swap = On only if the high/low order is reversed in your driver version.

7. S7 and Modbus Protocol Support on 8.FS4

LOGO! 8.FS4 supports up to two simultaneous S7 connections and one Modbus TCP server in parallel. This is the key change from 8.FS0 where only S7 was available. Per the official help, the VM mapping table is shared between both protocols — a value mapped in row 1 is exposed over S7 and Modbus unless the per-row Connection checkbox is deselected.

Protocol Port Concurrent connections Use case
S7 (ISO-on-TCP / TCP 102) 102 Up to 2 Siemens HMI, S7 PLCs, OPC servers with Siemens driver
Modbus TCP 502 (configurable 502–510) 1 server, multiple clients Generic SCADA, third-party HMIs, Ignition, Energy meters

8. Connecting LOGO! 8.FS4 to Ignition SCADA via OPC

For the use case in the original question (parts counter → OPC → Ignition), the most direct path is:

  1. Map the counter to a VM word as described in section 6.
  2. Install the Siemens TCP driver in Ignition (or the Modbus TCP driver if the LOGO! is on 8.FS4 and Modbus is preferred).
  3. Create a new device in Ignition with the LOGO!'s IP, port 102, and rack/slot 0/0 (the LOGO! emulates an S7-300 with rack 0, slot 0 or slot 2 — verify against the driver wizard).
  4. Add a tag pointing to DB1.DBD0 for the 32-bit counter, or to the equivalent Holding Register pair for Modbus.
  5. Bind the tag to a numeric label on a perspective or vision window. The live counter from the LOGO! then appears in the SCADA.

If the SCADA cannot speak S7 or Modbus directly, an OPC-UA bridge (Kepware, Ignition's OPC-UA server, or a Siemens IOT2050) can translate the value into OPC-UA nodes.

9. Verification and Acceptance Tests

After downloading the project and confirming the VM mapping, run the following checks before handing the panel over to operations.

  1. Local verification on the LOGO! HMI: Force the counter by toggling its input; the displayed value should equal the SCADA value within one polling cycle.
  2. S7 client verification: Use TIA Portal's Online → Accessible Devices to ping the LOGO!, then read DB1.DBD0 with a watch table. The value should track the HMI display.
  3. Modbus verification: Use a Modbus master test tool (e.g. Modbus Poll, qModMaster) to read Holding Registers 0 and 1. Confirm big-endian ordering for the DINT.
  4. Endurance test: Force the counter to roll over 32,767 and confirm the SCADA shows 32,768 (not a clamped or wrapped value). This proves the 32-bit DINT is being mapped, not the 16-bit AM.
  5. Write-back test (if the SCADA clears the counter): Write 0 to the VM DINT from the client; the LOGO! counter must reset on the next scan.

10. Troubleshooting Matrix

Symptom Likely root cause Corrective action
SCADA value frozen at 32,767 or 32,768 Counter wired to AM, not VM Move the binding to Parameter VM Mapping as a 32-bit DINT
Tools → Parameter VM Mapping is greyed out Target hardware set to 0BA6 or pre-V8 project Change target hardware to 0BA8 and rebuild the program
S7 client cannot connect LOGO! not configured to allow the S7 connection / PUT/GET disabled Open LOGO! online → Tools → Ethernet Connections → enable S7 and set PUT/GET access
Modbus client reads only zeros Endianness mismatch on the DINT Swap the two registers or enable byte/word swap in the driver
Mapping compiles but value stays 0 at runtime Counter block reset on every download / power cycle Set counter retentivity ON; persistent counters survive restart only if flag is enabled
More than 64 values needed VM mapping table is full Consolidate values into a single block, or add a second LOGO! on the same subnet
OPC tag errors out with "Quality: Bad" Wrong DB number or wrong slot in the driver Try rack 0 slot 2, or 0/0; confirm with TIA Portal "Accessible Devices"
Counter increments but HMI shows negative values INT interpreted as signed, overflow in low word Use the full DINT VM mapping; check the SCADA tag data type is INT32, not INT16

11. Field-Commissioning Notes

  • Retentivity: The counter's persist-on-power-loss flag is independent of VM mapping. To retain a totalizer across power cycles, enable Remanence on the counter block and ensure the LOGO! has a battery module (LOGO! 8 BM with battery backup) or the supercap-supported variant.
  • Polling rate: S7 and Modbus TCP on LOGO! 8.FS4 typically update at 100–250 ms depending on connection count. Set SCADA poll rate to 500 ms or higher to avoid overloading the LOGO! CPU on busy projects.
  • Read vs write safety: A VM-mapped counter that is writable from SCADA is also writable from any client on the network. Place the LOGO! behind a managed switch or VLAN to limit access, or use Modbus unit ID filtering.
  • Endianness across drivers: The high word of a DINT mapped at VW0 is exposed at Modbus register 0; the low word at register 1. Ignition's Siemens driver handles this internally; raw Modbus clients may need a swap.
  • Concurrent S7 and Modbus access: Both protocols read from the same VM area. A write through Modbus is immediately visible to the S7 client, and vice versa. Do not let two clients write the same VM address simultaneously — last-writer-wins, with no arbitration.
  • Project portability: If the project is exported to a different LOGO! 8.FS4 unit, the VM mapping table is preserved in the .lsc file but only takes effect after a fresh download. Upload-from-device does not always restore the VM mapping configuration.
Safety caveat: A LOGO! 8 is a logic relay, not a safety PLC. Never use VM-mapped values as the input to a safety function (E-stop, light curtain, guard door). Use a dedicated safety relay (SIRIUS 3SK) or a fail-safe PLC (S7-1500F) for any category 1–4 (PL a–e) function.

12. Quick Reference: VM Mapping Procedure

TL;DR for the field engineer:

  1. Place a Counter (or Up/Down) block in the FBD program.
  2. Open Tools → Parameter VM Mapping.
  3. Add a row, pick the counter symbol, set the VM address, enable S7 and/or Modbus.
  4. Compile and download the project to the LOGO! 8.FS4.
  5. Configure the LOGO! to permit the S7 connection (PUT/GET on by default since 8.FS2) and Modbus TCP server (8.FS4+ only).
  6. From the SCADA, read the mapped word/double-word. For 32-bit counters, read two consecutive registers and respect the high/low word order.
  7. Verify with an endurance test across the 32,767 boundary.

For full parameter lists and protocol details, refer to the official LOGO!Soft Comfort V8.4 Online Help (Siemens Support entry ID 100782807).

Can I read a LOGO! counter value directly with an AM block?

Yes, but only while the count is within the 16-bit signed range (−32,768 to +32,767). LOGO!Soft Comfort will truncate the upper 16 bits of the 32-bit counter when wired to an AM block. For any value above 32,767 you must use Parameter VM Mapping to publish the full 32-bit DINT.

How do I open the VM mapping dialog in LOGO!Soft Comfort?

Go to Tools → Parameter VM Mapping (0BA7 and later versions only). The menu entry is only enabled when the target hardware is set to 0BA7 or 0BA8 and the project was last saved in V8.x. Up to 64 parameters can be mapped per project on firmware 8.FS4.

Does Modbus TCP work on every LOGO! 8, or only on 8.FS4?

Modbus TCP server support was introduced in firmware 8.FS4. Modules running 8.FS0–8.FS3 only expose S7 communication. Update the LOGO! base module firmware to 8.FS4 or later via LOGO!Soft Comfort's online update to use Modbus.

What is the address format for a 32-bit counter in the VM area?

A 32-bit DINT occupies two consecutive 16-bit VM words. With the counter mapped to VW0, the high word is at VM word 0 and the low word at VM word 1. On Modbus TCP this is read as Holding Registers 0 and 1 in big-endian order; on S7 the same value is read as DB1.DBD0 in a single 32-bit access.

Why does my SCADA show 32,767 and stop incrementing?

Almost always because the counter is wired to a 16-bit AM flag, not a 32-bit VM mapping. Move the binding to a VM row in the Parameter VM Mapping dialog and re-read as a 32-bit DINT. The 16-bit limit is structural, not a driver or firmware bug.

Back to blog