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 Data From Data Object Type Array

Read data from Data object type Array

By KostaG , 18 July, 2024
Forums
General discussion

Hi,

I am having trouble trying to decode, from client-side, a Data object with Array type. I managed to read the Data object but I don't know how to retrieve it's values. Can you help me with this problem?

Thank you,
BR.

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi,1 You didn't tell what…

Hi,

You didn't tell what programming language you are using, but it's already converted from bytes to variant values.

You can loop the array something like this:

GXDLMSData data = new GXDLMSData();
//Read the value.
foreach(var it in (GXArray) data.Value)
{
//Print value.
}

BR,
Mikko

KostaG

2 years 2 months ago

Sorry, I forgot about the…

Sorry, I forgot about the language. I'm programming in ANSI C. I do the following in server-side to store the data in the GXArray in the preRead method:

e->value.vt = DLMS_DATA_TYPE_OCTET_STRING;
e->byteArray = 1;
e->handled = 1;
e->skipMaxPduSize = 1;

bb_setUInt8(e->value.byteArr, DLMS_DATA_TYPE_ARRAY);
hlp_setObjectCount(25 * 2, e->value.byteArr);
for (uint16_t i = 0; i < 25; i++) {
bb_setUInt8(e->value.byteArr, DLMS_DATA_TYPE_FLOAT32);
bb_setFloat(e->value.byteArr, data_buffer[i]);
}

I checked using GXDLMSDIrector that I'm writing correctly the data values to the Array. I tried what you proposed but it's not working.

Any ideas of what could be the problem here?

BR.

KostaG

2 years 2 months ago

Hi, I just managed to read…

Hi,

I just managed to read the value correctly.
Anyways, thank you for the help.

BR.

  • 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

  • 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
  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin