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. Read Single Row From ProfileGeneric

Read single row from ProfileGeneric

Profile picture for user Dmitry
By Dmitry , 25 July, 2023
Forums
Gurux.DLMS

Hi, Mikko!

I try read single row from ProfileGeneriv Table.
I do this:
int from_row_index = 0;
int count_rows_to_read = 1;
if(int ret = gcl->ReadRowsByEntry(p, from_row_index, count_rows_to_read, data) != 0)
{
qDebug().nospace() << "Failed generate message for read profile generic object " << obj->GetName().ToString().c_str() << " Error: " << CGXDLMSConverter::GetErrorMessage(ret);
}
else
{
qDebug() << "Request" << USPD_Helper::request_to_str(info);
send_data(data);
}

In this request i try read first row from table but read all rows instead.
Generated message:
7ea02d020161da580de6e600c001c100070000636200ff02010202040600000000060000000012000112000004237e

I think problem in CGXDLMSClient::ReadRowsByEntry():

// Add Count
if (count == 0)
{
tmp = count;
}
else
{
tmp = index + count - 1; // is it OK?
}

if i change to "tmp = index + count;" i recieve single row.

Thanks!

Profile picture for user Kurumi

Kurumi

3 years ago

Hi Dmitry, I'm sorry for…

Hi Dmitry,

I'm sorry for the slow reply. Summer time was causing delays.

DLMS standard says that from_row_index is one-based, not zero-based. I believe that is causing the issue.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin