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. Reading All "Data" Object Type Parameter Together

Reading all "Data" object type parameter together

By riteshP, 22 May, 2025
Forums
Gurux DLMS for ANSI C

Hi,

I can able to read individual Data type object. Using following methods.
Client.init(true, 32, 1, DLMS_AUTHENTICATION_LOW, "xxxx", DLMS_INTERFACE_TYPE_HDLC);

cosem_init(BASE(ldn), DLMS_OBJECT_TYPE_DATA, "0.0.42.0.0.255");
com_read(BASE(ldn), 2);

My Energy Meter has > 20 Data objects, All the objects i am able to read the values individually.
I want to read all DLMS_OBJECT_TYPE_DATA types available in a meter together instead of reading individual OBIS code.
How to read that in single read instead of multiple com_read?

Profile picture for user Kurumi

Kurumi

3 weeks 4 days ago

Hi, You can use ReadList for…

Hi,

You can use ReadList for that. The meter's memory capacity is limited, so you may need to perform multiple reads.

BR,
Mikko

riteshP

3 weeks 4 days ago

Hi Kurumi, Thanks for the…

Hi Kurumi,

Thanks for the Reply.

I am using following code to read 2 OBIS code using "com_readList"
I am getting no error. Seems like it's reading the data.
How to print the read data and clock value?

objectArray objects;
gxArray list;
gxClock clock1;
gxData ldn;

cosem_init(BASE(ldn), DLMS_OBJECT_TYPE_DATA, "0.0.0.1.0.255");
cosem_init(BASE(clock1), DLMS_OBJECT_TYPE_DATA, "0.0.1.0.0.255");

oa_init(&objects);
arr_init(&list);
arr_push(&list, key_init(&ldn, (void*)2));
arr_push(&list, key_init(&clock1, (void*)2));

com_readList(&list);

Profile picture for user Kurumi

Kurumi

3 weeks 1 day ago

Hi, The data type and OBIS…

Hi,

The data type and OBIS code must be correct, or meter returns an error.

cosem_init(BASE(ldn), DLMS_OBJECT_TYPE_DATA, "CHANGE OBIS CODE");
cosem_init(BASE(clock1), DLMS_OBJECT_TYPE_CLOCK, "0.0.1.0.0.255");

You can convert object attributes to string like this:

obj_toString(BASE(clock1), buff);

BR,
Mikko

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/17/2025 - 13:03
    Gurux.DLMS.Python 1.0.182
  • Wed, 06/04/2025 - 13:35
    gurux.dlms.c 9.0.2506.0401
  • Fri, 05/30/2025 - 08:30
    gurux.dlms.c 9.0.2505.3001
  • Tue, 05/27/2025 - 08:10
    Gurux.Serial.Android 2.0.12
  • Mon, 05/26/2025 - 08:39
    gurux.dlms.c 9.0.2505.2601

New forum topics

  • Day profile action item add error (String is not recognized as valid DateTime value)
  • Create gateway protocol in c
  • Error while reading event log object
  • GXDLMS Simulator – AssociationLogicalName Not Listed
  • Failed to read meter through raspberry pi 5 and probe
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin