Read latest DLMS/COSEM specific documentation from. This documentation is old and will be removed.
Introduction Gurux DLMS/COSEM component is designed to simplify communication with DLMS/COSEM devices. With the component you can easily communicate between DLMS/COSEM devices, by using the data connection, and the manufacturer of your choice.
At this moment we have libraries or components for ANSI C, ANSI C,.C#, Java and Delphi. More technical details you can find. The components, interfaces and methods are described more precisely later in this document.
Connection Initialization The connection initialization depends on the connection type and the device. Some devices require IEC62056-21 protocol handshake before starting to communicate using DLMS protocol. IEC62056-21 Handshake In serial port connection default IEC62056-21 settings are: Bitrate 300, 7E1. + deviceSerialNumber + '!
R n' Send query to the device containing '/?!' And a new line (0x0D 0x0A) without the quotations. This requests the identity information from the device. The device responds with serial number and the maximum connection speed. The reply data is formatted as follows: /XXXZ Ident and a line change XXX is the manufacturer name Z is the maximum baud rate Ident is the Identification info of the device. Z is the most important part of the device and is defined in single number: 0 - 300 Bd 1 - 600 Bd 2 - 1 200 Bd 3 - 2 400 Bd 4 - 4 800 Bd 5 - 9 600 Bd 6 - 19200Bd 7, 8, 9 - reserved for later extensions. Send request to change to DLMS mode.
Packet is formatted as follows: 0x06 '0' Z '2' 0x0D 0x0A without the quotations. Z is the requested connection speed. The device might respond to this but not all of them do. It is safe to continue with connection initialization even without reply. If device is DLMS/COSEM compliant and meter do not answer anything it is in DLMS mode. Serial/Modem handshake This is done only with serial and modem connections. Direct tcp/ip doesn't need this.
If IEC62056-21 handshake is used it is done before this. This handshake uses SNMR request to gather packet and window size information from the device. Before generating the packet ClientID, ServerID and UseLogicalName must be set in the GXCOSEM Component. After that is done the packet is generated from SNRMRequest method. Send this request using data handling methods described in. If the device does not reply to this message see possible causes.
Once the full reply data is received call ParseUAResponse method to set configure GXCOSEM Component with correct settings. AARE request This is the first command that is mandatory for all connections and device types. This command tells the device if authentication is used and wheter Long Name or Short Name reference is used. The packet can be generated with AARQRequest method and it uses UseLogicalName and Authentication properties so make sure these are set to correct values.
If password is defined all data do not nesessary do not fit to one message so data must be split to multible messages with SplitDataToPackets method. Send this command using data handling methods described in. Once the full reply is received parse it with ParseAAREResponse method. This method sets the relevant settings to the GXCOSEM component and return a collection of manufacturer specific tags if there was any.
Now the connection is established. Association View Association View describes what kind of objects meter offers. Structure of Association View varies by used Authentication. The association view is requested using data from GetObjects method. Send this request using data handling methods described in.
The reply data is very large so this can take very long time (even hours with slow connection like terminal and if the connection is bad). Because this takes so long it is recommended to save this information for future use as it doesn't change unless meter software is updated. The data structure varies between manufacturers and device models. The reply data is parsed using ParseObjects method in GXCOSEM Component. The method returns a collection of DLMS Objects. Some of the data object may be typed as Profile Generic.
These are special objects that have columns and rows instead of single value. You can think Profile Generic as a Table. To get the column information generate message using method Read with following parameters: Long or Short Name, 1, 1, ObjectType.ProfileGeneric, 3 The reply data is parsed with ParseObjects method and it returns the collection of data objects that are the columns. Reading Reading is generally split in two. Reading of 'regular' data objects and profile generic objects. General Data Objects Data objects are read using Read method.
The parameters are defined as follows: Data: Logical or short name Packet Position: Always 1 Total Packet Count: Always 1 Interface Class: Object Type of the requested item, ex. Attribute Ordinal: The ordinal number of the requested attribute.
For basic Data object type the first attribute contains Logical Name and the second attribute contains value. The data is parsed using GetValue method that returns the value in the format that the device provided, ex. Integer or string.
In some cases the format is not usable, ex time is provided as byte array. In these cases use ChangeType method to parse the value. Object data = mCosem.Read(baseName, 1, 1, objectType, attributeOrdinal); data = ReadDataBlock(data); object val = mCosem.GetValue(data); Profile Generic objects There are two ways to read Profile Gereric data. By Entry or Range. In entry parameters tell where read is started (Zero index) and how many items are read. In range parameters tell starting and ending time. All meters do not support read by entry or range.
The request is generated using ReadRowsByEntry or ReadRowsByRange methods. ActiceX component uses ReadProfileGenericData.
The paramters for ReadProfileGenericData are as follows: Name: Logical or short name ClassID: This is always Clock (8) if we want to read data between days. LogicalName: The logical name of the first column. Type: The Attribute Index of the first column. Version: The version of the first column. From: The start date or row index of the requested period.
To: The end date or row index of the requested period.If row indices are used the logical name of the first column must be null. The reply data is parsed using GetValue that returns a two dimensional table of values. Disconnect The disconnect message must be sent always before disconnecting even if the device doesn't reply to it. Disconnect message is generated using Disconnect method and might not get a reply. Before sending request it's important to be sure that it can fit in packet sizes. To ensure this there is a SplitDataToPackets method that returns the data as an array of byte arrays to be sent. When receiving data use GetDataFromPacket to strip unwanted header data from it.
There can also be EOP bytes in the middle of the packet so to be sure that the packet is really complete use IsDLMSPacketComplete method before continuing. After receiving the full packet use CheckReplyErrors to check that there wasn't any errors. When a full packet is received and free of errors check if there is more data available using IsMoreDataAvailable method. If there is more data, generate a new read message using ReceiverReady method and check remember to check for partial packets and errors again. If your meter do not answer anything make sure that there is DLMS label on the cover of the device.
Server or Client Address is wrong. Server and Client address are device manufacture debended. You can ask Server and Client address from the manufacturer. If you have any DLMS/COSEM device, and you're facing problems to use Gurux DLMS Component with it, read our to get more information how to get over it. Gurux DLMS component supports HDLC Addressing by 1, 2, 4 Bytes and can communicate using HDLC, TCP/IP or UDP. It supports Lowest, Low and High Level authentications.
Both Long and Short Name Association Types are supported.
Read latest DLMS/COSEM specific documentation from. This documentation is old and will be removed. Introduction Gurux DLMS/COSEM component is designed to simplify communication with DLMS/COSEM devices. With the component you can easily communicate between DLMS/COSEM devices, by using the data connection, and the manufacturer of your choice. At this moment we have libraries or components for ANSI C, ANSI C,.C#, Java and Delphi.
More technical details you can find. The components, interfaces and methods are described more precisely later in this document. Connection Initialization The connection initialization depends on the connection type and the device. Some devices require IEC62056-21 protocol handshake before starting to communicate using DLMS protocol. IEC62056-21 Handshake In serial port connection default IEC62056-21 settings are: Bitrate 300, 7E1. + deviceSerialNumber + '! R n' Send query to the device containing '/?!'
And a new line (0x0D 0x0A) without the quotations. This requests the identity information from the device. The device responds with serial number and the maximum connection speed. The reply data is formatted as follows: /XXXZ Ident and a line change XXX is the manufacturer name Z is the maximum baud rate Ident is the Identification info of the device.
Z is the most important part of the device and is defined in single number: 0 - 300 Bd 1 - 600 Bd 2 - 1 200 Bd 3 - 2 400 Bd 4 - 4 800 Bd 5 - 9 600 Bd 6 - 19200Bd 7, 8, 9 - reserved for later extensions. Send request to change to DLMS mode. Packet is formatted as follows: 0x06 '0' Z '2' 0x0D 0x0A without the quotations. Z is the requested connection speed. The device might respond to this but not all of them do. It is safe to continue with connection initialization even without reply.
If device is DLMS/COSEM compliant and meter do not answer anything it is in DLMS mode. Serial/Modem handshake This is done only with serial and modem connections. Direct tcp/ip doesn't need this. If IEC62056-21 handshake is used it is done before this.
This handshake uses SNMR request to gather packet and window size information from the device. Before generating the packet ClientID, ServerID and UseLogicalName must be set in the GXCOSEM Component. After that is done the packet is generated from SNRMRequest method. Send this request using data handling methods described in. If the device does not reply to this message see possible causes. Once the full reply data is received call ParseUAResponse method to set configure GXCOSEM Component with correct settings. AARE request This is the first command that is mandatory for all connections and device types.
This command tells the device if authentication is used and wheter Long Name or Short Name reference is used. The packet can be generated with AARQRequest method and it uses UseLogicalName and Authentication properties so make sure these are set to correct values. If password is defined all data do not nesessary do not fit to one message so data must be split to multible messages with SplitDataToPackets method. Send this command using data handling methods described in. Once the full reply is received parse it with ParseAAREResponse method. This method sets the relevant settings to the GXCOSEM component and return a collection of manufacturer specific tags if there was any.
Now the connection is established. Association View Association View describes what kind of objects meter offers. Structure of Association View varies by used Authentication. The association view is requested using data from GetObjects method. Send this request using data handling methods described in. The reply data is very large so this can take very long time (even hours with slow connection like terminal and if the connection is bad).
Because this takes so long it is recommended to save this information for future use as it doesn't change unless meter software is updated. The data structure varies between manufacturers and device models. The reply data is parsed using ParseObjects method in GXCOSEM Component. The method returns a collection of DLMS Objects.
Meter Reading Software
Some of the data object may be typed as Profile Generic. These are special objects that have columns and rows instead of single value. You can think Profile Generic as a Table. To get the column information generate message using method Read with following parameters: Long or Short Name, 1, 1, ObjectType.ProfileGeneric, 3 The reply data is parsed with ParseObjects method and it returns the collection of data objects that are the columns.
Reading Reading is generally split in two. Reading of 'regular' data objects and profile generic objects.
General Data Objects Data objects are read using Read method. The parameters are defined as follows: Data: Logical or short name Packet Position: Always 1 Total Packet Count: Always 1 Interface Class: Object Type of the requested item, ex. Attribute Ordinal: The ordinal number of the requested attribute. For basic Data object type the first attribute contains Logical Name and the second attribute contains value. The data is parsed using GetValue method that returns the value in the format that the device provided, ex.
Integer or string. In some cases the format is not usable, ex time is provided as byte array. In these cases use ChangeType method to parse the value. Object data = mCosem.Read(baseName, 1, 1, objectType, attributeOrdinal); data = ReadDataBlock(data); object val = mCosem.GetValue(data); Profile Generic objects There are two ways to read Profile Gereric data. By Entry or Range. In entry parameters tell where read is started (Zero index) and how many items are read.
In range parameters tell starting and ending time. All meters do not support read by entry or range. Pokemon xy the movie hoopa.
The request is generated using ReadRowsByEntry or ReadRowsByRange methods. ActiceX component uses ReadProfileGenericData.
The paramters for ReadProfileGenericData are as follows: Name: Logical or short name ClassID: This is always Clock (8) if we want to read data between days. LogicalName: The logical name of the first column.
Type: The Attribute Index of the first column. Version: The version of the first column. From: The start date or row index of the requested period.
To: The end date or row index of the requested period.If row indices are used the logical name of the first column must be null. The reply data is parsed using GetValue that returns a two dimensional table of values. Disconnect The disconnect message must be sent always before disconnecting even if the device doesn't reply to it. Disconnect message is generated using Disconnect method and might not get a reply. Before sending request it's important to be sure that it can fit in packet sizes.
To ensure this there is a SplitDataToPackets method that returns the data as an array of byte arrays to be sent. When receiving data use GetDataFromPacket to strip unwanted header data from it. There can also be EOP bytes in the middle of the packet so to be sure that the packet is really complete use IsDLMSPacketComplete method before continuing.
After receiving the full packet use CheckReplyErrors to check that there wasn't any errors. When a full packet is received and free of errors check if there is more data available using IsMoreDataAvailable method. If there is more data, generate a new read message using ReceiverReady method and check remember to check for partial packets and errors again.
If your meter do not answer anything make sure that there is DLMS label on the cover of the device. Server or Client Address is wrong. Server and Client address are device manufacture debended. You can ask Server and Client address from the manufacturer. If you have any DLMS/COSEM device, and you're facing problems to use Gurux DLMS Component with it, read our to get more information how to get over it.
Gurux DLMS component supports HDLC Addressing by 1, 2, 4 Bytes and can communicate using HDLC, TCP/IP or UDP. It supports Lowest, Low and High Level authentications. Both Long and Short Name Association Types are supported.
Prompt time to market Choosing the Terranova Libraries allows drastic reduction of development times for communication protocols because Terranova guarantees consistent conformity of its products to the companions prevailing in the various countries, both in start-up phase and the subsequent design phase. Optimization of investments Entrusting specialists with communication protocols means that it is no longer necessary to make further investments to monitor complex and highly vertical fields of competence with respect to the customer’s own core business. The library has a modular architecture where each module represents a specific communication protocol. DLMS/COSEM: provides all tools for managing a DLMS communication and the functions to interact with the Terranova Object Model. Wrapper: light “stateless” protocol, used for supplying another level of multiplex/demultiplex over TCP/IP. High-Level Data Link Control (HDLC): protocol designed for controlling data link and transfer.
Terranova Object Model: designed to be independent from the underlying protocol stack; it facilitates communication and sharing of data between other modules. High-Level User: user code which directly utilizes the services offered by the stack modules. Low-Level User: user code which can read/write on the communication channel. DLMS Library, component of the Smart Meter Libraries suite, is able to supply all the necessary software tools for rapid set-up of intelligent systems in multi service environments:. Independent software package developed by using the ANSI-C (C89) programming language, in accordance with the MISRA-C syntax rules. Object-Oriented module for organizing rough data in the server.
Scalable and modular architecture of the protocol stack. Conforms to Green Book 8.3 and Blue Book 12.2: Push Service, Compact Frame, etc. Partial data management (COSEM objects larger than the available memory can be handled). Includes definition of the more widely used OBIS codes (OBject Identification System) and offers possibility of adding their customized versions. Security Suite: AES-128, AES-192, AES-256; AES-GCM, AES-CBC, AES-CTR; CMAC, GMAC; CRC-16, CRC-32; ECDSA, ECDH, SHA256.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |