Configuring LOGO! PI Controller Setpoint from HMI via VM Mapping

David Krause12 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

Configuring LOGO! PI Controller Setpoint from an HMI via VM Mapping

Siemens LOGO! 8 series logic modules include a built-in PI controller instruction block (commonly referenced as PI-Regler in the German toolchain and PI Controller in English toolchains). A frequent integration task is allowing an HMI to write the controller setpoint (parameter SP) in real time while the FBD program is running. The naïve approach — wiring an analogue flag/amplifier into SP — corrupts the value because the analogue amplifier stage rescales and offsets the raw integer. This article documents the two field-proven methods for binding an HMI-supplied value to SP on a LOGO! 8 (8.1, 8.2, 8.3, 8.4):

  • Method A: Native Parameter-VM-Mapping table inside LOGO! Soft Comfort.
  • Method B: A mathematical instruction that copies a VM (Variable Memory) word directly into the SP input of one or more PI controller blocks.

Both methods preserve the integer -500 … +2500 range (i.e. -50.0 °C to +250.0 °C at 0.1 °C resolution) without scaling drift.

1. System Architecture and Prerequisites

Component Requirement Notes
LOGO! hardware 6ED1052-xxx08-0 (LOGO! 8) or later BM/SLM/AM2 VM area is only fully available from 8.0 firmware onward
Firmware FS:04 / FS:05 / FS:06 / FS:07 Parameter-VM-Mapping is supported on all 8.x firmware streams
LOGO! Soft Comfort V8.0 or later Required for the Tools > Parameter-VM-Mapping menu entry
HMI Any Modbus TCP master (e.g. Kinco, Weintek, Siemens KTP) LOGO! 8 exposes VM as Modbus holding registers 0…1023
Ethernet LOGO! 8 base unit with onboard Ethernet or LOGO! CSM module Modbus TCP port 502 default

Reference documents:

Important: LOGO! 8 stores the parameter SP as a signed 16-bit integer in the internal variable memory (VM). The HMI must therefore write a signed value, never an unsigned 16-bit register. Confirm this in the HMI tag database before commissioning.

2. LOGO! PI Controller Block: Parameter Model

The PI controller block exposes the following parameters on its block dialog in LOGO! Soft Comfort:

Parameter Direction Range Purpose
SP Input / retained -10000 … +20000 (display units) Setpoint
PV Input Per configured analogue input Process variable (feedback)
KC Parameter 0.00 … 99.99 Proportional gain
TI Parameter 00:00 m:s … 99:59 m:s Integral action time
Dir Parameter + / - Action direction
MQ Output 0 … 1000 Manipulated variable (0.0 % to 100.0 %)
AQ Output 0 … 1000 Alternate output / auxiliary

The SP value is internally a 16-bit signed word. When you bind SP to a LOGO! analogue flag (the small flag list on the left rail of the FBD editor) the platform wraps the binding in an analogue amplifier so that the flag can be scaled — but that amplifier's gain/offset are fixed at design time and will mutilate any pre-scaled integer the HMI is sending. This is the trap that consumes hours on first contact with the platform.

3. Why Analogue-Flag Wiring Fails

An analogue flag in LOGO! Soft Comfort (for example AM1, AM2, …) is the result of a previous computation and is exposed only after an Analogue Amplifier block has been inserted. When you drag a connection from such a flag onto the SP pin of a PI controller, the toolchain generates an internal Analogue Amplifier stage with default gain = 1.0 and offset = 0.0, but the value is then re-mapped into the display range. The result: an HMI value of 1250 (intended to mean 125.0 °C) can re-emerge as 12500 (1250.0 °C) depending on the display-mode toggle of the controller block.

To avoid this you must keep the HMI value in the raw VM word that the controller block reads directly — never let it pass through an amplifier. That is exactly what the two methods below do.

4. Method A — Parameter-VM-Mapping (Recommended)

The Parameter-VM-Mapping table is the cleanest way to expose SP as a writable Modbus register.

  1. Open the LOGO! program in LOGO! Soft Comfort.
  2. Select Tools > Parameter-VM-Mapping from the menu bar.
  3. The editor lists every parameter of every function block in the program. Locate the SP row(s) of your PI controller block(s). The block is shown by its name in the FBD (default B001, B002, …).
  4. Tick the VM checkbox on the SP row, then set the Start Address (e.g. VW0) and Length = 1 word. Click Apply.
  5. Recompile and download the program to the LOGO! base unit.
  6. From the HMI, write the setpoint to Modbus holding register 0000 (function code 0x06, single-write, or 0x10 multi-write) at the LOGO! IP address, port 502.

After download, the LOGO! internal diagnostic page (LOGO! Display / LOGO! TDE > VM Mapping) will show the live value. The Modbus register map is automatically extended; no LSC code change is required for additional controllers — simply assign a new VM address to the next controller's SP.

Range mapping: The default VM word is signed 16-bit (-32768 … +32767). For a process value of -50.0 … +250.0 °C transmitted as -500 … +2500 (i.e. scaled by 10), the register value range -500 … +2500 is well within the wire format. No endian swap is required; LOGO! Modbus is big-endian per the Siemens implementation.

5. Method B — Mathematical Instruction Reference

If you cannot or prefer not to use the Parameter-VM-Mapping tool (for example, when the value must be filtered, clamped, or computed at runtime), use an Analogue Math or Math block to copy a VM word into the PI controller's SP pin directly.

5.1 Diagram example (FBD)

  +-------------------+      +-------------------+      +-------------------+
  |   VM address VW0  |      |  Math (or Analogue|      |  PI Controller    |
  |   (HMI-written)   +----->|  Math) block      +----->|  block (B001)     |
  |   int  -500..2500 |      |  Gain = 1         |      |  SP = computed    |
  +-------------------+      |  Offset = 0       |      |  PV = AI1         |
                             +-------------------+      +-------------------+

With LOGO! Soft Comfort:

  1. Insert a Math block (or Analogue Math if you need floating-point interpolation). Set:
Math field Value
Operator Identity (A) or A + 0
Gain 1.00
Offset 0
Output range -32768 … +32767
  1. Wire the Ax input of the Math block to the VM address that the HMI writes to (this is the same address you would have used in Method A). On the Math block's connection dialog, type the VM name (e.g. VW0) directly — do not use an analogue flag here.
  2. Wire the Math block's output to the SP pin of the PI controller.

5.2 Why a Math block is acceptable but not ideal

The Math block with gain = 1.0, offset = 0.0 is a pass-through. It does not corrupt the value because the integer-to-integer path is preserved when both gain and offset are within the integer range. However, the block consumes program memory and one execution tick, so for setpoint-only writes prefer Method A. Use Method B only when you need run-time signal conditioning (e.g. SP = clamp(VW0, 0, 2500) to prevent the operator from commanding a temperature below ambient).

6. Scaling the Setpoint for Engineering Units

LOGO! 8 has no native floating-point display for VM values. Two common scaling strategies are used in the field:

Strategy HMI value LOGO! value Display text
Integer × 10 (recommended) 125.0 1250 °C × 10
Direct engineering units 125 125 °C
Percent of range 50.0 500 (= 50.0 %) %

For the OP's process (-50.0 °C … +250.0 °C), the integer-×-10 convention maps cleanly to the LOGO! PI block's internal 16-bit signed representation: the integer wire value ranges from -500 to +2500, which is exactly 3000 codes across 300 °C of physical span (0.1 °C per LSB). The PI controller will treat this as a dimensionless value but the closed-loop behaviour is preserved because both SP and PV are passed through the same scaling chain on the analogue input side.

PV scaling must match SP scaling. If your HMI writes SP in °C × 10, the analogue input that drives PV must be conditioned with the same factor (use an Analogue Amplifier on AI1 with gain 10.0, offset 0.0 if the transducer outputs °C × 1). Otherwise the loop will see a 10× mismatch and the controller will saturate.

7. HMI Configuration (Kinco Example)

The OP referenced a Kinco HMI. Kinco's HMIsoftware (formerly Kinco DTools) and the current KINCO HMIware configure Modbus TCP servers on the device. To bind a numeric input object to a LOGO! VM word:

  1. Add the LOGO! as a Modbus TCP Server / Modbus TCP Master device in the HMI project. Set IP = LOGO! IP, port = 502, station = 1.
  2. Create a Numeric Input or Numeric Value Entry element on the screen.
  3. In the element's address configuration:
Field Value
PLC address type 4x (holding register) or Modbus 0x
Address 1 (i.e. 4x00001 → Modbus register 0)
Data type INT16 (signed)
Word order Big-endian (B-A)
Min / Max -500 / +2500
Format Signed decimal
  1. Set the keyboard attribute to Numeric and enable the Confirm write bit. Without confirm, the HMI writes on every digit change — usually undesirable for a setpoint.
  2. Add an Enter button or use the Auto-write on Enter property of the numeric object.

Write a one-time Preset value of 200 (= 20.0 °C) so the loop starts at a sensible default after a power cycle.

8. Sharing One VM Address Across Multiple PI Controllers

It is common to cascade or parallel several PI loops to the same setpoint (e.g. multi-zone furnace trim). In LOGO! Soft Comfort:

  1. Map the SP of each PI block to the same VM address in the Parameter-VM-Mapping table (e.g. VW0 for controllers B001, B002, B003).
  2. Compile and download. LOGO! will broadcast every HMI write to all three blocks in a single scan.

Alternatively, use Method B with a single Math block whose output fans out to the SP pin of every controller — the same integer is wired multiple times in the FBD. This consumes one Math block plus a multi-pin connection. The Parameter-VM-Mapping approach is preferred because it does not consume runtime resources.

Retention behaviour: All VM-mapped parameters are retained across power cycles in the LOGO! 8 base unit only if the project's Retain switch is set in the offline program. Verify this on the LOGO! front panel: Setup > Retain > On.

9. Verification and Diagnostics

After download, perform the following checks in order:

  1. LOGO! display check: On the LOGO! base unit or TDE, navigate to Menu > Diagnostics > VM (or use the block's SP diagnostic page) and confirm the value tracks the HMI input. Force a value of 1500 from the HMI and verify it appears within one scan (~50 ms typical for LOGO! 8).
  2. Modbus poll test: From a PC running modpoll or QModMaster, read register 0 with function code 0x03 to confirm the LOGO! echoes the last-written value. If the read returns the previous value, check the IP and port in the HMI project.
  3. Block-status check: On the LOGO! display, open the PI controller's block status page. The SP line should update within 1 scan after the HMI write.
  4. Closed-loop response: Step the setpoint by 100 codes and observe the MQ (manipulated variable) response on a trend. The output should move smoothly toward the new operating point with no integral wind-up; if it pegs at 0 or 1000, the action direction (Dir) is inverted.

10. Common Pitfalls and Field Notes

Symptom Likely cause Fix
SP value is exactly 10× what was written HMI writes unsigned; LOGO! amplifies signed-to-unsigned shift Set HMI data type to INT16 signed
SP is stuck at 0 or at the upper limit Math block offset not zeroed, or VM not yet allocated Re-open Parameter-VM-Mapping, click Apply, re-download
Setpoint reverts on power cycle LOGO! Retain is OFF Set Setup > Retain > On on the LOGO! front panel
Modbus timeout on every write LOGO! 8 only allows one Modbus TCP connection at a time; the SCADA client may be holding the socket Close other master clients or upgrade to LOGO! 8.3+ which supports multiple Modbus sessions
Multiple controllers drift apart over time Each block was given its own VM address Re-map all SP rows to the same VM word in Parameter-VM-Mapping
PI output oscillates at high KC KC is in display units, not scaled to engineering units Re-tune with Ziegler–Nichols or Lambda tuning
HMI shows 0 after a write of 0 Some HMIs suppress zero-writes Force-enable Allow zero write on the Kinco tag

For deeper control theory background, refer to the Wikipedia PID controller article and National Instruments' PID Theory Explained whitepaper, which cover proportional, integral, and derivative actions in detail. Note that the LOGO! block is a PI block (no derivative term) and so derivative-related tuning rules do not apply.

11. Quick Reference — HMI Address Map for the OP Application

LOGO! VM word Modbus holding reg. HMI tag Engineering meaning Range
VW0 0000 SP_Zone1 Setpoint B001 (°C × 10) -500 … +2500
VW2 0001 SP_Zone2 Setpoint B002 (°C × 10) -500 … +2500
VW4 0002 SP_Zone3 Setpoint B003 (°C × 10) -500 … +2500
VW6 0003 PV_Zone1 Feedback B001 (read-only) -500 … +2500
VW8 0004 PV_Zone2 Feedback B002 (read-only) -500 … +2500
VW10 0005 PV_Zone3 Feedback B003 (read-only) -500 … +2500
Endianness: LOGO! 8 uses big-endian word order on Modbus TCP. If your HMI defaults to little-endian (Intel format), set the address property to Word-swap = On for each tag, otherwise the high and low bytes will be reversed and you will see nonsense values such as 0xFE0C = -500 interpreted as 3325.

12. FAQ

How do I set the LOGO! PI controller setpoint from a Kinco HMI without using an analogue amplifier?

Use Tools > Parameter-VM-Mapping in LOGO! Soft Comfort to bind the PI block's SP parameter to a VM address (e.g. VW0). The HMI then writes a signed INT16 to Modbus holding register 0 (port 502) and the value reaches SP directly with no scaling stage. See the LOGO! 8 system manual for the full VM mapping procedure.

Can a single HMI value drive multiple PI controller setpoints in the same LOGO! program?

Yes. Map every controller's SP row to the same VM word in the Parameter-VM-Mapping table. After download, every HMI write to that register is broadcast to all bound PI blocks in a single scan, with no additional FBD wiring required.

Why does my LOGO! PI setpoint read 10× higher than the HMI value?

The HMI tag is almost certainly configured as unsigned INT16 or the LOGO! is interpreting the value through a residual analogue amplifier. Set the tag data type to INT16 signed in the Kinco project, disable any Analogue Amplifier between the VM word and the SP pin, and re-check with modpoll that the raw register value matches the HMI value.

Does the LOGO! 8 PI block support derivative action?

No. The LOGO! 8 instruction set includes a PI controller only. For full PID behaviour, migrate to a SIMATIC S7-1200 with the PID_Compact block, or add the derivative term externally with an Analogue Math block before the SP pin.

How do I retain the HMI-written setpoint across a power cycle on LOGO! 8?

VM-mapped parameters are retained by default in LOGO! 8, but only if the project's Retain flag is enabled. On the LOGO! front panel navigate to Setup > Retain > On and confirm with OK. The HMI should also re-write the last setpoint on startup as a defensive measure, because not all retain memories are non-volatile on a battery-less base unit.

Back to blog