Retaining Network Analog Inputs on Siemens LOGO! After Power-Off

David Krause16 min read
PLC HardwareSiemensTroubleshooting
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

Problem Overview

Engineers integrating a Siemens LOGO! 8 base module (for example, 6ED1052-1MD08-0BA1 or 6ED1052-1CC08-0BA1) with a SIMATIC KTP700 Basic PN HMI frequently encounter a retention issue that is unique to LOGO!'s memory architecture. The symptoms are reproducible and consistent:

  • An operator enters a speed setpoint (typically a frequency reference for a VFD or a 0–10 V command for an analog output) on the KTP700.
  • The setpoint is transmitted to the LOGO! over Ethernet using Network Analog Input (NAI) tags.
  • The setpoint is scaled inside the LOGO! program and routed through a math (Arithmetic) instruction, then written to Analog Output (AQ) blocks B016 and B018 on the base module.
  • When the machine is powered down and back up, the operator's setpoint reverts to 0 even though counters and digital setpoints retained their values correctly.

This behavior is not a defect — it is the documented behavior of LOGO!'s VM (Variable Memory) area. Understanding the distinction between VM-mapped references and direct block parameters is the key to a robust retention strategy that survives indefinite power cycles without a battery option.

Root Cause: Why VM Memory Does Not Retain NAI Values

The LOGO! 8 base module divides its working memory into two functionally separate regions:

  1. Block parameters – the V1, V2, V3, V4 inputs of function blocks, the PV of counters, the ON/OFF thresholds of timers, the threshold (On/Off) of comparators, etc.
  2. Variable Memory (VM) – a shared scratchpad of 16-bit words accessible as VW0 through VW850 (the exact upper limit depends on the LOGO! 8 firmware variant; LOGO! 8.3 with order suffix 0BA2 exposes the full 851-word range).

When an NAI tag such as VW20 is referenced via Parameter VM Mapping in LOGO! Soft Comfort, the value placed at that VM address is the current HMI value. VM memory is implemented as RAM only; it is backed neither by the on-board supercapacitor nor by the optional LOGO! Battery Card (6ED1971-0BA00). On every cold or warm restart, the VM area is zeroed before the user program runs its first scan.

Critical distinction: A value written directly into a block parameter (for example, the setpoint input of an arithmetic block) is committed to the LOGO!'s internal flash when the circuit program is downloaded or when the operator panel confirms a parameter change at runtime. That flash copy survives power-down. A value referenced via Parameter VM Mapping is not stored to flash — only its runtime source value is, and on every power-up that source is empty until the HMI writes again.

This is why counters (which use the on-block PV parameter) can be flagged as retentive in the program editor, but VM words cannot: the flash-retentive storage is anchored to the block parameter, not to the VM address space.

LOGO! 8 Memory Architecture: VM, Flash, and Retentive Tags

Per the LOGO! 8 System Manual (Siemens ID 109741041) and the LOGO! 8.3 System Manual (Siemens ID 109766461), the following memory rules apply:

Memory Region Address Range Backing Store Retentive Across Power-Off?
Block parameters (V1–V4, PV, On/Off, …) Per-block, symbolically addressed Internal flash (mirrored at program download) Yes
VM byte area (VB0–VB1023) VW0–VW850 (word-aligned) RAM only No
Digital flag bits (M0–M127) Bit-level RAM; optional retention via editor Optional per bit
Analog flag words (AM0–AM63) 16-bit each RAM; optional retention via editor Optional per word
Retentive relay / counter PV Block parameter Flash Yes
Network Analog Input tags VW0–VW850 region RAM, refreshed by S7 communication No (refreshed by HMI each cycle)

The LOGO! 8.3 base module supports 32 NAI / 16 NAQ over Ethernet S7 connections. Earlier 8.0/8.1 modules support 8 NAI / 4 NAQ, and 8.2 supports 16 NAI / 8 NAQ. These tags are populated through the S7-compatible protocol used by TIA Portal, WinCC, the LOGO! Web Server, and the KTP700 Basic HMI. The values arrive in VM after the LOGO! has finished its initialization phase and the S7 connection is established — typically within 1 to 3 seconds of power-up, depending on the HMI's startup delay.

Solution: Direct Parameter Writing to a Math Instruction

The accepted pattern for a flash-retentive analog setpoint on LOGO! is to:

  1. Add an Arithmetic instruction (math block, library icon Σ) to the circuit program.
  2. Connect the NAI tag directly to the math block's first operand (V1) using Parameter VM Mapping — but only as the source of an additional upstream scaling step, not as the retained parameter.
  3. Instead, route the HMI setpoint through a second arithmetic block whose V1 operand is bound to the desired runtime value, and use the operator-panel writeback path so the value is committed to flash.

In practice the cleanest implementation uses an analog flag word (AM0–AM63) as the HMI-to-block conduit, with the AM word marked retentive in the program editor. This gives you both a writable target from the HMI and flash-backed retention, while still letting you perform math on the value with a downstream arithmetic block.

Workaround summary: An HMI setpoint should never be the sole carrier of a retained value in LOGO!. Write the HMI to a retentive block parameter or to a retentive analog flag (AM word); reference that retentive element inside the arithmetic block; perform the scaling math downstream. The math block's V1 parameter can then be flagged retentive, and the result computed from it is stable across power cycles.

Step-by-Step Implementation in LOGO! Soft Comfort V8.4

The procedure below uses LOGO! Soft Comfort V8.4 (Siemens order 6ED1058-0BA08-0YA1) against a LOGO! 8.3 base module. The same steps apply to LOGO! Web Editor and to TIA Portal V17+ when LOGO! is configured as a "LOGO! 8" device.

Prerequisites

  • LOGO! Soft Comfort V8.4 (or later) installed and licensed for the target module.
  • Ethernet connection between the PC and the LOGO! base module (192.168.0.1 default IP, /24 mask).
  • KTP700 Basic PN configured in WinCC Comfort V17 or later with a S7 connection to the LOGO!.
  • Knowledge of the VM address the HMI writes to (commonly VW20 for the speed setpoint and VW22 for the cycle count, but this depends on the project tag table).

Procedure

  1. Open the project in LOGO! Soft Comfort and navigate to the circuit diagram.
  2. Insert an Arithmetic block (toolbox → Special Functions → Analog → Arithmetic). Place it in the right-hand column of the FBD page.
  3. Wire the NAI source (typically VW20 from the HMI) to the first free operand. Right-click the operand field and select Parameter VM Mapping; choose the address you intend the HMI to write to (for example, VW100). Confirm with OK.
  4. Insert a second Arithmetic block downstream. Right-click its V1 input and choose Parameter VM Mapping; this time point it at VW102. This second block is the one whose V1 will be marked retentive.
  5. Mark the analog flag word as retentive. In the Project Tree, expand Parameters → Memory → Analog Flags. Locate AM0 (which is the symbolic representation of VW102 when you enable "Use analog flag memory"), right-click and select Retentive. Repeat for any other AM words that need to survive a power cycle.
  6. Update the HMI tag table. In TIA Portal, change the HMI tag originally pointing at VW20 to point at the retentive AM word (VW102 / AM0). Re-compile and download to the KTP700.
  7. Add the scaling math. In the second arithmetic block, configure the equation so that the output produces the desired 0–10 V range. The classic LOGO! scaling formula is:
    AQ = (V1 - V2) / (V3 - V2) × 1000
    where V1 is the scaled input (0–100 % from the HMI), V2 is the lower bound (0), V3 is the upper bound (100), and the result is in millivolts (0–10000). The block's Gain and Offset operands can substitute for V2/V3 if those constants are not variable.
  8. Wire the math output to the AQ1 (B016) or AQ2 (B018) analog output of the base module.
  9. Compile and download the circuit program to the LOGO! base module. Watch for the message "Transfer successful" and verify that the LOGO! switches from STOP to RUN without errors.
  10. Save a backup of the LOGO!Soft Comfort project (.lsc) and the TIA Portal project (.ap17) to a versioned source-control repository.

Verification Procedure

  1. Power up the LOGO!. Verify that AM0 retains the last operator value. If the value reads 0 after a power cycle, the AM word is not marked retentive — return to step 5 of the procedure.
  2. From the KTP700, write a known test setpoint (e.g., 50 %) to the tag bound to AM0. Confirm the LOGO! Soft Comfort online monitor shows the value landing at VW102.
  3. Measure the voltage at the LOGO! AQ1 terminal with a multimeter; it should read 5.00 V ± 50 mV.
  4. Cycle power to the LOGO! for at least 30 seconds. Re-apply power. Re-measure the voltage at AQ1 — it should still read 5.00 V.
  5. Confirm the value at the HMI also still reads 50 %; if it reads 0, the HMI tag is still pointing at the old (non-retentive) VM address and must be rebound to AM0.

Parameter-VM-Mapping Configuration Reference

The Parameter VM Mapping dialog in LOGO! Soft Comfort is reached by right-clicking any operand field of a special-function block and selecting Parameter VM Mapping. The dialog shows the current VM address, the data type (BOOL, INT, WORD, REAL), and the access mode (read/write). The mapping is stored in the circuit program and pushed to the LOGO! at every download.

Block Operand Typical VM Mapping Retention Strategy Notes
Arithmetic V1 (operator entry) VW102 ↔ AM0 Mark AM0 retentive in Parameters → Memory Flash-backed
Arithmetic V2 (lower bound) VW0 Static constant; non-retentive OK Often set to literal 0
Arithmetic V3 (upper bound) VW2 Static constant; non-retentive OK Often set to literal 100
Counter PV (cycle count) Block parameter (not VM) Set retentive flag on the counter block Flash-backed automatically
NAI tag from KTP700 VW20 (default HMI tag) Do not rely on this for retention RAM only — empty at power-up
NAQ tag to VFD VW200 Write from math output each scan Live value, no retention required

Scaling Analog Setpoints to 0–10 V

LOGO! base modules ship with either one or two analog outputs on the unit itself: AQ1 is B016 (on 12/24 RCE, 24 CE, 24 RCEoT, 230 RCEoT base modules); AQ2 is B018 (on 230 RCEoT and selected 24 RCEoT variants). Both produce 0–10 V at up to 10 mA. The integer value at the AQ block is interpreted as 0–1000, which corresponds to 0.000 V–10.000 V.

For a HMI setpoint given in percent (0–100), the arithmetic block equation is:

AQ_output = (V1 × 1000) / 100

with V1 = HMI percent value, V2 = 0, V3 = 100. If the HMI transmits a 16-bit integer directly (for example, 0–27648 as in the S7 "normalized" representation), use:

AQ_output = (V1 × 1000) / 27648

Be aware of integer truncation. The arithmetic block truncates after division; for smooth motor control add a low-pass filter (PT1 block in LOGO! Soft Comfort) on the AQ output, with a time constant of 100–500 ms. This both damps the HMI's value jitter and prevents audible motor whining.

Edge Cases and Common Pitfalls

The following field-tested failure modes recur on LOGO! 8 commissioning jobs that involve retention of HMI-supplied setpoints.

Symptom Likely Cause Remedy
HMI value resets to 0 at every power-up HMI tag still bound to VM (e.g., VW20) instead of AM retentive word Re-bind the HMI tag to AM0 (or other retentive AM word)
Math block output reads correct value at runtime but AQ reads 0 after restart AM word not marked retentive in Parameters → Memory Open Parameters → Memory → Analog Flags, tick Retentive on the AM word
AQ drifts after several power cycles Battery/Card option absent and operator panel not used to commit value Use AM retentive words; ensure HMI writes to AM, not VM
LOGO!Soft Comfort warns "Address already in use" when mapping two operands to same VW Two function blocks mapping to the same VM word Use two separate AM words or unique VW addresses
Counter increments but does not retain Retentivity flag not set on the counter block Click the counter block → Properties → Retentive ON
KTP700 shows "Connection lost" after LOGO! restart HMI connection timeout shorter than LOGO! initialization time Increase HMI connection timeout to 5 s; LOGO! 8.3 takes up to 3 s to come online
AQ outputs 10 V regardless of HMI setpoint V3 (upper bound) is 0, causing divide-by-zero and saturation Set V3 = 100 or 27648 (whichever matches HMI scale)
LOGO!STOP after download Old circuit had a constant at the AM retentive word; new circuit expects operator value Clear the constant and re-download

Integrating KTP700 Basic PN HMI Setpoints with LOGO!

The KTP700 Basic PN (6AV2 123-2GB03-0AX0) communicates with a LOGO! 8 base module over Ethernet using the S7-compatible protocol. The HMI's project is created in WinCC Comfort V17 or later; the LOGO! side is configured either in LOGO! Soft Comfort or in TIA Portal as a "LOGO! 8" device. The relevant tag configuration steps are:

  1. In the TIA Portal project tree, open Devices & Networks → LOGO! 8 → Properties → S7 Connection. Confirm the IP address, the rack/slot (always 0 for LOGO!), and that the connection is active.
  2. Open HMI Tags and create a new tag of type Int with the LOGO! address AM0 (or the symbolic analog flag you chose). Set the acquisition mode to "Cyclic continuous" with a 500 ms cycle.
  3. On the KTP700 screen, place an I/O Field bound to the tag, with the limits configured to 0–100 and a process value display format of "999". Add an "Enter" event script to write the value back to the LOGO!.
  4. Compile and download the HMI project. Test by writing 25 from the HMI and verifying the LOGO! AQ ramps to 2.5 V.

For installations that use the LOGO! Web Server (no separate HMI), the same retention pattern applies: have the Web Server write to a retentive AM word instead of writing to VM. The Web Server URL is http://192.168.0.1 by default, and the variable write is performed via the JSON endpoint at /set with a payload such as {"AM0":50} (Siemens-specific syntax; consult the LOGO! Web Server API in the LOGO! 8 System Manual for current endpoints).

Troubleshooting Matrix

The matrix below summarizes the most common retention-related failure modes observed in LOGO! 8 + KTP700 systems and the corresponding resolution steps.

# Symptom Root Cause Resolution Verify By
1 Speed = 0 after power-up NAI tag mapped directly to math input Bind HMI to retentive AM word; bind AM word to math V1 Cycle power, check HMI value persists
2 Speed = correct at first power-up, drifts over time Operator panel "writeback" not configured Use Parameter VM Mapping to AM word; enable retention Power cycle 10 times, verify retention
3 AQ saturated at 10 V Divide-by-zero in math block Set V3 to a non-zero upper bound Check V2, V3 in online monitor
4 Math output oscillates Integer truncation causes step changes Add PT1 filter downstream of math Scope AQ with DMM or oscilloscope
5 Counter resets but speed persists Counter retentivity not flagged Open counter → Properties → Retentive ON Cycle power, verify counter value
6 HMI shows --- instead of value S7 connection dropped, LOGO! 8.3 still booting Increase HMI timeout to 5 s Watch for "Connection established" message
7 LOGO!Soft Comfort online monitor shows correct value; physical AQ is wrong Wrong AQ block selected (AQ1 vs AQ2) Verify B016 / B018 mapping to physical terminals Measure voltage at base module terminals
8 Retention fails only on extended power-off (weeks) Optional LOGO! Battery Card absent; AM retention is flash-backed but flash has write-cycle limits Limit runtime parameter changes; use an RTC card if extended retention is required Review flash write counter in diagnostics

Best-Practice Checklist

Before commissioning a LOGO! 8 system that retains HMI-supplied analog values, confirm each of the following:

  • The HMI tag is bound to a retentive analog flag (AM word), not directly to a VM address.
  • The AM word is marked Retentive in Parameters → Memory → Analog Flags.
  • The math block uses the AM word as its V1 input via Parameter VM Mapping.
  • The math block's V2 and V3 bounds are non-zero constants or are themselves retentive.
  • The AQ output is wired from the math block (not from a direct VM-mapped operand).
  • The HMI's S7 connection timeout is at least 5 seconds for the LOGO! 8.3 cold-start sequence.
  • A backup of the LOGO!Soft Comfort project, the TIA Portal project, and the HMI project are stored in version control.
  • Field verification: power cycle the cabinet at least three times, confirm retention each time.

Related Documentation

The following Siemens primary sources cover the topics discussed in this article:

Why do my LOGO! network analog inputs reset to 0 after power-off?

Because they are stored in VM memory, which is RAM-only and not backed by flash or battery. LOGO! only retains values that are written directly into block parameters (V1, PV, ON/OFF thresholds) or into retentive analog flags (AM words). A value referenced from VM via Parameter VM Mapping is cleared on every cold start and only repopulated when the HMI writes again.

How do I keep a HMI speed setpoint across power cycles on a LOGO! 8.3?

Bind the HMI tag to a retentive analog flag (AM0–AM63), reference that AM word in the V1 input of an arithmetic (math) block via Parameter VM Mapping, and use the math output to drive AQ1/AQ2. Mark the AM word Retentive in Parameters → Memory → Analog Flags before downloading the program.

Can the LOGO! Battery Card (6ED1971-0BA00) fix NAI retention?

No. The Battery Card extends the real-time clock retention and adds buffering for the RAM region in some firmware versions, but VM values populated by external S7 clients are still not committed to any persistent storage. The persistent fix is to use retentive analog flags (AM words) as the HMI target.

How many NAI tags does a LOGO! 8.3 support?

The 6ED1052-1xx08-0BA2 LOGO! 8.3 base module supports 32 Network Analog Inputs and 16 Network Analog Outputs over Ethernet S7 connections. Earlier 8.0/8.1 modules support 8 NAI / 4 NAQ, and 8.2 modules support 16 NAI / 8 NAQ. Verify the exact limit on the module label and in the LOGO! System Manual before scaling the HMI tag count.

What scaling formula converts an HMI percent (0–100) to a LOGO! 0–10 V output?

Use AQ = (V1 × 1000) / 100 in the arithmetic block, where V1 is the HMI percent value (0–100), V2 = 0 (lower bound), V3 = 100 (upper bound). The block output is in millivolts (0–10000) which maps directly to 0.000–10.000 V at AQ1/AQ2.

Back to blog