1. Problem Statement
A field installation uses one or more LOVATO DMK22 modular energy analyzers that expose measurement data over Modbus RTU on RS-485. The operator wants to display voltage, current, power, power factor, frequency, and active/reactive energy on a Siemens HMI running WinCC flexible 2008 (Compact / Comfort / Multi Panel or PC-based Runtime) without inserting a PLC between the analyzer and the HMI.
The challenge: WinCC flexible 2008 is a pure HMI/SCADA runtime. Its internal driver set was designed to talk to specific PLC families — not to arbitrary third-party Modbus slaves. A direct "LOVATO → HMI" link is therefore not a drop-down selection in the connection editor. You must bridge the protocol gap with one of three proven paths:
- A Siemens PLC acting as Modbus RTU master and forwarding values to WinCC flexible via MPI / PROFIBUS / Ethernet.
- An OPC DA server (KEPServerEX, MatrikonOPC, Siemens OPC, or a custom Matrikon-style server) that polls the DMK22 and exposes tags that WinCC flexible reads through its OPC channel.
- A standalone Modbus-RTU-to-Modbus-TCP / PROFINET protocol converter (Anybus, Moxa MGate, Helmholz, Phoenix Contact) that emulates the I/O signature of a Siemens PLC.
Path 2 is the only one that genuinely removes the PLC from the architecture. Path 1 keeps a small PLC (often a LOGO! or S7-200) as a "thin" protocol converter. Path 3 replaces the PLC with a headless gateway but presents a Siemens-compatible interface to WinCC flexible.
2. LOVATO DMK22 Technical Profile
The LOVATO DMK series are expansion modules that bolt onto the DME family of multifunction energy meters. The DMK22 specifically adds a serial communication interface. Key characteristics relevant to WinCC flexible integration:
| Parameter | Value | Notes |
|---|---|---|
| Physical layer | RS-485, 2-wire half-duplex | Twisted pair, shielded cable recommended |
| Protocol | Modbus RTU (slave) | Modbus TCP is not natively supported by DMK22 |
| Default baud rate | 9600 bps (configurable 1200–19200) | Set via DMK front DIP or DME menu |
| Default parity / data bits | 8E1 (8 data, even parity, 1 stop) | Verify against DME setup menu before commissioning |
| Default Modbus address | 1 (range 1–247) | Must be unique on the bus |
| Function codes supported | 03 (Read Holding), 06 (Write Single), 16 (Write Multiple) | Check firmware variant for 04/22 |
| Termination | 120 Ω between A and B, last device only | Often built into DMK22 |
| Bus length | ≤ 1200 m at 9600 bps | Derate with higher baud |
| Max devices per segment | 32 (without repeater) | Use repeater for more |
3. WinCC flexible 2008 Communication Architecture
WinCC flexible 2008 supports two distinct runtime targets:
- WinCC flexible Runtime (PC-based) — installed on a Windows PC; widest protocol support including OPC DA client.
- WinCC flexible Compact / Comfort / Multi Panels — firmware-embedded runtime; protocol support is a subset of the PC runtime.
The complete driver matrix is documented in the WinCC flexible 2008 Communication Part 1 manual (entry ID 18797552) and the follow-up WinCC flexible 2008 Communication Part 2 manual (entry ID 18796876). Drivers are grouped by PLC family:
| PLC Family | Typical Protocol | HMI Connection |
|---|---|---|
| SIMATIC S7-200 | PPI / MPI / PROFIBUS / Ethernet (CP 243-1) | Native driver |
| SIMATIC S7-300/400 | MPI / PROFIBUS / Ethernet (ISO-on-TCP) | Native driver |
| SIMATIC S7-1200/1500 | Ethernet (S7Comm) | Native driver |
| LOGO! | Ethernet | Native driver |
| Allen-Bradley DF1 / EtherNet/IP | Serial / Ethernet | Native driver |
| Modicon Modbus / Unity | Modbus RTU/TCP | Native driver — Modicon addressing only |
| Mitsubishi MC | Serial / Ethernet | Native driver |
| OPC DA client | OPC Data Access 2.0 / 3.0 | Available on PC Runtime only |
| Generic Modbus RTU master | Modbus RTU | Not available |
4. Why a Direct DMK22 → HMI Link Fails
The DMK22 speaks Modbus RTU on a 2-wire RS-485 bus. WinCC flexible 2008 HMI panels expose one of these physical ports:
- RS-232 (PPI/MPI on S7-200 panels)
- RS-422 / RS-485 (PROFIBUS-DP slave interface on some panels)
- Ethernet (RJ45)
Even when a panel provides an RS-485 port, WinCC flexible binds that port to the MPI/PROFIBUS DP-slave protocol stack, not a free Modbus master stack. There is no user-configurable "talk Modbus RTU" mode. This is the technical reason every "direct DMK22 to WinCC flexible" question ends with the recommendation of a PLC intermediary or an OPC bridge.
5. Integration Path A — PLC as Modbus Master
This is the most common field solution. A small Siemens PLC sits on the RS-485 bus, polls the LOVATO register map, and exposes the values to the HMI through its native driver.
5.1 Hardware options
| PLC | Modbus Master Library | HMI Interface | Notes |
|---|---|---|---|
| LOGO! 8 (6ED1052) | Modbus master FB in LOGO! Soft Comfort ≥ V8.2 | Ethernet | Cheapest, limited to ~16 mapped values |
| S7-200 CPU 224 XP / 226 | Modbus Master library (USS protocol port, port 0) | PPI/MPI or Ethernet via CP 243-1 | Legacy but widely deployed |
| S7-1200 CPU 1214/1215 | MB_CLIENT / MB_MASTER instructions | PROFINET | Modern choice, TIA Portal programming |
| S7-300 with CP 341 | Modbus Master FB (loadable driver) | MPI / PROFIBUS / Ethernet | Industrial sites with existing S7-300 |
5.2 S7-1200 MB_MASTER configuration sketch
This pattern polls Holding Register 0x0000 (Voltage L-N) from DMK22 slave address 1 every 500 ms:
// Data block "ModbusMasterDB"
// MB_MASTER instance DB
"ModbusMaster".REQ := TRUE; // Trigger on scan
"ModbusMaster".MB_MODE := 1; // 1 = Read holding registers
"ModbusMaster".SLAVE := 1; // DMK22 Modbus address
"ModbusMaster".DATA_ADDR := 0; // LOVATO register 0x0000
"ModbusMaster".DATA_LEN := 1; // 1 register
"ModbusMaster".DATA_PTR := P#DB20.DBX0.0 BYTE 2;// Target in DB20
"ModbusMaster".DONE => #PollDone;
"ModbusMaster".ERROR => #PollError;
"ModbusMaster".STATUS => #PollStatus;
On TIA Portal V15+, the MB_MASTER / MB_CLIENT blocks ship in the "MODBUS" instruction palette. Connect the RS-485 adapter CM 1241 (6ES7241-1CH30-1XB0) or CB 1241 (6ES7241-1CH32-0XB0) to the PLC and configure port parameters to match the DMK22 (default 9600 / 8E1).
5.3 Tag mapping in WinCC flexible
- Open the WinCC flexible project, choose Connections → SIMATIC S7-1200/1500.
- Enter the PLC IP and rack/slot.
- Create an HMI tag of type Word or Int and address the matching DB20.DBW0 area.
- Repeat for current (register 0x0002), active power (0x0004), reactive power (0x0006), energy (0x0040), etc.
- Bind tags to IO fields or trend views.
6. Integration Path B — OPC DA Bridge (No PLC)
This is the correct path if you specifically want to remove the PLC. It requires a Windows PC running both the OPC server and the WinCC flexible Runtime.
6.1 Architecture
[DMK22] --RS-485--> [USB/RS-485 converter or COM port] --USB--> [Windows PC]
|
v
[OPC DA Server]
(KEPServerEX / MatrikonOPC)
|
OPC DA 2.0/3.0
|
v
[WinCC flexible Runtime]
OPC channel → HMI tags
6.2 OPC channel configuration in WinCC flexible
- In the WinCC flexible project tree, right-click Connections → Add Connection.
- Select driver OPC from the list.
- On the OPC tab enter the OPC Server ProgID, e.g.
Kepware.KEPServerEX.V6. - Click Browse Server → Browse Items to import the LOVATO tag list.
- Create HMI tags with OPC item paths like
Channel1.LOVATO_DMK22.Voltage_L1N. - Configure acquisition cycle (recommend 500 ms–1 s for power values, 5 s for energy totals).
6.3 KEPServerEX Modbus driver setup (example)
- Install KEPServerEX V6.x or later.
- Add a new channel of type Modbus RTU Serial.
- Set COM port, baud 9600, parity Even, data bits 8, stop bits 1.
- Add a device with Modbus address 1 (DMK22 slave).
- Add tags mapped to the LOVATO holding registers:
V_L1N → 400001 (function 03, 1 register, float, byte swap)
I_TOT → 400003
P_ACT → 400005
E_KWH → 400065 (4-register float) - Save and click Quick Client to verify polling before launching WinCC flexible.
7. Integration Path C — Protocol Gateway
If you want a headless box on the shop floor that pretends to be a Siemens PLC, install a Modbus-to-S7 / Modbus-to-PROFINET gateway. Common choices:
- Anybus X-gateway Modbus-RTU → PROFINET (HMS Industrial Networks)
- Moxa MGate MB3170 / MB3270 (Modbus RTU ↔ Modbus TCP, used as PROFINET converter with an additional head)
- Helmholz NET-Link PRO or Phoenix Contact GW PN/MODBUS
Configure the gateway to read the LOVATO registers and expose them in a memory area that the gateway's PROFINET side presents to WinCC flexible as if it were a SIMATIC S7 input area. The HMI then uses its native S7-300/400 or S7-1200 driver.
8. Step-by-Step: OPC DA Bridge (Full Procedure)
Because Path B is the closest match to the user's original "no PLC" request, here is the complete commissioning sequence.
8.1 Prerequisites
- Windows 10/11 PC with at least one free USB or COM port.
- RS-485 ↔ USB converter (FTDI FT4232H-based recommended, e.g. USR-TCP232-410s or Advantech ADAM-4561).
- 120 Ω termination resistor at the far end of the RS-485 bus.
- KEPServerEX V6.x or MatrikonOPC Modbus Suite.
- WinCC flexible 2008 SP5 with WinCC flexible Runtime license.
- Latest LOVATO DMK22 register map (download from lovatoelectric.com under the DME/DMK product page).
8.2 RS-485 wiring
DMK22 terminal A (D+) ------ twisted pair A ----- USB-485 A
DMK22 terminal B (D-) ------ twisted pair B ----- USB-485 B
DMK22 GND ----- shield drain ----- USB-485 GND
[120R across A-B at this end]
8.3 DMK22 setup
- Power up the DME base unit, navigate to SETUP → COM → RS485.
- Set address to a unique value (default 1).
- Set baud = 9600, parity = Even.
- Set protocol = Modbus RTU.
- Confirm and exit.
8.4 KEPServerEX configuration
- Start KEPServerEX Configuration.
- Right-click Channels → New Channel → Modbus RTU Serial.
- COM port = the COM number reported by the USB-485 driver. Baud = 9600. Parity = Even. Data = 8. Stop = 1.
- Click Test Communications. You should see Modbus device 1 acknowledged.
- Right-click Devices → New Device → Modbus. ID = 1.
- Add tags from the LOVATO register map. For 32-bit floats, set datatype Float, address format 4xxxx starting at the holding-register base +1, swap mode Byte Swap on Little-Endian hosts.
- Use Quick Client to confirm values update at the configured poll rate.
8.5 WinCC flexible project
- Start WinCC flexible 2008.
- Open the project → Project → Transfer → Transfer Settings → set Runtime to start as service.
- In the project tree, Connections → Add Connection → driver OPC.
- OPC Server Name = the KEPServerEX ProgID (e.g.
Kepware.KEPServerEX.V6). - Click Tags and then Browse OPC Items. Import each DMK22 tag, e.g.
Channel1.Device1.V_L1N. - Place IO fields, bar graphs, and trend views on a screen. Bind acquisition cycle = 1000 ms.
- Compile → Start Runtime.
8.6 Verification
- On the KEPServerEX Quick Client, force a known value (e.g. write a calibration voltage) into the DMK22 side and confirm the HMI screen updates within one acquisition cycle.
- In the WinCC flexible diagnostic view (Tools → Diagnostics → OPC Diagnostics), confirm OPC quality = Good for every imported tag.
- Power-cycle the DMK22. OPC quality must degrade to Bad within the configured timeout (default 5 s) and recover to Good when communication returns.
- Trigger a bus fault (disconnect A/B) and confirm the OPC server logs a "device not responding" entry and the HMI shows the configured fault indicator.
9. Verification Checklist
| Step | Expected Result | If Failed |
|---|---|---|
| RS-485 wiring continuity | < 5 Ω between A and bus-end A; shield grounded at one point only | Check terminator placement; remove ground loops |
| DMK22 address & parity match OPC/PLC | Address 1, 9600 8E1 on both sides | Re-enter via DME front panel |
| Quick Client test | Value updates at poll rate | Check USB-485 driver, COM port, line polarity |
| OPC item browse | Tag list populated | Verify ProgID string and DCOM permissions |
| WinCC flexible Runtime startup | OPC channel green, all tags Good | Confirm OPC server service running before Runtime |
| Live value display | Voltage matches DMM reading ± 1% | Check float swap mode and register offset |
| Energy total accumulates | Monotonic increase over 60 s | Verify you are reading an energy register, not an instantaneous register |
10. Troubleshooting Matrix
| Symptom | Likely Cause | Remedy |
|---|---|---|
| OPC quality = Bad for all tags | OPC server not started, or DCOM blocked | Start KEPServerEX service; allow DCOM through Windows Firewall for WinCC flexible |
| OPC quality = Good but values = 0 | Wrong register offset or float swap mode | Cross-check against LOVATO register map; test with a single known parameter |
| Values flicker / NaN | Bus contention or termination missing | Add 120 Ω terminator at the bus end; verify single ground reference |
| Tags show "Device not responding" | Address collision or parity mismatch | Use Modbus scanner tool (e.g. CAS Modbus Scanner) to enumerate slaves |
| Runtime starts but no data updates | OPC server on a different Windows user / session | Run OPC server and Runtime under the same user account; enable Run as Service on KEPServerEX |
| HMI panel connection fails (Path A) | Wrong MPI/PROFIBUS address or PG/OP cable | Verify HMI address ≠ PLC address; use Siemens PC Adapter USB or native Ethernet |
| S7-200 MB_MASTER returns status 0x80C8 | Modbus slave did not respond in timeout | Increase MB_MASTER timeout to 2000 ms; check baud rate |
| S7-1200 MB_MASTER returns 0x80C8 | Same as above for TIA Portal | Reduce poll frequency; verify CM 1241 port configuration |
11. Field-Proven Tips
- Always document the LOVATO firmware version printed on the DME label. Register maps shift between firmware variants and the OPC/PLC tag list will silently break after a meter swap.
- Use a Modbus scanner (CAS Modbus Scanner, Modbus Poll) during commissioning to verify the bus before opening WinCC flexible. This isolates wiring problems from HMI configuration problems.
- If the RS-485 cable runs near VFD power cables, use double-shielded cable and ground the shield at the cabinet end only.
- Schedule the energy register poll at 5 s, not 1 s. Energy values change slowly and you save RS-485 bandwidth for instantaneous readings.
- For multi-meter installations, give every DMK22 a unique Modbus address and use the OPC server's "demultiplex" feature to keep the HMI tag names readable (e.g.
DMK22_LineA.Voltage,DMK22_LineB.Voltage). - Configure the OPC server's Reconnect Interval to 2 s and the Timeout to 1 s so the HMI recovers quickly from a temporary RS-485 disturbance.
12. When to Choose Which Path
| Scenario | Recommended Path | Rationale |
|---|---|---|
| Existing Siemens PLC on site | A (PLC intermediary) | Reuses installed hardware and engineering |
| HMI-only project, no PLC planned | B (OPC DA bridge) | True no-PLC architecture; PC Runtime required |
| Harsh environment, no PC on shop floor | C (gateway + native S7 driver) | Headless, industrial-rated; works with panel HMI |
| Retrofit of legacy panel HMI without OPC | A or C | OPC channel requires PC Runtime or a panel firmware variant with OPC support |
| Multiple DMK22 meters on one bus | A or B with demultiplexing | OPC server handles multidrop cleanly; PLC program needs multiple MB_MASTER instances |
Can WinCC flexible 2008 talk directly to a Modbus RTU slave like the LOVATO DMK22?
No. WinCC flexible 2008 ships drivers for specific PLC families (SIMATIC S7, Allen-Bradley, Modicon, Mitsubishi, LOGO!, OPC). There is no generic Modbus RTU master channel. You need a PLC intermediary, an OPC DA server, or a Modbus-to-PROFINET gateway.
Which path lets me connect a LOVATO DMK22 to WinCC flexible without any PLC at all?
Use Path B: a Modbus RTU OPC DA server such as KEPServerEX polls the DMK22 over RS-485, and the PC-based WinCC flexible Runtime reads the OPC tags through its OPC channel. No PLC is required, but a Windows PC is needed for both the OPC server and the Runtime.
What are the default serial parameters for the LOVATO DMK22?
Default is 9600 bps, 8 data bits, Even parity, 1 stop bit (8E1), Modbus address 1. Confirm these on the DME front panel under SETUP → COM → RS485 before commissioning; mismatched parity is the most common reason for a silent bus failure.
Does WinCC flexible 2008 support OPC DA on a Comfort/Multi Panel or only on the PC Runtime?
The OPC DA client channel is available on the PC-based WinCC flexible Runtime. Comfort, Multi, and Mobile Panels act as OPC DA servers (since firmware versions that introduced this feature), not as OPC clients — so they cannot poll an external OPC server for the DMK22 data. Use a PC Runtime if you need OPC DA client connectivity.
Which Siemens PLC is the cheapest for the Modbus intermediary path?
The LOGO! 8 (6ED1052-xxx08-0BA1) with LOGO! Soft Comfort V8.2 or later supports Modbus master on its Ethernet side via the integrated Modbus library and is the lowest-cost option. The S7-1200 with a CM 1241 RS-485 module is the next step up and offers a richer instruction set (MB_CLIENT / MB_MASTER) plus easier integration with TIA Portal projects.
Where can I download the official LOVATO DMK22 register map?
Get it from the LOVATO Electric product page for the DME/DMK series. Always cross-check the firmware version printed on the DME label against the map revision date, because register offsets change between firmware revisions.
Where is the official WinCC flexible 2008 communication matrix documented?
Siemens publishes two PDF manuals: WinCC flexible 2008 Communication Part 1 (entry ID 18797552) and the follow-up Part 2 (entry ID 18796876). They list every supported PLC family, baud rate, and port assignment.