DLMS/COSEM in the TelWin SCADA system
TelWin SCADA 8.00 opens up new possibilities for the energy sector! The latest version of the system introduces the DlmsDrv communication driver, providing support for the DLMS/COSEM standard used by the most popular electricity meters. Thanks to support for encrypted data exchange, users can securely integrate metering data from the energy infrastructure directly into the TelWin SCADA system. This opens up new possibilities for building solutions for monitoring, supervising, and analyzing energy consumption, as well as utilizing meter data in business, reporting, and operational processes. It marks another step forward in the evolution of the TelWin SCADA platform and responds to the growing demands of the energy sector regarding security, automation, and the efficient use of metering data.
The DLMS/COSEM Protocol
Smart electricity, gas, and water meters require a communication protocol that not only transmits data but also describes it—defining the value type, engineering unit, and the meaning of the measurement. This role is fulfilled by DLMS/COSEM, a standard adopted by the IEC as the IEC 62056 series of standards and developed by the DLMS User Association. It has become the foundation of data exchange in smart metering systems. This standard consists of two complementary specifications: DLMS (Device Language Message Specification) defines the communication mechanisms—transport, communication session, authentication, and encryption; COSEM (Companion Specification for Energy Metering) defines the object-oriented data model of the device. Both elements operate together under the joint name DLMS/COSEM. DLMS/COSEM describes device data through objects belonging to classes defined in the standard—each with an OBIS code and a specific attribute structure. Objects of the Register class, used for measured values, contain the measurement result along with a scaler and an engineering unit. This distinguishes DLMS/COSEM from protocols such as Modbus, where values are mapped to register numbers without a defined type, unit, or meaning (these parameters must be provided outside the protocol, in the device documentation).
COSEM Data Model
COSEM defines classes—each with a class_id and a specific set of numbered attributes and methods. COSEM objects are instances of these classes implemented in a specific device. The standard permits manufacturer extensions: an object may contain additional attributes and methods beyond the standard. Access to device data is performed using one of two addressing modes. In LN (Logical Name) mode, each object is identified by a logical_name containing an OBIS code; access to an attribute or method is achieved by specifying the class_id, logical_name value, and the attribute or method index. In SN (Short Name) mode, each attribute and method is mapped to a 16-bit integer—this mode is used by some manufacturers regardless of device complexity. OBIS codes are unique identifiers that describe data within the metering device—including measured values, configuration data, and device status information. The list of objects available in a given device along with their OBIS codes and class identifiers is retrieved via the Association LN or Association SN object after establishing a connection. Historical data is stored in objects of the ProfileGeneric class (class_id = 7)—each profile captures selected attributes of other COSEM objects at defined intervals and stores them in a buffer. The buffer can be read selectively by specifying a range of values or a range of entries. The profile content—which objects are logged and at what frequency—originates from the configuration of the meter itself and cannot be modified by the reading system.
Association and Security
Prior to data exchange, the client and the device must establish an association—an application-level connection within which access rights and the authentication level are negotiated. Each association progresses through three phases: connection establishment, data exchange, and release. The authentication level determines the scope of access to the device. The standard specifies three levels: no authentication, password-based authentication (Low Level Security, LLS), and mutual cryptographic authentication between both parties (High Level Security, HLS). The scope of data available without authentication depends on the manufacturer's implementation—some devices expose only structure information via the public association, while others allow reading selected measurement data. Full access according to the device's permission configuration is granted through an authenticated association. DLMS/COSEM supports various communication profiles: HDLC for serial lines and a TCP/IP wrapper for network connections. The selection of the profile depends on the physical infrastructure and the capabilities of the specific device.
Implementation of DLMS/COSEM Using the DlmsDrv Module in the TelWin SCADA
System Support for the DLMS/COSEM protocol in the TelWin system is implemented by the DlmsDrv module. Its role is to handle the entire protocol complexity—negotiating associations, authentication, and encryption—so that configuration is reduced to defining connection parameters and a variable list.
Device Configuration
The definition of a DLMS device includes connection parameters—communication link, client address, physical address, and logical address of the server—as well as security parameters: authentication method and access keys. The client address and server addresses stem from the configuration of the specific meter and should be obtained from device documentation or the vendor. DlmsDrv supports both object addressing modes—LN and SN; for devices using SN mode, the module maps OBIS codes to addresses internally. Some meter models require negotiation of the maximum data packet size (PDU) during association establishment—this behavior is specific to the device model and must be accounted for in the configuration if required by the manufacturer's documentation.
Association Table
DlmsDrv downloads the association table from the device and stores it locally as an XML file. The table contains the list of COSEM objects available in a given meter—OBIS codes, classes, and access rights—and serves as the foundation for defining variables. Because the set of available objects is specific to each model, the table is retrieved separately for each configured device.
Current and Historical Data DlmsDrv supports defining variables for COSEM class objects—the class type is determined when defining each variable based on the device's association table. For variables with a scaling factor, an option is available to automatically scale the read value into engineering units. Historical data is retrieved from the meter's ProfileGeneric objects. DlmsDrv supports selective data retrieval from the profile buffer and automatically backfills history starting from the last retrieved record. The interval between records is determined by the profile configuration within the meter itself and cannot be modified from the SCADA system side.
Encryption
For devices utilizing encryption, user configuration is limited to entering keys in the device definition: GUEK is responsible for communication encryption, GAK for frame authentication, and KEK for key encryption during key exchange. DlmsDrv automatically negotiates the association and encrypts/decrypts frames.
Summary
DLMS/COSEM is a communication standard dedicated to metering devices, defining both communication layers and an object-oriented data model. Its primary advantage is that a COSEM object contains information regarding the type, unit, and meaning of the measurement without the need to consult external documentation. However, the scope of objects available in a particular meter and the content of historical profiles depend on the manufacturer and model, requiring an individual analysis of the association table for each device. In the TelWin system, the protocol complexity is handled by the DlmsDrv module—association negotiation, authentication, and encryption occur automatically. Configuration on the system side is reduced to defining connection parameters, access keys, and variables based on OBIS codes from the meter's association table.
The communication driver supporting this standard is available in versions 7.24 and 8.0.

