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. Com_read() Returns OK(0) But Instantaneous Profile Response Contains Empty Values

com_read() returns OK(0) but Instantaneous Profile response contains empty values

By mightyChamp , 13 March, 2026
Forums
Gurux DLMS for ANSI C

We are reading Instantaneous Profile data from a DLMS meter using the Gurux library.

Normally the read works correctly and all values are returned as expected. However, sometimes we receive the following response:

Index: 2 Value: [ ]
Index: 3 Value: [Clock 0.0.1.0.0.255, Register 1.0.31.7.0.255, Register 1.0.51.7.0.255, Register 1.0.71.7.0.255, Register 1.0.32.7.0.255, Register 1.0.52.7.0.255, Register 1.0.72.7.0.255, Register 1.0.33.7.0.255, Register 1.0.53.7.0.255, Register 1.0.73.7.0.255, Register 1.0.13.7.0.255, Register 1.0.14.7.0.255, Register 1.0.9.7.0.255, Register 1.0.1.7.0.255, Register 1.0.3.7.0.255, Data 0.0.96.7.0.255, Register 0.0.94.91.8.255, Data 0.0.94.91.0.255, Data 0.0.0.1.0.255, Data 0.0.96.2.0.255, Register 0.0.0.1.2.255, Register 1.0.1.8.0.255, Register 1.0.5.8.0.255, Register 1.0.8.8.0.255, Register 1.0.9.8.0.255, ExtendedRegister 1.0.1.6.0.255, ExtendedRegister 1.0.1.6.0.255, ExtendedRegister 1.0.9.6.0.255, ExtendedRegister 1.0.9.6.0.255, Register 1.0.36.7.0.255, Register 1.0.56.7.0.255, Register 1.0.76.7.0.255, Register 1.0.128.7.65.255, Register 1.0.128.7.68.255, Register 1.0.128.7.66.255, Register 1.0.128.7.67.255, Register 1.0.128.7.38.255, Register 1.0.128.7.39.255, Register 1.0.128.7.40.255, Register 1.0.128.7.53.255, Register 1.0.128.7.54.255, Register 1.0.128.7.55.255, Register 1.0.128.7.35.255, Register 1.0.128.7.36.255, Register 1.0.128.7.37.255, Register 1.0.128.8.39.255, Register 1.0.128.8.23.255, Register 1.0.128.8.25.255, Register 1.0.128.8.24.255, Register 1.0.128.8.27.255, Register 1.0.128.8.26.255, Register 1.0.128.8.29.255, Register 1.0.128.8.28.255, Register 1.0.128.8.34.255, Data 1.0.128.7.41.255, Data 1.0.128.7.45.255, Data 1.0.128.7.46.255, Data 1.0.128.7.52.255, Data 1.0.128.7.42.255, Data 1.0.128.7.48.255, Data 1.0.128.7.47.255, Data 1.0.128.7.51.255, Data 1.0.128.7.50.255, Data 1.0.128.7.44.255, Data 1.0.128.7.43.255, Data 1.0.128.7.49.255]

Index: 4 Value: 0
Index: 5 Value: 0
Index: 6 Value:
Index: 7 Value: 0
Index: 8 Value: 0
 

The read call used is:

com_read(&pg,1);
ret3= com_read(&pg,3);
com_read(&pg,4);
com_read(&pg,5);
com_read(&pg,6);
com_read(&pg,7);
com_read(&pg,8);

ret2 = com_read(&pg, 2);
 

In this case, ret2 is still 0, which normally indicates that the response is valid.

However, as seen above:

> Index 2 (data buffer) is empty

> Other values appear incomplete

 

Questions:

> Why does the Gurux library return ret = 0 even when the data block is empty or incomplete?

> Is there an internal condition where the library considers this a valid DLMS response?

> What is the recommended way to detect and handle this situation programmatically?

> Should we manually validate the returned data length or structure after com_read()?

 

Additional Notes:

> This issue occurs intermittently, not always.

> When it occurs, re-reading the profile usually returns correct data.

> Any guidance on detecting or handling this condition correctly would be appreciated.

Profile picture for user Kurumi

Kurumi

3 months 3 weeks ago

Hi, No errors are returned…

Hi,

No errors are returned if the return value is zero. I believe that the meter is returning empty data for some reason. You need to verify this from the hex trace.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin