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. Compact Array Data In DLMS.C

Compact Array data in DLMS.C

By Pablo1610 , 11 July, 2023
Forums
Gurux.DLMS

Hi,

I was wondering how to build a compact array object with the C libraries.
The object it is a DLMS_OBJECT_TYPE_DATA and the value it is a compact array composed of 7 others DLMS_OBJECT_TYPE_DATA values. I think I haven't seen any example about the compact array.

Also, maybe it is enough to initialize it as an array, and then change the type to compact array, but I'm not sure about this.

This is the code now:

gxData OscWave;
gxTarget CAPTURE_OBJECT[8] = { 0 };

if((ret = INIT_OBJECT(OscWave, DLMS_OBJECT_TYPE_DATA, ln11)) == 0)
{

ARR_ATTACH(OscWave.value, CAPTURE_OBJECT, 8);
CAPTURE_OBJECT[0].target = BASE(instantVRlast);
CAPTURE_OBJECT[0].attributeIndex = 2;
CAPTURE_OBJECT[0].dataIndex = 0;
CAPTURE_OBJECT[1].target = BASE(instantIRlast);
CAPTURE_OBJECT[1].attributeIndex = 2;
CAPTURE_OBJECT[1].dataIndex = 0;
CAPTURE_OBJECT[2].target = BASE(instantVSlast);
CAPTURE_OBJECT[2].attributeIndex = 2;
CAPTURE_OBJECT[2].dataIndex = 0;
CAPTURE_OBJECT[3].target = BASE(instantISlast);
CAPTURE_OBJECT[3].attributeIndex = 2;
CAPTURE_OBJECT[3].dataIndex = 0; //todo completar este
CAPTURE_OBJECT[4].target = BASE(instantVTlast);
CAPTURE_OBJECT[4].attributeIndex = 2;
CAPTURE_OBJECT[4].dataIndex = 0;
CAPTURE_OBJECT[5].target = BASE(instantITlast);
CAPTURE_OBJECT[5].attributeIndex = 2;
CAPTURE_OBJECT[5].dataIndex = 0;
CAPTURE_OBJECT[6].target = BASE(instantINlast);
CAPTURE_OBJECT[6].attributeIndex = 2;
CAPTURE_OBJECT[6].dataIndex = 0;
CAPTURE_OBJECT[7].target = BASE(LSDigChStatus);
CAPTURE_OBJECT[7].attributeIndex = 2;
CAPTURE_OBJECT[7].dataIndex = 0;
OscWave.value.vt = DLMS_DATA_TYPE_COMPACT_ARRAY;
OscWave.capacity = 12800;
}

Thanks,
Pablo

Profile picture for user Kurumi

Kurumi

2 years 8 months ago

Hi Pablo, The compact array…

Hi Pablo,

The compact array example is not implemented for ANSI C at the moment. I'll add it to the work list. We try to implement it this week and release on next.

BR,
Mikko

Pablo1610

2 years 4 months ago

Hi, Is there any update…

Hi,

Is there any update regarding this kind of object?

Best,
Pablo

  • 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