LOGO! 8: Implementing 10-Output Pump Selector with VM Mapping

David Krause19 min read
HMI ProgrammingSiemensTutorial / 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

Overview

Siemens LOGO! 8 logic modules support a compact 1-of-N pump selector in which the operator chooses one of 10 pumps from a LOGO! TDE text display, confirms the selection with F2, and the controller drives a single digital output. The technique described in the field report uses the LOGO!Soft Comfort "Up/Down Counter" (function block 001, B001) to hold the pump index, the VM (Variable Memory) parameter mapping to expose the counter value to the network analog input domain, a "Network Analog Input" block (AI) to read the value back into the logic, and ten "Analog Threshold Triggers" (function block 003, B003) to decode the index into discrete outputs Q1..Q10.

The pattern matters for two practical reasons. First, on LOGO! 0BA8 and later, the counter's "Ref" output is typed and cannot be wired directly to a free-floating comparator chain without an intermediate marker; VM mapping is the cleanest way to publish the value for both the local logic and any S7 client (e.g., TIA Portal HMI). Second, the threshold-trigger approach gives a 1-count hysteresis band around each pump number, eliminating the chatter that direct equality comparators produce during key-hold transitions. The full VM-mediated design is documented in the LOGO! 8 system manual and the LOGO!Soft Comfort V8.4 manual.

Prerequisites and Hardware Sizing

  • LOGO! 8 BM Basic Module: catalog 6ED1052-1xx08-0BAx (0BA8 family). Recommended firmware FS04 (LOGOSYS V8.3) or FS05 (LOGOSYS V8.4) for stable VM behavior. See the LOGO! 8 system manual, chapter "Technical data".
  • LOGO! TDE text display: catalog 6ED1055-4MH08-0BA0 (FS04) or 6ED1055-4MH08-0BA1 (FS05). The TDE provides the F1, F2, ESC, OK, and four cursor keys that this design binds to digital inputs I1..I5.
  • LOGO!Soft Comfort V8.3 or V8.4: catalog 6ED1058-0BA08-0YA1 (V8.3) or 6ED1058-0BA08-0YA2 (V8.4). Online test, parameter VM mapping view, and Watch Table require V8.2 or later.
  • Power supply sizing: a 24RCE (6ED1052-1MD08-0BAx) draws 0.7 W idle and 1.7 W with all relays energized. The internal 24 V sensor bus delivers up to 4 A. For 115-240 V supply, use a 230RCE (6ED1052-1FB08-0BAx). Reference: LOGO! 8 system manual.
  • Output count check: a base 0BA8 BM exposes Q1..Q4. Adding one AM2 (6ED1055-1MB00-0BA2) extends the digital rail to Q1..Q8; a second AM2 extends to Q1..Q10. Plan the AM2 count before writing the program; LOGO!Soft Comfort only enables Q1..Q8 by default on a single-AM2 setup and will not permit you to drag Q9/Q10 onto the diagram until the second AM2 is in the project setup.
For 10 outputs you must install at least two AM2 digital modules in addition to the BM. The BM has no onboard Q9/Q10, and the AM2 RTD (6ED1055-1MD00-0BA2) consumes a slot without adding Q outputs - place it only if you need PT100/PT1000 inputs.

Block Function Reference

Block Designation Library Use in this design
B001 Up/Down Counter Counters Holds pump index 0..10
B003 Analog Threshold Trigger Analog Decode index to Q1..Q10 (x10 instances)
AI Network Analog Input Analog / Networking Read counter value back from VM
B004 On-Delay Timers Debounce TDE keys (100 ms)
I1..I5 Digital inputs wired to TDE keys I/O Operator panel interface

VM Memory and Network Analog I/O Architecture

LOGO! 8 reserves a 16-bit address space known as VM (Variable Memory) for parameter mapping, inter-block data exchange, and S7-style network analog I/O. The relevant ranges per the system manual are:

Range Width Typical use
VM 0..847 (byte) 8 bits Bit-level flags, network digital I/O
VM 0..849 (word, VW) 16 bits signed Network analog inputs (NAI) / outputs (NAQ)
VM 0..848 (dword, VD) 32 bits Counter/timer Ref output destinations
VM 850..859 16 bits Reserved for firmware (date/time, key state, etc.)
VM 1024.. 16 bits Application-specific remanent area (0BA8+)

Counter B001's "Ref" output (the current integer count) can be parameterized to a VM address by clicking the Ref pin in LOGO!Soft Comfort and selecting "VM address" in the assignment dropdown. Mapping the Ref to VD0 (dword 0) places the live count into the lower 16 bits of the dword, visible as VW0. The high word of VD0 is also a valid 16-bit value, so the community-recommended approach is to read VW2 with a network analog input - this places the index into a separate analog variable that does not overlap with any other 16-bit VM that the lower dword shares. Equivalent configuration: AI Type="Word", Source=VD0 with Gain=1; both reads work.

LOGO! 8 uses little-endian byte ordering. VD0 occupies bytes VB0 (LSB) and VB1 (MSB); the high word at VB2..VB3 is therefore VW2. If you add a second counter and map its Ref to VD8, the lower 16 bits land in VW16 and can be read by a second AI block without colliding with the first. Plan the VM layout before placing blocks, because LOGO!Soft Comfort does not warn about collisions.

Architecture Diagram

LOGO! TDE (6ED1055-4MH08) F1 -> I1 (open menu) F2 -> I2 (confirm run) Right -> I3 (count up) Left -> I4 (count down) Display: "Pump 1..10" ESC -> I5 (cancel) Cat 6ED1055-4MH08-0BA0 LOGO! 8 BM (0BA8/0BA9) B001 Up/Down Counter Ref -> VM VD0 AI (Word, VW2) AQ -> M1 Threshold triggers B003-a: On=1, Off=2 B003-b: On=2, Off=3 B003-c: On=3, Off=4 ... B003-j: On=10, Off=11 Output assignment Q1..Q10 (relay out) Max setup: BM+AM2+AM2 Pumps P1 - Q1 P2 - Q2 P3 - Q3 P4 - Q4 P5 - Q5 P6 - Q6 P7 - Q7 P8 - Q8 P9 - Q9 P10- Q10 Fuses 1A FF Coil 24 VDC Contactor 9A

Step-by-Step Implementation

Step 1 - Build the Counter

  1. Open LOGO!Soft Comfort and create a new project. Select the target BM (e.g., 0BA8 / 0BA9) and TDE in the project setup wizard. The wizard sets the maximum block count and the available VM range.
  2. Drag an Up/Down Counter (B001) onto the diagram. In the block properties, set:
    • Cnt input: digital input I3 (cursor right = count up)
    • Dir input: digital input I4 (cursor left = count down) - tie low if not used
    • On threshold: 10
    • Off threshold: 0
    • Start value (preset, optional): 0
  3. Click the Ref pin. In the assignment dropdown, choose "VM address" and enter VD0. The Ref pin is now the live 0..10 count, written to VM dword 0.
  4. Optional: in the Remanence tab, enable the retentive flag if you need the selected pump to survive a power cycle. The 0BA8 retains 30 bytes of application data (see system manual "Remanence" chapter).

Step 2 - Read the Value via Network Analog Input

  1. Drag a Network Analog Input (AI) block onto the diagram. In LOGO!Soft Comfort V8.3/V8.4 the block is in the analog library under "Network".
  2. Open AI properties. Set Type="Word" and Source=VW2. The AI block now reports the counter value as an analog quantity 0..10 on its output pin AQ.
  3. Wire the AQ pin to a marker block (M1) so other parts of the program can read the "selected pump index" without re-entering the analog chain. M1 is also the tag exposed to a TIA Portal HMI if you are using LOGO! as an S7 client.
If LOGO!Soft Comfort shows a red exclamation mark on the AI block, the most common cause is a VM address collision with another block. Open the Watch Table, view VD0, and confirm no other block writes to the same dword. The 0BA8 has 850 bytes of VM and collisions only occur in tight designs.

Step 3 - Add 10 Analog Threshold Triggers

  1. Drag ten Analog Threshold Trigger blocks (B003-a through B003-j) onto the diagram. Each one will decode a single integer value of the index into one digital output.
  2. Configure each block identically except for the threshold values:
    Block On threshold (>=) Off threshold (<) Output
    B003-a 1 2 Q1 (pump 1)
    B003-b 2 3 Q2 (pump 2)
    B003-c 3 4 Q3 (pump 3)
    B003-d 4 5 Q4 (pump 4)
    B003-e 5 6 Q5 (pump 5)
    B003-f 6 7 Q6 (pump 6)
    B003-g 7 8 Q7 (pump 7)
    B003-h 8 9 Q8 (pump 8)
    B003-i 9 10 Q9 (pump 9)
    B003-j 10 11 Q10 (pump 10)
  3. Set the analog input Ax source of every B003 block to the same marker (M1) that holds the AI output. Verify Gain=1.0 and Offset=0 on every block.

Step 4 - Wire Outputs Q1..Q10

Connect the output of B003-a to Q1, B003-b to Q2, and so on. The Q pins must be assigned on a LOGO! BM that physically exposes them. On a 0BA8 base module Q1..Q4 are onboard; Q5..Q8 require one AM2 extension, and Q9..Q10 require a second AM2 extension module. See the LOGO! 8 system manual, chapter "Maximum setup".

The maximum setup for a 0BA8 BM is BM + AM2 RTD + AM2 AQ + 4 x AM2 (digital). Beyond four AM2 modules the I/O bus saturates and the BM rejects the configuration. Plan the cabinet space and DIN-rail length accordingly. The BM is 72 mm wide; each AM2 is 36 mm; the TDE is 128 mm; total width for a 10-output setup is approximately 72 + 36 + 36 + 128 = 272 mm.

Step 5 - Tie the TDE Keys to Inputs and Configure the Menu

  1. Open Tools > Display > Key Assignment in LOGO!Soft Comfort.
  2. Map the TDE keys as follows:
    TDE key Drives digital input Function
    F1 I1 Open menu / latches M2
    F2 I2 Confirm run / latches M3 (run command)
    Right I3 Counter increment (B001 Cnt)
    Left I4 Counter decrement (B001 Dir)
    ESC I5 Cancel menu / reset M2
  3. Configure two message texts on the TDE:
    • Idle: "Pump 1..10 - F1 menu". Visible when M2 is low.
    • Menu: "Pump N (current M1 value) - F2 start". Visible when M2 is high. The M1 marker is inserted as a placeholder token.
  4. Add an On-Delay (B004) of 100 ms between the TDE keys and the B001 input to debounce contact bounce. The 0BA8 default scan time is ~10 ms, but a single debounce step is recommended for operator panels.

State Machine View

Idle F1 Menu Right Selecting F2 Run F1 or ESC

Threshold Trigger Configuration Reference

Parameter Range Recommended for this design Notes
On -200000..200000 1..10 (one per block) Index at which the block turns on
Off -200000..200000 2..11 (one per block) Index at which the block turns off. Set Off = On+1 for 1-count hysteresis.
Gain 0.01..10000 1.0 Multiplier applied to Ax
Offset -10000..10000 0 Additive offset on Ax
Invert output On / Off Off Off = high on threshold match
Ax source Marker / analog input M1 AI block output (counter value)
LOGO! 8 re-evaluates the threshold trigger every program cycle (~10 ms with the 0BA8 default). A 1-count hysteresis (On+1 / Off) prevents the output chattering while the operator holds the right-arrow key. Without hysteresis, Q3 and Q4 will alternate briefly during the count-up from 3 to 4 because the analog value is read as an integer and the boundary event triggers both blocks for one cycle.

Parameter Reference Table

Address Width Source block Source pin Consumer block Consumer pin
VD0 DWord B001 Up/Down Counter Ref AI block Type=Word, Source=VW2
VW2 Word (read-only VM view of VD0) - AI block AQ
M1 Word marker AI block AQ 10 x B003 Ax
Q1..Q10 Digital 10 x B003 Q Pump contactors Field wiring
I1 Digital TDE F1 - M2 (menu latch) S
I2 Digital TDE F2 - M3 (run command) S
I3 Digital TDE cursor right - B001 Cnt
I4 Digital TDE cursor left - B001 Dir
I5 Digital TDE ESC - M2 (reset) R

Verification Procedure

  1. In LOGO!Soft Comfort, click Tools > Online Test (or press F11). The project must already be transferred to the BM via Ethernet.
  2. Open the Watch Table (View > Watch Table). Add the following tags: B001/CV (current value), VD0, VW2, M1, Q1..Q10.
  3. Press F1 on the TDE. Confirm M2 latches high and the message text "Select pump 1..10" appears on the TDE.
  4. Press cursor right three times. Confirm B001/CV = 3, VW2 = 3, M1 = 3, and Q3 lights. Q1 and Q2 must remain low.
  5. Press cursor right once more. Confirm B001/CV = 4, Q3 drops, Q4 lights. The 1-count hysteresis should keep Q3 from flickering at the boundary.
  6. Press F2. Confirm M3 latches and the run command is asserted on the field wiring side (pump contactor pulls in, current monitor on Q3 or Q4 shows load).
  7. Hold cursor right past 10. Confirm B001 saturates at 10 and does not roll to 0 (this is the threshold-On behavior of B001 with On=10).
  8. Power-cycle the BM. Confirm B001 resets to 0 (no retentive flag set) and Q1..Q10 all drop. The default is non-retentive; set the retentive flag on B001 if you need power-loss memory.
  9. Inspect VM 0 in LOGO!Soft Comfort parameter view (View > Parameter VM Mapping) and confirm VD0 reflects the live counter value. The expected pattern: 0x0000 0000 at idle, 0x0000 0004 at index 4, etc.

Troubleshooting Matrix

Symptom Probable cause Fix
Counter increments but no Q output ever lights VM mapping missing - B001 Ref pin is unassigned or assigned to a constant Open B001 Ref, set assignment to "VM address", enter VD0
All ten Q outputs light at the same time AI block source is constant 0 and the threshold triggers see only 0; alternatively, Gain is set to 0 Set AI Source to VW2; set Gain to 1.0 on every B003
Adjacent Q outputs both light when index changes Threshold trigger On and Off values identical, no hysteresis Set Off = On+1 per the table above
Output Q9 or Q10 will not energize Hardware does not have a second AM2 module installed Add AM2 (6ED1055-1MB00-0BA2) on the right of the BM
TDE F1 / F2 do not register on inputs LOGO! is in display edit mode rather than run; TDE key assignment is set to "ESC" or "OK" instead of "F1/F2" Tools > Display > Key assignment; map keys to digital inputs I1..I4 explicitly
VW2 reads 0 even though B001 counts Counter mapped to wrong dword (e.g., VD100), VW2 is the low word of a different dword Verify VD0 is the B001 destination; re-check using Watch Table on VD0 directly
Project transfers but TDE shows dashes TDE catalog not compatible with BM firmware (e.g., FS05 BM with FS04 TDE) Match TDE FS to BM FS; see the LOGO!Soft Comfort V8.4 manual, appendix "Compatibility"
Threshold triggers all toggle at the wrong count Gain is set to 10 or 0.1 instead of 1, scaling the analog value Reset Gain to 1.0 and Offset to 0 on every B003
Counter rolls over past 10 Threshold On is set higher than 10, so the saturation logic is disabled Set B001 On threshold to 10 to enable saturation
Run command (M3) self-clears on power cycle M3 is wired to a non-retentive marker; the pump starts on power-up unintentionally Wire M3 through a retentive flag if the requirement is to start in last state; otherwise leave non-retentive for safety
TDE cable is too long, keys register intermittently LOGO! TDE cable maximum length is 10 m (RS-232-style flat cable). Beyond 10 m use the Ethernet TDE variant or a 24 V TDE repeater Re-route the TDE cable, or use the LOGO! 8 Ethernet TDE if available in the catalog

Alternative Implementations

Direct Comparator Chain (B001 + 10 Comparators)

Where the project has spare comparator blocks and you want to avoid VM mapping, a chain of "Analog Comparator" blocks (function block 002, B002) can read B001's Ref pin directly. Each B002 has Ax = B001/Ref and Ay = constant 1..10. This is the approach some LOGO!Soft Comfort versions recommend when VM mapping is unavailable, but it costs ten B002 blocks plus the B001, and the Ref pin must be wired to all of them - acceptable on 0BA7 and earlier where the Ref pin is an untyped analog output, but visually cluttered in larger programs and not viable on 0BA8 where the typed Ref pin cannot be wired to ten blocks at once without an intermediate marker.

Shift Register Cascade (Single-Pump Mode)

For installations where only one pump may run at a time, a shift register (B004 "Shift Register" or a string of latching relays driven by a single "edge" input) gives mutual exclusion for free. However, this loses the "select a number, confirm with F2" UX of the original design and is a different functional requirement. Choose this only if the system spec is "rotate through the 10 pumps on each F2 press".

LOGO! 8 with S7-1200 / TIA Portal HMI

On a LOGO! 8 BM with a S7 connection, expose the VM area as a DB block in TIA Portal. The M1 marker becomes a tag that any Comfort Panel / KTP can read and display. Threshold trigger output bits can also be mapped to the BM's own Q area for direct feedback in the TDE message text. Reference: LOGO! 8 system manual, chapter "LOGO! as S7 client". For systems that outgrow LOGO! 8 (typically 200+ blocks or 16+ pumps), migrate to a SIMATIC S7-1200 (CPU 1214C DC/DC/DC, catalog 6ES7214-1AG40-0XB0) with the same S7 source from TIA Portal - the threshold-trigger pattern is replaced by an FC that compares an integer tag to constants and sets output bits directly.

LOGO! 8 with DM16 Expansion

If you need more than 10 outputs and cannot add AM2 modules, use a DM16 (6ED1055-1CB00-0BA0) digital module. It adds 8 digital inputs and 8 digital outputs in the same housing, but only on a S7-1200 / ET 200SP, not on a LOGO! 8 BM. For a LOGO! 8 with more than 10 Q outputs, the practical limit is 24 Q via three AM2 modules (Q1..Q24, with the BM using the first 8).

Modbus TCP Exposure of VM

LOGO! 8 firmware FS04 and later supports Modbus TCP server on port 502. The VM area is exposed as holding registers at offset 0x0000 - 0x03FF. Read VW2 at register address 0x0002 (word). This is the cleanest way to publish the selected pump index to a SCADA system without TIA Portal. See the LOGO! 8 system manual chapter "Modbus communication".

Field Commissioning and Safety Notes

  • Relay derating: a 0BA8 relay output is rated 8 A resistive / 2 A inductive (AC-15) per the system manual. For three-phase pump contactors driven by Q1..Q10, route each Q through an interposing relay rated for the contactor coil. The derated cycle life at full load is approximately 100,000 operations; for a 1 start/hour application this gives ~11 years of life before contact replacement.
  • Power-budget check: ten simultaneously-energized relay coils on the LOGO! outputs draw approximately 10 x 0.5 W = 5 W of contact dissipation, plus the contactor coil current. The 24RCE sensor bus is rated 4 A; if you power the contactor coils from this rail, leave 1 A headroom for sensor supply.
  • Retentive counter flag: enabling the retentive flag on B001 reserves 4 bytes of remanent memory. The 0BA8 has 30 bytes of remanent memory; ten retentive counters would exhaust it, leaving no space for the retentive run command marker. Plan retention against the 30-byte budget.
  • Phase-failure upstream: a LOGO! BM cannot detect loss of any phase on its 230 V supply. Place a phase-failure / phase-sequence relay (e.g., Siemens 3UG4511) upstream of the pump bank. Wire its output to an enable input on the run command, so a missing phase blocks all 10 starts.
  • Debounce TDE keys: the 0BA8 default scan time is ~10 ms, but the TDE F1/F2 keys have a 30 ms mechanical bounce. Add an On-Delay (B004) of 100 ms between TDE keys and the B001 input to debounce.
  • EMC: route the TDE cable away from VFD power cables (minimum 200 mm parallel clearance). The TDE cable carries logic-level signals and is susceptible to common-mode noise from variable-frequency drives. Use shielded cable for runs longer than 3 m.
  • Compliance: program structure follows IEC 61131-3; the operator panel wiring follows IEC 60204-1 (emergency stop category 0 or 1, 24 V control). Reference: IEC 61131-3:2013, IEC 60204-1:2016. For SIL applications, the LOGO! 8 is not rated above SIL 1; a SIMATIC S7-1200F or S7-1500F is required for SIL 2/3.

