Overview
The Siemens LOGO! 8 modular logic relay family supports an internal counter range of 0 to 999,999, but its underlying integer arithmetic is bounded by the standard 16-bit signed range of -32,768 to +32,767. When two LOGO! 8 controllers exchange data over an Ethernet network, the Network Analog I/O (NAI/NAO) blocks only carry a 16-bit word, so any value above 32,767 sent through the analog network path is clipped to 32,767 on the receiving side. This article documents the field-proven technique to move the full 999,999 counter range between two LOGO! 8 controllers by using the VM parameter mapping service over Ethernet and reconstructing the value with a counter function block in the destination LOGO!.
The method is useful for any application where a slow (<10 Hz) or fast (<2 kHz) counter on one LOGO! must be displayed, totalized, or acted on by a second LOGO! that drives the HMI. The worked example in this article comes from an agricultural seeding machine with eight row units, each dropping twenty seeds per second, requiring end-of-day totals well above the 32,767 threshold.
LOGO! 8 Counter Limits: 32,767 vs 999,999
The apparent contradiction between the two limits comes from two different data types used in the LOGO! 8 firmware:
| Data Path | Type | Min | Max | Resolution |
|---|---|---|---|---|
| Counter function block (Up/Down, Hi-Speed) | 32-bit BCD/integer | 0 | 999,999 | 1 count |
| Analog function block math | 16-bit signed integer | -32,768 | +32,767 | 1 LSB |
| Network Analog Input/Output (NAI/NAO) | 16-bit signed integer | -32,768 | +32,767 | 1 LSB |
| VM parameter mapping (V-word pairs) | 32-bit (two V-words) | -2,147,483,648 | +2,147,483,647 | 1 count |
The counter block stores its actual value in the LOGO!'s internal Variable Memory (VM) as a 32-bit value. The Network Analog block, however, samples only the lower 16 bits of that VM word. A counter reading of 360,000 looks like 360,000 - 327,680 = 32,320 inside the analog block after the firmware wraps the value, and a reading of 200,000 wraps to a different negative number. This is why operators see the network counter "stuck" at 32,767 on the receiving LOGO!.
The cure is to map the full 32-bit VM word from the source LOGO! to the destination LOGO! using LOGO!'s peer-to-peer VM mapping service. The destination then reads the high and low V-words into a counter block, which is intrinsically 32-bit and can hold the entire 0 to 999,999 range.
Prerequisites
Before beginning the configuration, confirm the following hardware and software are available:
- Two LOGO! 8 base modules (6ED1052-1MD08-0BA1, 6ED1052-1CC08-0BA1, or any 0BA8 variant). The 0BA7 (LOGO! 7) hardware does not support VM parameter mapping.
- LOGO! Soft Comfort V8.3 or later installed on the engineering PC. The download is available from the Siemens LOGO! 8 system manual portal and the Siemens Industry Online Support.
- Ethernet network between the two LOGO! 8 devices. A direct patch cable, a small unmanaged switch, or a plant network all work as long as the IP subnets match.
- Static IP addresses assigned to each LOGO!. The default is 192.168.0.1 / 255.255.255.0; change the second LOGO! to a free address (e.g. 192.168.0.2).
- LOGO! TD display (optional but recommended) if the destination LOGO! is to show the live count. The TD plugs into either base module.
- Wiring harness for the counter sensor. The Hi-Speed counter inputs on the LOGO! 8 are I1 through I4; I5 and I6 are regular digital inputs.
Network Architecture and IP Setup
The two LOGO! 8 devices exchange VM data over an Ethernet UDP broadcast that the firmware uses for peer-to-peer mapping. No external switch configuration is required, but the IP addresses must be in the same /24 subnet and the master/slave direction must be set in the project.
| Role | Default IP | Suggested IP | Subnet Mask | Function |
|---|---|---|---|---|
| Source LOGO! (counter master) | 192.168.0.1 | 192.168.0.10 | 255.255.255.0 | Hosts counter input, owns the VM mapping server |
| Destination LOGO! (counter client) | 192.168.0.1 | 192.168.0.20 | 255.255.255.0 | Hosts the display, runs the receiving counter block |
| LOGO! TD (optional) | 192.168.0.10 | 192.168.0.30 | 255.255.255.0 | HMI on either base |
Set the IPs in LOGO! Soft Comfort > Tools > Ethernet Connections or directly on the device via the Setup > Network menu and the cursor keys. The second LOGO! must have a unique IP. If you are using a managed plant network, ask IT to allow UDP port 10004 and broadcast packets.
VM Parameter Mapping Architecture
LOGO! 8 exposes its internal variables to other LOGO! devices through a parameter-mapping service. The receiving side declares which V-word (or V-word pair) it wants to read from the source's VM address space. The transfer happens automatically each LOGO! scan, with a typical latency of 100-200 ms.
For 32-bit values, two adjacent V-words must be mapped:
| 32-bit VM Address (low word) | 32-bit VM Address (high word) | Common Block Reference | Notes |
|---|---|---|---|
| VW0 | VW2 | Counter block B001 in slot 1 | Default location of first counter |
| VW4 | VW6 | Counter block B002 in slot 2 | Second counter |
| VW8 | VW10 | Counter block B003 in slot 3 | Third counter |
| VW12 | VW14 | Counter block B004 in slot 4 | Fourth counter |
| VW16 | VW18 | Counter block B005 in slot 5 | Fifth counter (e.g. totalizer) |
Each counter block reserves 4 bytes of VM. When the operator drags a counter block onto the FBD canvas, the compiler assigns the next free VM quadruple. The block number (B001, B002, B005, etc.) is the user-visible label; the VM address is what the network mapping actually moves.
Step-by-Step: Configuring the Source LOGO!
Follow these steps to prepare the LOGO! 8 that owns the fast counter input. In the seeding-machine example, this is the LOGO! wired to the eight seed-tube sensors.
- Open the project for the source LOGO! in LOGO! Soft Comfort V8.3.
- Drag an Up/Down Counter block (function block B005 in the worked example) onto the canvas. Connect the count-up input to a digital input wired to the seed sensor. Connect the reset input to a manual pushbutton or a "reset day" flag.
- Set the On threshold to 0 and the Off threshold to 999,999. The counter block will then roll over the full LOGO! 8 range.
- Optionally, add a Threshold Trigger on the counter output to fire an alarm when the count exceeds a daily target.
- Open Tools > Ethernet Connections. Confirm the source LOGO!'s IP is set to 192.168.0.10 and the subnet mask to 255.255.255.0.
- Open Tools > Parameter VM Mapping (or in newer versions, Tools > Parameter Mapping). Enable the mapping server and mark the V-words that the source should publish. For a single counter, tick
VW0,VW2(the high and low 16-bit halves of the 32-bit counter value). For multiple counters, markVW4/VW6,VW8/VW10, andVW12/VW14as well. - Save and download the program to the source LOGO! over Ethernet.
Step-by-Step: Configuring the Destination LOGO!
The destination LOGO! is the one that drives the operator display. It pulls the counter value from the network and presents it on the local TD or built-in display.
- Open the destination LOGO!'s project in LOGO! Soft Comfort V8.3.
- Open Tools > Parameter VM Mapping. Add a new client entry:
| Field | Value |
|---|---|
| Source IP | 192.168.0.10 |
| Source V-word (low) | VW0 |
| Source V-word (high) | VW2 |
| Destination V-word (low) | VW0 (local) |
| Destination V-word (high) | VW2 (local) |
| Update interval | 100 ms (default) |
- Add additional client rows for
VW4/VW6,VW8/VW10, andVW12/VW14if multiple counters are needed (B005-B008 in the field case). - Drag a Counter block onto the destination canvas. Assign it to read from local
VW0/VW2. Configure the block's Set Value input to be driven by the received VM, so the counter reflects the source value at all times. - Configure a Message Text on the local display or TD showing the live counter value. The message text uses the syntax
Counter value = [VW0]in the display configuration; the runtime will resolve the 32-bit value. - Add a Threshold Trigger on the destination counter if you need end-of-day alarms.
- Save and download the program to the destination LOGO!.
Displaying the Counter Value in the Destination LOGO!
A common field question is how to display a value above 32,767 in the destination LOGO! since LOGO!'s native message text only displays 16-bit signed values. The trick is to use the counter block in display mode, not the analog block:
- Bind the message text field to the local counter block's "CV" (current value) tag rather than the raw VM word.
- The counter block can display up to 999,999 on the TD without overflow.
- If the user wants the value in a numeric field that does not support counter CV, use an analog amplifier block fed from the counter's CV with a gain of 1; the amplifier will then show the value correctly up to 999,999 on the TD.
The TD's character set and resolution are sufficient for six-digit display. If a real-time clock value is also needed, a separate VM pair can be mapped in parallel.
Field Application: 8-Unit Seed Counter
The technique was proven on an agricultural seeder. The machine has eight row units, each driven by a pneumatic seed meter. A photoelectric sensor on each drop tube produces one pulse per seed. With a planting speed of 20 seeds per second per row, the peak count rate is:
f_max = 8 units × 20 seeds/sec = 160 Hz
This is well within the Hi-Speed counter rating of the LOGO! 8 (up to 2 kHz on I1-I4) and far above what a network analog block can carry, because each row must totalize to ~172,800 seeds in a 3-hour shift. Operators need an end-of-day total per row plus a grand total, all of which exceed 32,767 after a single hour at peak rate.
| Block # | Source Input | Source VM Address | Function |
|---|---|---|---|
| B005 | I1 (Row 1 sensor) | VW0 / VW2 | Seeds row 1 |
| B006 | I2 (Row 2 sensor) | VW4 / VW6 | Seeds row 2 |
| B007 | I3 (Row 3 sensor) | VW8 / VW10 | Seeds row 3 |
| B008 | I4 (Row 4 sensor) | VW12 / VW14 | Seeds row 4 |
| Math | B005+B006+B007+B008 | VW16 / VW18 | Daily grand total |
Each row counter is mapped across the network to the destination LOGO!, where a master counter block accumulates the grand total and a message text shows the operator the four row totals and the running grand total. The destination LOGO! also drives a TD that the operator uses from a single point on the machine.
Why Simulation Differs from Real Hardware
LOGO! Soft Comfort's built-in simulator does not implement the VM parameter-mapping protocol. The simulator treats the project as a single isolated LOGO! and resolves all VM references locally. As a result:
- Source and destination LOGO! projects each run in their own simulator instance with no shared VM space.
- VM mapping client entries appear to bind, but the simulator never opens the UDP socket, so no values arrive.
- The destination counter block reads from VM zero and stays at 0.
To validate the configuration, you must download both projects to two physical LOGO! 8 units. Watch the destination's TD or web server to confirm the counter increments.
Function Block Reference: Counter B005-B008
The four counter blocks used in the seeding example share the same parameters. Configure them as follows in LOGO! Soft Comfort:
| Parameter | Typical Value | Description |
|---|---|---|
| Count input | I1 (or I2, I3, I4) | Digital input wired to the sensor |
| Reset input | M1 (manual flag) or I5 | Manual reset pushbutton |
| Direction input | Not used (count up only) | Leave unconnected for up-only |
| On threshold | 0 | Trigger threshold for the On output |
| Off threshold | 999,999 | Trigger threshold for the Off output |
| Start value | 0 | Initial count at power-up |
| Retentivity | Enabled | Survives power cycle; disable for non-resettable totals |
The counter block in LOGO! 8 stores its current value (CV) in VM and exposes a tag for use in message text, math blocks, and network mapping.
Verification Procedure
Once the two LOGO! 8 units are programmed and wired, verify the counter transfer with this checklist:
- Power both LOGO! 8 units and confirm their IP addresses from the front-panel Setup > Network menu.
- From a PC on the same subnet, ping each IP. Both must reply.
- Open the LOGO! 8 web server in a browser at
http://192.168.0.10andhttp://192.168.0.20. Confirm the firmware version on both pages. - Drive a known number of pulses into the source LOGO!'s counter input (a function generator or button mashing). For the seed application, spin the meter with 100 manual seeds and verify the count on the source TD first.
- Watch the destination TD or web server. The counter value must follow the source within 1 second.
- Cycle power on the destination LOGO! only. After re-start, the destination counter must resume from the source's current value within 2 seconds (the VM client re-binds automatically).
- Cycle power on the source LOGO! only. After re-start, the destination counter must continue to track the source's restarted count.
- Drive the count above 32,767. Confirm the destination counter does not cap at 32,767 and continues to display 32,768, 32,769, ... up to 999,999.
Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| Destination counter stays at 0 | VM mapping client not bound, wrong source IP, or both LOGO! on same IP | Verify both IPs are unique. Confirm client row in Parameter VM Mapping shows enabled. Ping the source IP from the destination network. |
| Destination counter caps at 32,767 | Network Analog Output/Input used instead of VM mapping | Replace analog blocks with VM mapping. Analog blocks are 16-bit and cannot exceed 32,767. |
| Destination counter shows random values | V-word offset mismatch (low/high swapped, or pair offset wrong) | Verify the low and high V-word addresses match between source publish and client subscribe. Re-check the block layout in the compiler VM map. |
| Value works in production but not in simulation | LOGO! Soft Comfort simulator does not implement VM mapping | Test on real hardware. Simulation is not a reliable indicator of network behaviour. |
| B005-B008 blocks not visible in destination | Destination block numbers refer to local instances, not source | Block numbers (B005...) are per-project. In the destination project, B005 is a local counter; map the source VM into the destination's local counter input. |
| Counter rolls over unexpectedly | Off threshold set below current value, or retentivity disabled | Set On=0, Off=999,999. Enable retentivity if you need survival across power cycles. |
| Display shows negative numbers | Message text bound to raw 16-bit VM word instead of counter CV | Bind the message text to the counter's CV tag, not the raw VM address. The counter renders as 0-999,999. |
| Value updates are slow (seconds) | Network congestion, switch on plant VLAN dropping UDP broadcasts | Use a direct cable or a dedicated unmanaged switch for the LOGO! pair. Confirm UDP broadcast is allowed. |
Common Pitfalls and Field-Proven Caveats
- Block-number reuse: B005-B008 are block numbers within a single LOGO! project. They do not transfer across the network. You must recreate the counter block in the destination project and bind its "Set Value" input to the mapped VM pair.
- Power-on initial value: The destination counter's start value is 0 until the first VM mapping update arrives, typically within 100-200 ms. The TD may briefly flash 0 at boot.
- Time-of-day sync: If the operator needs timestamped totals, map the LOGO!'s RTC variables in addition to the counter. The RTC is published as a separate VM region.
- More than two LOGO!s: Up to eight LOGO! 8 base modules can participate in the same VM mapping multicast. Each destination subscribes only to the V-words it needs. Bandwidth remains low.
-
Web server viewing: The destination LOGO!'s built-in web server can display the local counter CV without additional configuration. Browse to
http://192.168.0.20to verify remotely. - LOGO! Access Tool: Not required. The technique works with the LOGO! 8 firmware alone, no Access Tool runtime, no cloud connection.
Related LOGO! 8 Topics Worth Knowing
For projects that exceed the LOGO!'s local I/O, the same VM mapping service can be used to share boolean flags, analog values, and even network state between multiple LOGO! 8 base modules. Combining the counter-transfer technique with the LOGO! 8 web server and TDE (text display with Ethernet) gives a low-cost distributed control system that is more capable than the price suggests.
When higher counter rates (>2 kHz) are needed, add a LOGO! 8 high-speed counter module (LOGO! 8.3 firmware) or offload to an S7-1200 with the Siemens S7-1200 system manual. The VM mapping is unique to LOGO! and is not part of the S7 ecosystem.
What is the maximum counter value that can be transferred between two LOGO! 8 PLCs using VM mapping?
999,999. The counter function block itself stores values from 0 to 999,999. The VM parameter mapping service carries the full 32-bit value, so the destination counter block can display the complete range. The 32,767 ceiling only applies to the legacy Network Analog I/O blocks, not to VM mapping.
Why does my network counter stay at 32,767 in the receiving LOGO!?
You are probably using a Network Analog Output (NAO) block in the source and a Network Analog Input (NAI) block in the destination. These blocks are 16-bit signed and saturate at 32,767. Replace them with VM parameter mapping and a counter block in the destination as described above.
Do I need the LOGO! Access Tool to transfer counter values?
No. The VM parameter mapping service is built into LOGO! 8 firmware 0BA8 and later and works without the Access Tool. The Access Tool is only needed if you want cloud logging or SMS alerts.
Will the technique work in LOGO! Soft Comfort simulation?
No. The simulator does not implement the VM mapping protocol. The destination counter will stay at 0 in simulation even if the configuration is correct. Always verify on two real LOGO! 8 devices.
How many LOGO! 8 devices can share VM data on the same network?
Up to eight LOGO! 8 base modules can participate in a single VM mapping multicast group. Each module publishes its V-words; each subscriber picks the V-words it needs. There is no master/slave restriction.
Can the destination LOGO! display a value above 32,767 on its TD?
Yes, if you bind the message text to the local counter block's CV (current value) tag, not to the raw 16-bit VM word. The counter block can display up to 999,999 on a LOGO! TD or built-in display.