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. Node
  3. 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

6 months 4 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

  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
  • HDLC Frames sequencing
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin