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
SPinput 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:
- Siemens LOGO! 8 System Manual (109741041)
- LOGO! Soft Comfort V8.4 Online Help (109741040)
- Siemens LOGO! product page
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.
- Open the LOGO! program in LOGO! Soft Comfort.
- Select Tools > Parameter-VM-Mapping from the menu bar.
- The editor lists every parameter of every function block in the program. Locate the
SProw(s) of your PI controller block(s). The block is shown by its name in the FBD (default B001, B002, …). - Tick the VM checkbox on the
SProw, then set the Start Address (e.g.VW0) and Length = 1 word. Click Apply. - Recompile and download the program to the LOGO! base unit.
- 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.
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:
- 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 |
- Wire the
Axinput 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. - Wire the Math block's output to the
SPpin 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.
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:
- Add the LOGO! as a Modbus TCP Server / Modbus TCP Master device in the HMI project. Set IP = LOGO! IP, port = 502, station = 1.
- Create a Numeric Input or Numeric Value Entry element on the screen.
- 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 |
- 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.
- 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:
- Map the
SPof each PI block to the same VM address in the Parameter-VM-Mapping table (e.g.VW0for controllers B001, B002, B003). - 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.
9. Verification and Diagnostics
After download, perform the following checks in order:
-
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
1500from the HMI and verify it appears within one scan (~50 ms typical for LOGO! 8). - 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.
-
Block-status check: On the LOGO! display, open the PI controller's block status page. The
SPline should update within 1 scan after the HMI write. -
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 |
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.