DLMS/COSEM
DLMS COSEM communication protocol
Supported device types and versions
Communication line configuration
Station configuration
Station parameters
Settings of transmission parameters
I/O tag configuration
I/O tag address
Literature
Changes and modifications
Document revisions
Supported device types and versions
This protocol implements a serial communication with the devices by binary HDLC protocol according to the DLMS/COSEM standard.
Two modes of addressing I/O tags are supported:
"Short Name (SN) referencing" using 16-bit object addresses
"Logical Name (LN) referencing" using 6-byte OBIS codes
Communication was tested with the following devices:
EMH LZQJ (SN referencing)
Landis ZMD400 (SN referencing)
Iskraemeco Iskra MT880-M (LN referencing)
ADDAX NP73E.2-18-1 (LN referencing)
The protocol supports time synchronization, the period is configured in the station configuration dialog.
Communication line configuration
Supported line categories: Serial, SerialOverUDP Device Redundant, TCP/IP-TCP, TCP/IP-TCP Redundant, MOXA IP Serial Library, RFC2217 Client, MODEM.
Station configuration
Communication protocol "DLMS/COSEM".
The station address (DLMS Server HDLC/MAC Address) consists of two parts: Upper MAC Address and Lower MAC Address. Each of them is in the range from 0 to 16383 (3FFFH).
As per a specification, DLMS UA 1000-2 Ed. 7.0 (Green Book) represents:
Upper MAC Address is used for Logical Device addressing, i.e. separately addressable entity within the physical device.
Lower MAC Address is used for Physical Device addressing, i.e. multi-drop address on the line.
Upper MAC Address is required. An implicit value, which is set when the station address is missing, is a reserved address Upper MAC Address = 1 (Management Logical Device).
In ordinary situations, when the physical device is identical with the logical one (one physical device = one logical device), this address does not need to be changed. If the physical device integrates more logical devices, you should monitor content or "0-0:41.0.0" register of "SAP assignment" class (class_id=17, attribute 2 "SAP_assignment_list") in the "DLMS SN Object List" dialog box. This dialog box shows the list of logical devices that are integrated in a physical one.
This is the example of a value representation of the "SAP_assignment_list" attribute of the "SAP assignment" class in the device which contains one logical device with Upper MAC Address 16.
See also the protocol parameter "Client MAC address" and a document "DLMS UA 1000-2 Ed. 7.0", chapter 8.4.2.3 "Reserved special HDLC addresses".
Note: for Iskraemec Iskra MT880, Upper MAC Address = 1, Lower MAC Address = 16 + last two digits of the serial number (if, for example, the serial number is 72211943, then Lower MAC Address = 16 + 43 = 59).
Station parameters
Communication station configuration dialog box - Protocol parameters tab.
They influences some optional protocol parameters. The following station protocol parameters can be set:
Table 1
Parameter | Meaning | Unit / Size | Default value |
|---|---|---|---|
--- DLMS/HDLC parameters --- | |||
Application Context | The setting of the "Application Context" parameter of the DLMS/COSEM protocol. | Logical_Name_Referencing_No_Ciphering | Short_Name_Referencing_No_Ciphering |
Client MAC Address | HDLC MAC address of a client (i.e. D2000 KOM process). The default value is 10H which is the reserved value "Public client". See "DLMS UA 1000-2 Ed. 7.0" document, chapter 8.4.2.3 "Reserved special HDLC addresses". | 0 .. 7FH | 10H |
HDLC Max_info_field_length-receive parameter | The maximum length of one HDLC frame packet on the receiver's side. When communication problems occur (e.g. checksum error etc.), we recommend decreasing the value of this parameter. |
| 250 |
HDLC Max_info_field_length-transmit parameter | The maximum length of one HDLC frame packet on the transmitter's side. When communication problems occur (e.g. checksum error etc.), we recommend decreasing the value of this parameter. |
| 250 |
Client Max Receive PDU Size | The maximum length of PDU (data packet). One PDU can be divided into more HDLC frame packets according to settings of protocol parameters HDLC Max_info_field_length-receive and HDLC Max_info_field_length-transmit. | 0 .. 65535 | 1200 |
No Disconnect | A Disconnect request will not be used after the readout of values from a device is finished. During the next readout, a connection establishment phase is omitted (HDLC mode-setting request and AARQ negotiation request). | YES/NO | NO |
Password | Device password. If entered, the "Low Level Security" authentication with the entered password is used within the AARQ Association Request. |
|
|
No Browsing | Online address selection from the list of objects, directly on the device, through the DLMS Object List dialog box in the configuration of the I/O tag address will be disabled. | YES/NO | NO |
Profile Data Optimization | Several electrometers implement optimization of time data when reading from profiles (class_id=7). The optimization means that only the first row of data contains a timestamp, others contain null. The timestamp of each row is equal to the previous row's timestamp plus the value of the capture_period (4) attribute. If the value of this parameter is YES, the value of the capture_period attribute is read prior to reading the profile data. If the value of this parameter is NO, the content of the capture_period attribute is not read, but the KOM process relies on all profile rows to contain timestamps. If this is not the case, the profile data is not read, and the line logs contain error messages "turn on station parameter 'Profile Data Optimization". | YES/NO | YES |
Opening Mode | Opening mode of connection with the device. If the device is configured so that it directly uses DLMS/COSEM protocol on the given interface, set this parameter to "Direct HDLC". Mostly (e.g. when reading through IR optical interface by an optical reading head) you must open the connection in IEC protocol in so-called "mode E" and then transfer to HDLC binary protocol (i.e. DLMS/COSEM). "Mode E", according to the specification of IEC protocol, uses the following settings of the transmission parameters:
If "Opening Mode" is set to "IEC mode E", the above-mentioned transmission parameters must be set. As for the Serial communication line, the parameters must be set in the line parameters "Mode 1". See the protocol parameter "Software 7E1". The setting of the baud rate to 300 Baud is usually not required when using the line of MODEM category. A so-called DTE speed is used between a PC and a modem. If this speed is higher than 300 Baud, you have to activate the "handshaking" parameter on RTS/CTS in proper line mode. If the parameter value is set to "Direct HDLC", a dynamic change of transmission parameters is not expected. You can use any Serial line mode and set it by the "Line mode" parameter on the station. More information is mentioned in IEC 62056-21, Electricity metering - Data exchange for meter reading, tariff and load control - Part 21: Direct local data exchange, Annex E: "METERING HDLC protocol using protocol mode E for direct local data exchange". See also chapter "Setting of transmission parameters". | Direct HDLC | Direct HDLC |
--- IEC Parameters --- | |||
IEC Device Address | It is an address of a station (device) and is used only if the Opening mode is set to "IEC Mode E". "IEC Device Address" is a serial number of the device. In OBIS addressing, this register has an address "0-0:C.1.0" - Device ID 1, manufacturing number. The picture below shows the front panel of the EMH LZQJ device. There is a serial number, i.e. IEC address (563911). If the device contains a display, this value may be usually displayed as you can see in the picture. |
| - |
Baudrate Changeover (Z) | This parameter is used only if the Opening mode is set to "IEC Mode E". It defines baud rate for the communication through HDLC protocol DLMS/COSEM after the changeover from IEC mode E to the HDLC binary communication. As for the Serial line, this parameter must set the baud rate to "Mode 2" of the line. AUTO option sets the baud rate according to the value offered by a device. If this baud rate can not be identified, you should check the diagnostic communication logs. The following message can be found there: 10:46:05.809 30-05-2011|D|DLMS> Z Detected: '4' = 4800 Bdand set the baud rate according to it. HDLC binary communication through DLMS/COSEM protocol, unlike the opening IEC step, is realized by different parameters which have to be set in "Mode 2" of the Serial line category:
See also the "Software 7E1" parameter and the chapter Settings of transmission parameters. | 300 | AUTO |
Software 7E1 | This parameter is used if "Opening mode" is set to "IEC Mode E". Setting it to YES activates an SW emulation of transmission parameters of 7 data bits and even parity when the transmission parameters of 8 data bits and none parity are set (i.e. emulation of 7E1 when 8N1 is set). It enables the use of the "IEC mode E" option for SerialOverUDP lines that do not support dynamic changes of transmission parameters. See the chapter Settings of transmission parameters. | YES/NO | NO |
Wake-up Message Length | This parameter is used if "Opening mode" is set to "IEC Mode E". Nonzero value activates the sending of a so-called "wake-up message" which activates the communication interface of battery-powered devices. The null characters (0x00) are sent according to the quantity that is defined by the parameter value. The baud rate must be 300 Baud (configured in "Mode 1" for Serial lines). More information is available in IEC 62056-21, Electricity metering - Data exchange for meter reading, tariff and load control - Part 21: Direct local data exchange, Annex B: "Wake-up methods for battery-operated tariff devices". | 0 .. 120 | 0 |
Delay After Wake-up Message | This parameter is used if "Opening mode" is set to "IEC Mode E". If a so-called "wake-up" message is activated, this parameter defines a delay after sending a "wake-up" message, before the beginning of communication. In the case of a Serial line, we recommend setting the "WaitTxEMPTY" parameter in a specific line mode. According to the document IEC 62056-21, you should set this parameter between 1,5 and 1,7 seconds. | ms | 0 |
--- Send/receive parameters --- | |||
Wait First Timeout | The delay after sending the request but before reading the response. | ms | 100 ms |
Wait Timeout | The delay between readings of the response until its completion. | ms | 200 ms |
Max. Wait Retry | A retry count of reading response until its completion. | 1 .. 100 | 20 |
Retry Timeout | The delay between the request retries if a communication error occurs. | ms | 500 ms |
Retry Count | A retry count of a request if a communication error occurs. | 1 .. 20 | 3 |
--- Modem parameters --- | |||
Modem Telephone Number | The phone number for modem connection with a device (only for MODEM lines). |
|
|
Dial Timeout | Maximum waiting time for dial-up modem connection (only for MODEM lines). | 1 .. 600 s | 60 s |
Dial Retry Count | A maximum retry count of dial-up modem connection (only for MODEM lines). | 1 .. 20 | 1 |
Dial Retry Timeout | Delay before attempting to dial after an unsuccessful connection attempt (only for MODEM lines). | 1 .. 600 s | 30 s |
After Connect Delay | Time delay after the dial-up connection has been established (only for MODEM lines) but before the beginning of communication. | 0 .. 30 s | 5 s |
AT Command 1 | A special initial string of modem 1 (only for MODEM lines). |
| AT&FE0V1Q0B0X3L0M0 |
AT Command 2 | A special initial string of modem 2 (only for MODEM lines). Explanation of recommended settings: S37=5 1200bps DTE-DTE speed - limits the speed for modems. Many devices use modems with limited transmission speeds and this setting can speed-up the connection establishment process. Higher transmission speeds must be negotiated individually. &D2 DTR drop to hangup - for matching with the parameter of modem line (line configuration, tab "Modem - parameters", check the "Use DTR for Hangup" option). S0=0 Disable auto-answer. Auto-answer will not be used. S30=2 20 sec inactivity timeout - automatic hangup after idle timeout expired. Necessary for assuring connection termination after the communication with the last device is over.
|
| ATS37=5&D2S0=0S7=60S30=2 |
--- Debug parameters --- | |||
HDLC Debug | This parameter activates debug information from the HDLC protocol level. | YES/NO | NO |
Full Debug | This parameter activates full communication monitoring. It enables displaying of the I/O tag values and other debug information. | YES/NO | NO |
Settings of transmission parameters
Example 1 - line category Serial, the communication through IR optical head.
Line mode 1 | 300 Baud, 7 data bits, 1 stop bit, even parity |
Line mode 2 | 300 Baud, 8 data bits, 1 stop bit, none parity |
Opening Mode | IEC mode E |
Baudrate Changeover (Z) | 300 |
Software 7E1 | NO |
Example 2 - line category Serial, communication through IR optical head.
Line mode 1 | 300 Baud, 8 data bits, 1 stop bit, none parity |
Line mode 2 | 300 Baud, 8 data bits, 1 stop bit, none parity |
Opening Mode | IEC mode E |
Baudrate Changeover (Z) | 300 |
Software 7E1 | YES |
Example 3 - line category Serial, communication through RS232/RS485 interface.
Line mode 1 | 4800 Baud, 8 data bits, 1 stop bit, none parity |
Opening Mode | Direct HDLC |
I/O tag configuration
Possible I/O tag types: Ai, Ci, Di, TxtI, TiA, TiR.
I/O tag address
To understand the object addressing in DLMS/COSEM protocol, you should know a so-called OBIS standard according to the IEC standard 62056-61 Object Identification system (OBIS), chapter "Annex A - Code presentation".
The "Logical Name (LN) referencing" mode directly uses the OBIS address of objects.
The "Short Name (SN) referencing" mode does not use the OBIS address but a 16-bit numerical address.
The individual data entities are presented in so-called COSEM objects (Companion Specification for Energy Metering), which are the instances of COSEM classes (COSEM interface classes, COSEM IC). Individual types of COSEM classes are specified in the document "COSEM Identification System and Interface Classes, Ed. 10.0", i.e. so-called DLMS Blue Book. Each type of COSEM class has its own identification number ("class_id"). Each class has a set of attributes that have sequence numbers. The attribute facilitates the reading of a specific parameter of a data entity.
Each instance has its beginning SN address (base_name), which is also the address of the first attribute of a class. The "logical_name" is the first attribute of all COSEM classes. By reading this attribute, an OBIS address of a data entity that is presented by a specific class can be obtained. The addresses of further attributes are calculated according to this formula in the "Short Name referencing" mode:
short_name = base_name + ((attribute_index - 1) * 0x08)
The attributes can be static or dynamic depending on whether their value is static (i.e. unchanging, set by a producer or in the configuration of the device) or dynamic (changing). In the D2000 System, we recommend configuring only the dynamic attributes, as the value of the measured data entity is in dynamic attributes. If it is necessary for the interpretation of a value in a dynamic attribute (mostly the "value" attribute), other static or dynamic attributes are read automatically. See more information in the section Supported COSEM classes.
In the following tables, you can find the supported COSEM classes. The attributes that represent the value of the data entity (i.e. value that is important for a user) are marked as "Yes, the value of an entity" in the column "Support in D2000". The static attributes are read automatically and characterized as "Automatically read".
Supported COSEM classes
Data | The basic class that contains data entity accessible via attribute "value". | ||||
Attribute | Attribute value type | Attribute description | Support in D2000 | ||
1. | logical_name (static) | octet-string (text) | OBIS address of the data entity which is represented by an instance of this class. | Yes, separate I/O tag | |
2. | value (dynamic) | CHOICE (see supported types of attribute values) | The value of the data entity. | Yes, the value of an entity | |