Integrating DLMS/COSEM Energy Meters into Siemens WinCC

David Krause14 min read
SCADA ConfigurationSiemensTechnical Reference
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: DLMS/COSEM Energy Meter Integration into Siemens WinCC

DLMS/COSEM (Device Language Message Specification / Companion Specification for Energy Metering) is the dominant international protocol for advanced metering infrastructure. Defined by the IEC 62056 series of standards and maintained by the DLMS User Association, the protocol is used in electricity, gas, water, and heat meters deployed by utilities, industrial facilities, and commercial buildings.

When a SCADA platform such as Siemens WinCC must consume data from DLMS/COSEM meters, engineers typically encounter a protocol gap: WinCC's native channel drivers cover S7, Modbus TCP/RTU, OPC UA, DNP3, and IEC 61850, but DLMS/COSEM is not exposed as a built-in channel. This reference documents the technical path from a DLMS meter on a serial RS-485 or TCP/IP link to a WinCC tag database, with emphasis on three architectural options: a DLMS-to-Modbus protocol gateway, an OPC UA server with a DLMS plug-in, and direct IEC 61850 station bridging. Field-proven Modbus register mapping, OBIS code translation, multi-drop RS-485 addressing, and WinCC tag configuration steps are documented in detail.

Scope note: This document focuses on IEC 62056-21 (local optical/HDLC), IEC 62056-46 (TCP/IP-based DLMS), and the COSEM object model (IEC 62056-62/63). Wireless M-Bus (IEC 13757) extensions are not covered.

IEC 62056 Architecture and Protocol Stack

The IEC 62056 suite is structured as a four-layer communication model that maps cleanly onto the OSI stack. Each layer is implemented in a distinct standard, allowing meters and head-end systems to mix-and-match transports without changing the data model.

OSI Layer IEC 62056 Standard Function
Application IEC 62056-61 / IEC 62056-62 COSEM object model, OBIS naming, logical device structure, xDLMS APDUs
Presentation / Session IEC 62056-47 Application layer services (GET, SET, ACTION, EventNotification), COSEM application layer
Data Link (HDLC) IEC 62056-46 HDLC framing for RS-485 and TCP/IP, addressing, segmentation
Physical IEC 62056-21, RS-485, TCP/IP Twisted pair (optical or wired), Ethernet 10/100 Mbit

Three reference communication profiles are commonly deployed:

  • Profile A (IEC 62056-21): Local optical port, IEC 62056-21 Mode E, ASCII or binary HDLC, 300-19 200 bit/s.
  • Profile B (IEC 62056-46 over TCP/IP): Direct Ethernet or GPRS, HDLC over TCP port 4059, multi-drop via logical client/server addressing.
  • Profile C (IEC 62056-46 over RS-485): Wired RS-485, HDLC, logical addressing 1-127.
DLMS/COSEM Protocol Stack (IEC 62056) COSEM Application Layer (GET / SET / ACTION / EventNotification) xDLMS APDUs - COSEM Objects & OBIS Codes DLMS Data Link (HDLC Framing, Segmentation, Logical Addressing 1-127) Physical: RS-485 (2-wire) Physical: TCP/IP (Port 4059)

For SCADA integration, the most common path uses Profile C (RS-485) or Profile B (TCP/IP). Both terminate at a converter that exposes the meter data to WinCC through a protocol WinCC already understands.

COSEM Object Model and OBIS Code Reference

COSEM defines a class-based object model where every measured value, parameter, or event is represented as an instance of an Interface Class (IC). Each interface class exposes standardized attributes (logical_name, value, scaler_unit, capture_time) that any DLMS client can request without prior knowledge of the meter vendor's proprietary register layout.

Objects are located using OBIS codes - six numeric value groups (A.B.C.D.E.F) that uniquely identify a measurement. The DLMS User Association maintains the OBIS master list; a subset used in 90% of utility deployments is shown below.

OBIS Code (A.B.C.D.E.F) Class / Attr Description Unit Data Type
1.0.1.8.0.255 Register (3) / attr 2 Active energy import (total, all tariffs) kWh double-long-unsigned (uint32)
1.0.2.8.0.255 Register (3) / attr 2 Active energy export (total) kWh double-long-unsigned
1.0.3.8.0.255 Register (3) / attr 2 Reactive energy import (Q1+Q4) kvarh double-long-unsigned
1.0.4.8.0.255 Register (3) / attr 2 Reactive energy export (Q2+Q3) kvarh double-long-unsigned
1.0.9.8.0.255 Register (3) / attr 2 Apparent energy import kVAh double-long-unsigned
1.0.1.7.0.255 Register (3) / attr 2 Active power import (instantaneous) kW double-long (int32)
1.0.3.7.0.255 Register (3) / attr 2 Reactive power import kvar double-long (int32)
1.0.9.7.0.255 Register (3) / attr 2 Apparent power kVA double-long (int32)
1.0.31.7.0.255 Register (3) / attr 2 Current L1, L2, L3 (instantaneous) A double-long (int32)
1.0.32.7.0.255 Register (3) / attr 2 Voltage L1, L2, L3 (line-to-neutral) V double-long (int32)
0.0.96.1.0.255 Data (1) / attr 2 Meter serial number octet-string 8 bytes
0.0.96.1.1.255 Data (1) / attr 2 Meter firmware version octet-string 4 bytes
Field caveat: D group (channel) and E group (measurement type) values vary by tariff structure and country. For multi-tariff meters, codes 1.0.1.8.1.255 through 1.0.1.8.4.255 represent T1-T4. Always verify against the meter vendor's OBIS implementation guide rather than assuming the .255 suffix.

Siemens WinCC Native DLMS Driver Status

WinCC Professional V17 through V19 and WinCC Unified V16 through V19 do not ship a native DLMS/COSEM channel. The licensed channel set covers:

  • SIMATIC S7 (RFC1006 over TCP)
  • Modbus TCP / Modbus RTU (Ethernet / serial)
  • OPC UA Client / OPC DA Client
  • DNP3 (with SIMATIC RFxxx or third-party add-on)
  • IEC 61850 Client (WinCC V17+ with Energy Suite option)
  • PROFINET, EtherNet/IP, Allen-Bradley DF1

DLMS/COSEM is absent because IEC 62056-46 is dominated by utility deployments, where utilities typically run DLMS UA-conformant head-end systems (e.g., EnergyIP, meterdata.management systems). Industrial SCADA platforms such as WinCC, FactoryTalk View, and Ignition treat DLMS as a foreign protocol and require a bridging layer.

Attempts to load a third-party DLMS driver DLL into WinCC's channel architecture are not officially supported by Siemens and create version-upgrade risk. A hardware or software gateway that translates DLMS into Modbus TCP or OPC UA is the industry-accepted integration method.

Integration Path Comparison: Gateway vs. OPC UA vs. Direct

Criterion DLMS-to-Modbus TCP Gateway OPC UA Server with DLMS Driver Direct IEC 61850 Bridging
WinCC Channel Required Modbus TCP (built-in) OPC UA Client (built-in) IEC 61850 (Energy Suite license)
Protocol Conversion Latency 100-500 ms per polled register 50-200 ms with subscription 20-80 ms (GOOSE/R-GOOSE capable)
Multi-Vendor Meter Support Excellent (most gateways ship profiles for ABB, Schneider, Elster, Iskra, L+G) Good (open-source DLMS UA servers available) Limited (meters must map COSEM to IEC 61850 logical nodes)
Authentication Support Suite 0/1/2 via gateway Suite 0/1/2 (depends on UA server) IEC 61850-7-2 ACSI security
Hardware Cost (USD, 10-meter site) $2,500-$5,000 gateway + per-meter license $0-1,500 (open-source) or $3,000-8,000 commercial $4,000-12,000 (depends on licensed bridges)
Implementation Complexity Low - configure Modbus register map Medium - address space modeling in UA High - logical node mapping + IED configuration
Recommended For Plants with 5-500 meters, mixed vendors, RS-485 legacy wiring Plants standardizing on OPC UA, brownfield + greenfield Substations, utility-grade plants with IEC 61850 architecture

For industrial customers running WinCC, the Modbus TCP gateway is the most cost-effective and lowest-risk choice. OPC UA is preferred when the wider plant already standardizes on OPC UA for data acquisition (e.g., back to a historian via UA Pub/Sub).

Protocol Gateway Architecture (DLMS-to-Modbus TCP)

A DLMS-to-Modbus gateway sits on the meter side of the network and exposes a Modbus TCP server interface to WinCC. Internally, the gateway polls the DLMS meters using a configurable schedule and caches the most recent value of each OBIS code in a holding register block. WinCC then reads these holding registers as if they were native Modbus devices.

DLMS/COSEM to WinCC Integration Architecture DLMS Meter 1RS-485 / TCP DLMS Meter 2RS-485 / TCP DLMS Meter NRS-485 / TCP DLMS-to-Modbus GatewayHolds Modbus register mapOBIS code translation WinCCModbus TCP ChannelTags & Screens

The gateway typically implements the following internal data flow:

  1. Boot: read meter profile (logical device name, supported OBIS list, security suite).
  2. Open HDLC association with each configured meter at its logical address (1-127).
  3. Negotiate authentication (Suite 0 = no auth, Suite 1 = LLS, Suite 2 = HLS with SHA-256).
  4. Periodic poll: GET.request (class 3, attr 2) for each mapped OBIS code, on a 1-15 s cycle.
  5. Decode xDLMS APDU, apply scaler_unit (e.g., value 12345, scaler -3, unit 30 = 12.345 kWh).
  6. Write scaled value to internal Modbus register at configured offset.
  7. Respond to WinCC's Modbus TCP reads from its holding register block on TCP/502.

RS-485 Multi-Drop Wiring and Logical Addressing

When meters are daisy-chained on a single RS-485 trunk, each meter must have a unique DLMS logical address and the bus must be terminated once at each end. Recommended practice for IEC 62056-46 over RS-485:

Parameter Specification
Cable Twisted pair, 120 ohm characteristic impedance, shielded (Belden 3106A or equivalent)
Max Cable Length 1 200 m at 9 600 bit/s; 250 m at 115 200 bit/s
Termination 120 ohm resistor at both physical ends only
Biasing 560 ohm pull-up to +5 V on Data+ and 560 ohm pull-down on Data- at one point only
Baud Rate 1 200 / 2 400 / 4 800 / 9 600 / 19 200 / 38 400 / 57 600 / 115 200 bit/s
Max Devices Per Bus 32 standard loads; 127 with repeater or higher-impedance transceivers
Logical Address Range 1 (client) to 127 (servers); 0 reserved for broadcast
Wiring pitfall: RS-485 ground potential differences above 7 V cause silent data corruption. For runs longer than 30 m, run a third conductor as signal ground and bond it at one point only. For runs crossing building expansion joints or panel boundaries, use an isolated RS-485 repeater.

OBIS-to-Modbus Register Mapping Strategy

The gateway holds a configuration table that maps Modbus registers to OBIS codes. A clean scheme groups registers in 100-register blocks per meter to simplify WinCC tag structure. The example below maps three-phase active and reactive energy plus instantaneous values for one meter at Modbus slave ID 1.

Modbus Register (4xxxx) OBIS Code Description Data Type Scale Factor
40001-40002 1.0.1.8.0.255 Active energy import total uint32 (big-endian) x 0.001 kWh
40003-40004 1.0.2.8.0.255 Active energy export total uint32 (big-endian) x 0.001 kWh
40005-40006 1.0.3.8.0.255 Reactive energy import uint32 (big-endian) x 0.001 kvarh
40007-40008 1.0.9.8.0.255 Apparent energy import uint32 (big-endian) x 0.001 kVAh
40009-40010 1.0.1.7.0.255 Active power (3-phase total) int32 (big-endian) x 0.001 kW
40011-40012 1.0.9.7.0.255 Apparent power total int32 (big-endian) x 0.001 kVA
40013-40014 1.0.31.7.0.255 Current L1 int32 (big-endian) x 0.001 A
40015-40016 1.0.51.7.0.255 Current L2 int32 (big-endian) x 0.001 A
40017-40018 1.0.71.7.0.255 Current L3 int32 (big-endian) x 0.001 A
40019-40020 1.0.32.7.0.255 Voltage L1-N int32 (big-endian) x 0.1 V
40021-40022 1.0.52.7.0.255 Voltage L2-N int32 (big-endian) x 0.1 V
40023-40024 1.0.72.7.0.255 Voltage L3-N int32 (big-endian) x 0.1 V
40025-40026 1.0.91.7.0.255 Frequency int32 (big-endian) x 0.01 Hz
40027 0.0.96.1.0.255 Meter serial (low word) uint16 1
40028 0.0.96.1.0.255 Meter serial (high word) uint16 1
Endianness: Modbus is big-endian on the wire. When the meter holds the value in little-endian (some ABB and Schneider meters), the gateway must byte-swap the 32-bit register pair before exposing it. Confirm with the meter's DLMS conformance test report.

WinCC Channel and Tag Configuration Procedure

The following steps configure WinCC Professional / WinCC Unified to read the gateway via Modbus TCP. The procedure assumes TIA Portal V18 or higher and a gateway IP of 192.168.10.50.

  1. Add Modbus TCP driver. In TIA Portal, open the WinCC project, navigate to Devices & Networks, add a new device, and select SIMATIC WinCC Professional > HMI > Modbus TCP.
  2. Configure connection. Open Connections, create a new Modbus TCP connection. Set Partner IP = 192.168.10.50, Port = 502, Station Address = 1 (Modbus slave ID of gateway).
  3. Add tags. In the HMI tag table, create external tags. For each OBIS code in the table above, define a tag with Connection = ModbusTCP_1, Address = 40001 + offset, Data Type = DWord (for 32-bit energy/power), Length = 2 words, Acquisition Mode = Cyclic, Cycle = 1 000 ms.
  4. Apply scaling. In the tag's linear scaling, set Value range = 0 to 999999999 and Scaling = x 0.001 for energy values. For voltage, set Scaling = x 0.1 (giving 0.1 V resolution).
  5. Test with tag simulator. Right-click the tag, select Update value, and verify against a known reference (e.g., walk-up read of the meter with a DLMS client tool such as open-source DLMS-COSEM Python client).
  6. Map tags to screen objects. Bind I/O fields, bar graphs, and trend controls in the WinCC screen to the HMI tags. Configure trend logging to archive energy totals at 15-min intervals.
  7. Set up alarm conditions. Create analog alarm limits for voltage (e.g., < 207 V or > 253 V on a 230 V nominal) and for current imbalance across L1/L2/L3.

Verification, Diagnostics, and Troubleshooting Matrix

Symptom Root Cause Diagnostic Step Remediation
WinCC tag shows 0 / QUALITY_BAD No TCP connection to gateway Ping 192.168.10.50 from WinCC station; check firewall rules on TCP/502 Open TCP/502 in Windows Firewall; verify gateway is on same VLAN
WinCC tag shows constant value DLMS poll is failing silently Check gateway event log for DLMS association errors Verify meter logical address matches gateway configuration; check LLS password
Value is exactly 10x or 0.1x expected Scaler_unit not applied Read raw OBIS value with DLMS client; compare to gateway Reapply scaling in gateway or WinCC tag
Intermittent read timeouts (> 5 s) RS-485 collision or single device timing out Check termination resistors; reduce baud rate; look for missing ground Add 120 ohm terminators at both ends; verify shield grounded at one end only
All tags show 0xFFFFFFFF / negative Byte-swap error on 32-bit values Compare raw Modbus register hex view to meter value Enable big-endian <> little-endian swap in gateway; configure WinCC tag as "Swap words"
One meter works, others do not Duplicate logical address Walk the bus with HDLC sniffer (Wireshark + DLMS dissector) Re-number meter logical addresses to be unique
Reads work for a few hours then stop Authentication re-negotiation failure Check meter event log "Security log" for failed authentications Increase session timeout in gateway; verify LLS password match
WinCC shows stale data after gateway reboot WinCC not re-reading on reconnect Enable connection watchdog in WinCC tag Set tag acquisition to "On demand" or implement VBS watchdog

For deeper protocol-level diagnostics, deploy Wireshark on a tap point and apply the DLMS dissector. Watch for HDLC S-frames (RR, RNR) indicating flow control. An RNR storm from one meter indicates it cannot keep up - typically caused by event logs filling the buffers; clear the meter's event log (OBIS 0.0.96.15.0.255) as preventive maintenance.

Security Suites and Authentication Levels

IEC 62056-62 defines four security suites that meter and head-end must agree on:

Suite Authentication Method Encryption Typical Use
0 None None Read-only local optical port, factory programming
1 (LLS) Low-Level Security: clear-text password (16 bytes max) None Residential metering, simple SCADA polling
2 (HLS) High-Level Security: challenge-response with HLS secret, MD5 or SHA-256 Optional AES-128-GCM Industrial metering, AMI networks
3 Reserved for future - Not in use
Operational note: Many gateways only support Suite 0 and Suite 1. If the meter is shipped with Suite 2 mandatory (common in EU utility metering), confirm the gateway can be upgraded or replace with an OPC UA server. Plan a DLMS/COSEM training program for the operations team before commissioning, as improper authentication setup is the leading cause of meter integration failures.

The DLMS User Association publishes the conformance test tool and a master conformance test report for each certified meter; request this from the meter vendor before deployment. The official IEC 62056 standard set is available from the IEC webstore - verify any claims of "IEC 62056 compliant" against the specific part number (e.g., IEC 62056-46:2018 is the 2nd edition HDLC over TCP/IP).

Does Siemens WinCC support DLMS/COSEM natively?

No. WinCC Professional and Unified ship drivers for S7, Modbus TCP/RTU, OPC UA, IEC 61850 (with Energy Suite option), DNP3, PROFINET, and EtherNet/IP. DLMS/COSEM (IEC 62056) is not in the channel set. The recommended integration path is a DLMS-to-Modbus TCP protocol gateway, which WinCC polls through its built-in Modbus driver.

What is the difference between DLMS and COSEM?

DLMS (Device Language Message Specification) describes the data exchange at the application and transport layers, including the GET / SET / ACTION services and the HDLC framing on TCP/IP or RS-485. COSEM (Companion Specification for Energy Metering) defines the object model - the interface classes and OBIS naming system - that lets any DLMS client read structured data regardless of meter manufacturer. The two are always deployed together as DLMS/COSEM.

How many DLMS meters can I poll on a single RS-485 bus?

Up to 32 standard RS-485 loads per segment, extendable to 127 with repeaters. Each meter must have a unique HDLC logical address in the range 1-127. At 9 600 bit/s, a 32-meter bus polls each OBIS code in roughly 250-400 ms; for a 10-code mapping per meter, the full sweep takes 80-130 s. For larger deployments, use multiple busses or migrate to Ethernet-attached meters using Profile B (DLMS over TCP/IP, port 4059).

Can I read DLMS gas or water meters the same way?

Yes. The COSEM object model was extended beyond electricity to gas, water, and heat metering under IEC 62056. The same OBIS naming conventions apply - for example, 7.0.1.8.0.255 is gas volume total (m^3) and 8.0.1.8.0.255 is water volume total. Confirm the gateway you select ships a profile for the utility type; some gateways are electricity-only.

Which open-source tools help me test DLMS before buying a gateway?

The DLMS-COSEM Python library provides a Python API for parsing xDLMS APDUs, reading OBIS codes, and decoding attribute 2 values. Use it from a laptop with a USB-to-RS-485 converter to validate that the meter returns expected values before commissioning the gateway-to-WinCC chain. Pair this with Wireshark and a DLMS dissector for HDLC-level capture.

Back to blog