Relay Derating Formula

For ten 24 V DC pump contactor coils driven by the LOGO! Q outputs, the per-contact resistive load and inductive derating is:

P_coil = V_coil x I_coil (W per coil)

For a 24 V DC / 5 W contactor coil:

I_coil = P_coil / V_coil = 5 W / 24 V = 0.208 A (208 mA)

Ten coils summed: 10 x 0.208 A = 2.08 A peak. The 24RCE sensor bus is rated 4 A, so 2.08 A leaves 1.92 A for sensors. If sensor current exceeds 1.92 A, power the contactor coils from a separate 24 V DC power supply and use the LOGO! Q outputs as dry contacts only.

Expected mechanical life (per system manual): 10 million operations no-load; 100,000 operations at 8 A resistive, 240 V AC. The cycle-life ratio at typical 1 start/hour and a 50% duty cycle is:

Lifetime_years = 100000 / (1 start/hour x 8760 hours/year) = 11.4 years

Plan contactor-coil replacement on a 10-year preventive-maintenance cycle, or upgrade to a solid-state AM2 AQ module (6ED1055-1MA00-0BA2) for unlimited cycles.

Frequently Asked Questions

Why does the counter's Ref output not connect directly to the threshold trigger?

On LOGO! 0BA6/0BA7 the Ref pin is a numeric output that can drive analog inputs directly. On 0BA8 and later, the Ref pin assignment is typed, and assigning it to a global marker requires VM mapping. The AI block reads VW2 and re-exposes the value as AQ, which the threshold triggers read. Skip the AI block by setting AI Source to "VD0" with Type="Word" and Gain=1; this is the modern equivalent.

How many pumps can the same VM mapping pattern support?

Up to the LOGO! 8 VM size of 850 bytes (212 words, 106 dwords). Each pump needs one B001 plus ten B003 blocks (11 total), plus one AI block. A 0BA8 with two AM2 modules supports 10 physical Q outputs; if you need more pumps than physical outputs, use a KM-style contactor interlock so the LOGO! drives one selector and the field drives the contactor array.

What firmware level is required for VM mapping to work?

FS02 (0BA7) and later support VM mapping. FS04 (0BA8 firmware) is the practical minimum because earlier versions had VM mapping bugs at the 0x80 boundary. For the AI block, FS03 or later is required. See the LOGO! 8 system manual appendix "Function blocks supported by firmware version".

Can I use a 0BA7 (6ED1052-1HB07-0BAx) instead of 0BA8?

Yes, any 0BA7/0BA8/0BA9 module supports VM mapping, the AI block, and ten B003 triggers. The 0BA2 (LOGO! 8.0) and 0BA0 (LOGO! 7) do not, because they predate VM mapping. Use the LOGO!Soft Comfort version manager (Tools > Card > Module) to lock the project to a known firmware family before downloading.

How do I retain the pump index across a power cycle?

Open B001 properties, switch to the "Remanence" tab, and enable the counter's retentive flag. On next power-up B001/CV is restored from the BM's retentive memory. The retentive area is 30 bytes on a 0BA8 base module per the system manual; each B001 uses 4 bytes, so up to 7 counters can be retentive in addition to the 8 standard markers.

Back to blog