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 10 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 6 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • gurux_dlms.GXDateTime.GXDateTime object Error in Python
  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin