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 Profile Generic Read

DLMS Profile Generic Read

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 novatricetechn… , 14 March, 2020
Forums
Gurux.DLMS

I am trying to read profile generic over Serial using ANSI C
My code is as below.

ret = com_readProfileGenericColumns();
oa_init(&objects);
ret = oa_getObjects(&settings.objects, DLMS_OBJECT_TYPE_PROFILE_GENERIC, &objects);

ret = com_read((gxObject*)pg, 3);
ret = com_read((gxObject*)pg, 2);

for(pos=0;pos!=objects.size;pos++)
{
ret = oa_getByIndex(&objects, pos, (gxObject**)&pg);
ret = com_read((gxObject*)pg, 7);
ret = com_read((gxObject*)pg, 8);
ret = com_readRowsByEntry((gxObject*)pg, 1, 1);
}

How to get All Columns and Rows values for profile generic after this?
Is this Correct sequence to read Profile generic?

for example;
OBIS Code 0.0.94.91.10.255 in profile generic,Inside that there are number of columns as below
0.0.96.1.0.255,
0.0.96.1.1.255,
1.0.0.2.0.255,
0.0.94.91.9.255,
0.0.94.91.11.255,
0.0.94.91.12.255,
1.0.0.4.2.255,
1.0.0.4.3.255,
0.0.96.1.4.255

Now,I would like to read 10 rows.
Then I want to iterate each one of them and print obis code and value on the serial port.
how to parse the data buffer for the objects ?.

Please guide me for the same.

Profile picture for user Kurumi

Kurumi

6 years 6 months ago

Hi,

Hi,

First you need to read columns.
ret = com_read((gxObject*)pg, 3);

If you want to read all the data from the PG use this:
ret = com_read(BASE(pg), 2);
If you want to read 10 rows use this:
ret = com_readRowsByEntry(BASE(pg), 1, 10);
If you want to read using start and end time use com_readRowsByRange.

Check obj_rowsToString method. It converts all columns to string.

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

Who's new

  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
  • dw772
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin