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
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
Hi, Is there any update…
Hi,
Is there any update regarding this kind of object?
Best,
Pablo