Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. Not Able To Read Rows By Range

Not able to read rows by range

By ParthDesai, 23 July, 2024
Forums
General discussion

Hello,

I am not able to read rows by range using C.

int ret;
unsigned char logical_name[6];
gxtime startTime;
gxtime endTime;
gxProfileGeneric bufferDataByDateTimeRange;
time_init3(&startTime, 2024, 07, 23, 19, 0, 0, 0);
time_init3(&endTime, 2024, 07, 23, 19, 30, 0, 0);
ret = com_open(connection, port);
printf("Error (If Any): %s\n", hlp_getErrorMessage(ret));
ret = com_initializeConnection(connection);
printf("Error (If Any): %s\n", hlp_getErrorMessage(ret));
hlp_setLogicalName(logical_name, "1.0.99.1.0.255");
cosem_init2((gxObject*)&bufferDataByDateTimeRange, DLMS_OBJECT_TYPE_PROFILE_GENERIC, logical_name);
ret = com_read(connection, (gxObject*)&bufferDataByDateTimeRange, 3);
printf("Error (If Any): %s\n", hlp_getErrorMessage(ret));
ret = com_getAssociationView(connection, outputFile);
ret = com_readRowsByRange(connection, &bufferDataByDateTimeRange, &startTime.value, &endTime.value);

printf("Error (If Any): %s\n", hlp_getErrorMessage(ret));
printf("ReadRowsByRange: %d\n", ret);
com_close(connection);
con_close(connection);

root@SP1002:~/GuruxDLMS.c-master/GuruxDLMSClientExample/bin# sudo ./gurux.dlms.client.bin -S /dev/ttyO5 -c 32 -s 1 -a Low -P lnt1 -t Verbose -g "1.0.99.1.0.255:2"
Error (If Any): OK
InitializeConnection

TX: 7E A0 07 03 41 93 5A 64 7E

RX: 7E A0 1E 41 03 73 8E 7F 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E

TX: 7E A0 40 03 41 10 5F 93 E6 E6 00 60 32 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 06 80 04 6C 6E 74 31 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 1D FF FF 1B E5 7E

RX: 7E A0 37 41 03 30 21 79 E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 04 00 00 07 06 94 7E
Error (If Any): OK

TX: 7E A0 19 03 41 32 3A BD E6 E6 00 C0 01 C1 00 07 01 00 63 01 00 FF 03 00 8C 90 7E

RX: 7E A8 89 41 03 52 CB AC E6 E7 00 C4 01 C1 00 01 13 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 0E 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 20 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 34 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 48 1B 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 10 1D 7E C2 7E

TX: 7E A0 07 03 41 51 44 81 7E

RX: 7E A8 89 41 03 54 FD C9 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 05 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 06 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 07 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 08 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 9A DA 7E

TX: 7E A0 07 03 41 71 46 A0 7E

RX: 7E A0 68 41 03 56 FE 18 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 1F 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 33 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 47 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 5E 5B 01 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 5E 5B 02 FF 0F 02 12 00 00 3A 3F 7E
Error (If Any): OK

TX: 7E A0 4C 03 41 94 47 C6 E6 E6 00 C0 01 C1 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 E8 07 15 07 00 00 00 00 00 00 00 09 0C 07 E8 07 15 07 0A 27 24 00 00 00 00 01 00 A9 5F 7E

Data send failed. Try to resend 1/3

Data send failed. Try to resend 2/3

Data send failed. Try to resend 3/3

ReadObject failed Data receive failed.
Error (If Any): Data receive failed.
ReadRowsByRange: 253

TX: 7E A0 11 03 41 B6 CE 9A E6 E6 00 62 03 80 01 00 BD 9B 7E

RX: 7E A0 07 41 03 51 5C 47 7E

TX: 7E A0 07 03 41 53 56 A2 7E

RX: 7E A0 1E 41 03 73 8E 7F 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Data receive failed.

Profile picture for user Kurumi

Kurumi

1 year 7 months ago

Hi, Check what time zone…

Hi,

Check what time zone your meter is using. Some meters expect that the time zone is the same when readRowsByRange is used.

Try to read the meter with GXDLMSDirector first. Some meters don't implement read-by range at all.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 02/19/2026 - 11:51
    gurux.dlms.cpp 9.0.2602.1901
  • Sun, 02/01/2026 - 19:47
    gurux.dlms.cpp 9.0.2602.0101
  • Tue, 01/20/2026 - 10:38
    gurux.dlms.java 4.0.89
  • Wed, 01/14/2026 - 14:29
    Gurux.DLMS.Python 1.0.196
  • Mon, 12/29/2025 - 10:38
    Gurux.Serial.Android 3.0.5

New forum topics

  • Help with connection and read with landis+gyr e650 + CU-E22 using python
  • Preestablished connection
  • RJ11 to RS232 Pin out SECURE Premier 300
  • GENUS sugam 3 PH bidirectional
  • Electricity smart Meter DLMS firmware stack
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin