Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. DLMS Wrapper

DLMS Wrapper

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By johanlombard , 28 April, 2020
Forums
General discussion

Hi

I am using the gurux c library to read a meter profile in "DLMS_INTERFACE_TYPE_WRAPPER" mode.
I receive the first frame but the protocol don't ask for the next frame and give an error.

When I call "cl_getData" with the response I cant seem to find the code that request next frame for the wrapper mode.

My request is as follow:

DLMS_PDU[192] {** getRequest **}
GetRequest[1] {** Get-request-normal **}
GetRequestNormal Sequence
InvokeIdPriority
InvokeID (0..3): 1
ServiceClass (6): unconfirmed
Priority (7): high
CosemAttributeDescriptor Sequence {** Cosem-Attribute-Descriptor **}
CosemClassID = 7 (0x0007) {** Cosem-Class-Id **}
CosemObjectInstanceID[6] = 0100630100FF {** Cosem-Object-Instance-Id **}
CosemObjectAttributeID = 2 (0x02) {** Cosem-Object-Attribute-Id **}
Optional Flag = True
SelectiveAccessDescriptor Sequence {** Access-Selection **}
Unsigned8 = 1 (0x01) {** access-selector **}
Data access-parameters[2] {** Structure **}
SequenceOf 4 Element(s)
0: Data[2] {** Structure **}
SequenceOf 4 Element(s)
0: [18] Unsigned16 = 8 (0x0008)
1: [9] OctetString[6] = 0000010000FF
2: [15] Integer8 = 2 (0x02)
3: [18] Unsigned16 = 0 (0x0000)
1: [9] OctetString[12] = 07E4041805000000FFFF8800 (24.04.2020 00:00:00)
2: [9] OctetString[12] = 07E4041C02091E00FFFF8800 (28.04.2020 09:30:00)
3: Data[1] {** Array **}
SequenceOf 0 Element(s)

This is the decoded received bytes:
DLMS_PDU[196] {** GetResponse **}
GetResponse[2] {** Get-response-with-datablock **}
GetResponseWithDataBlock Sequence
InvokeIdPriority
InvokeID (0..3): 1
ServiceClass (6): unconfirmed
Priority (7): high
DataBlock_G Sequence Result
Boolean = False {** Last-Block **}
Unsigned32 = 1 (0x00000001) {** Block-number **}
Result[0] {** raw-data **}

Can you maybe direct me what I am doing wrong?

Thanks
Johan

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi Johan,

Hi Johan,

Can you paste raw data?

BR,
Mikko

johanlombard

6 years 1 month ago

Hi this is the raw data:

Hi this is the raw data:

[2020-04-28 12:48:14][MOL0000020191015][6] Send Frame
00 01 00 50 00 01 00 40 C0 01 81 00 07 01 00 63
01 00 FF 02 01 01 02 04 02 04 12 00 08 09 06 00
00 01 00 00 FF 0F 02 12 00 00 09 0C 07 E4 04 18
05 00 00 00 FF FF 88 00 09 0C 07 E4 04 1C 02 0C
1E 00 FF FF 88 00 01 00

[2020-04-28 12:48:16][MOL0000020191015][6] Receive Frame
00 01 00 01 00 50 03 FF C4 02 81 00 00 00 00 01
00 82 03 F3 01 81 C0 02 1E 12 00 0C 09 0C 07 E4
04 17 04 15 00 00 FF 80 00 00 06 00 00 00 00 06
00 00 00 00 06 00 00 00 00 06 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 02 1E 12 00 0C 09 0C 07 E4 04
17 04 15 1E 00 FF 80 00 00 06 00 00 00 00 06 00
00 00 00 06 00 00 00 00 06 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 02 1E 12 00 0C 09 0C 07 E4 04 17
04 16 00 00 FF 80 00 00 06 00 00 00 00 06 00 00
00 00 06 00 00 00 00 06 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 02 1E 12 00 0C 09 0C 07 E4 04 17 04
16 1E 00 FF 80 00 00 06 00 00 00 00 06 00 00 00
00 06 00 00 00 00 06 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 02 1E 12 00 0C 09 0C 07 E4 04 17 04 17
00 00 FF 80 00 00 06 00 00 00 00 06 00 00 00 00
06 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 02 1E 12 00 0C 09 0C 07 E4 04 17 04 17 1E
00 FF 80 00 00 06 00 00 00 00 06 00 00 00 00 06
00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 02 1E 12 00 0C 09 0C 07 E4 04 18 05 00 00 00
FF 80 00 00 06 00 00 00 00 06 00 00 00 00 06 00
00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 1E 12 00 0C 09 0C 07 E4 04 18 05 00 1E 00 FF
80 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00
00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02
1E 12 00 0C 09 0C 07 E4 04 18 05 01 00 00 FF 80
00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00
00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 1E
12 00 0C 09 0C 07 E4 04 18 05 01 1E 00 FF 80 00
00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00
06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 02 1E 12
00 0C 09 0C 07 E4 04 18 05 02 00 00 FF 80 00 00
06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 02 1E 12 00
0C 09 0C 07 E4 04 18 05 02 1E 00 FF 80 00 00 06
00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 02 1E 12 00 0C
09 0C 07 E4 04 18 05 03 00 00 FF 80 00 00 06 00
00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 02 1E 12 00 0C 09
0C 07 E4 04 18 05 03 1E 00 FF 80 00 00 06 00 00
00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 02 1E 12 00 0C 09 0C
07 E4 04 18 05 04 00 00 FF 80 00 00 06 00 00 00
00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 02 1E 12 00 0C 09 0C 07
E4 04 18 05 04 1E 00 FF 80 00 00 06 00 00 00 00
06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,
It looks good. Have you read the capture object (attribute index 3) before reading data?
Can you send log from that also so I can test this with a meter simulator?

BR,
Mikko

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,

Can you use malloc?

BR,
Mikko

johanlombard

6 years 1 month ago

Hi

Hi

I can quickly add the capture object method and give you feedback on the result.
Yes I can use malloc.

johanlombard

6 years 1 month ago

Just to give you a bit of

Just to give you a bit of background, I am trying to read a data concentrator that uses PLC to talk to the meter network, the DCU comminicate G3 with the DLMS wrapper to the main server. I have managed to login to the DCU and read the serial, datetime and the meters it discovered on the PLC network successfully. I am just now stuck with the genericLoadProfile object from the DCU to read the meter data it collected.

johanlombard

6 years 1 month ago

capture object (attribute

capture object (attribute index 3) result:
00 01 00 01 00 50 02 22 C4 01 81 00 01 1E 02 04
12 00 01 09 06 00 00 80 32 06 FF 0F 00 12 00 00
02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12
00 00 02 04 12 00 03 09 06 01 00 01 08 00 FF 0F
02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 00
FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 03
08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01
00 04 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09
06 01 00 09 08 00 FF 0F 02 12 00 00 02 04 12 00
03 09 06 01 00 0A 08 00 FF 0F 02 12 00 00 02 04
12 00 03 09 06 01 00 0F 08 00 FF 0F 02 12 00 00
02 04 12 00 03 09 06 01 00 83 08 00 FF 0F 02 12
00 00 02 04 12 00 03 09 06 01 00 84 08 00 FF 0F
02 12 00 00 02 04 12 00 03 09 06 01 00 01 1D 00
FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02
1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01
00 0F 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09
06 01 00 03 1D 00 FF 0F 02 12 00 00 02 04 12 00
03 09 06 01 00 04 1D 00 FF 0F 02 12 00 00 02 04
12 00 03 09 06 01 00 83 1D 00 FF 0F 02 12 00 00
02 04 12 00 03 09 06 01 00 09 1D 00 FF 0F 02 12
00 00 02 04 12 00 03 09 06 01 00 0A 1D 00 FF 0F
02 12 00 00 02 04 12 00 03 09 06 01 00 84 1D 00
FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 5E
5C 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01
00 0F 05 00 FF 0F 02 12 00 00 02 04 12 00 04 09
06 01 00 01 05 00 FF 0F 02 12 00 00 02 04 12 00
04 09 06 01 00 02 05 00 FF 0F 02 12 00 00 02 04
12 00 04 09 06 01 00 83 05 00 FF 0F 02 12 00 00
02 04 12 00 04 09 06 01 00 03 05 00 FF 0F 02 12
00 00 02 04 12 00 04 09 06 01 00 04 05 00 FF 0F
02 12 00 00 02 04 12 00 04 09 06 01 00 09 05 00
FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 0A
05 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01
00 84 05 00 FF 0F 02 12 00 00

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,

There is more data to read. There are 192 rows. This is the first block. You need to ask the next block using cl_receiverReady.

BR,
Mikko

johanlombard

6 years 1 month ago

I prototyped "readDLMSPacket"

I prototyped "readDLMSPacket" and inside the function it calls:

ret = cl_getData(&connection->settings, &connection->data, reply);
if (ret != 0 && ret != DLMS_ERROR_CODE_FALSE)
{
break;
}

This gives an error and don't request the next block.

"cl_getData" calls "getData2" and inside getdata2 I see a next frame request for HDLC but not for the wrapper, or am I doing it wrong maybe. ?

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,

There is a GuruxDLMSClientExample. Can you run it? Parameters are something like:
-h METER_IP_ADDRESS -p METER_PORT_NUMBER -c 80 -w -t Verbose a- AUTHENTICATION_LEVEL -P PASSSWORD

It reads all the data from the meter and it'll take some time.

BR,
Mikko

johanlombard

6 years 1 month ago

Thanks let me try that first.

Thanks let me try that first.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin