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. 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

1 year 10 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

1 year 10 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

1 year 10 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, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin