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. Writing Profile Generic Capture Objects

Writing profile generic capture objects

By KSergeyP , 11 June, 2023
Forums
General discussion

How can I write attribute 3 of generic profile using GuruxDLMS.c. Is there an example? I only found reading examples.
I used com_write, but with a sufficiently large number of objects, when the package is divided into several blocks, I get an error. If the data is placed in one block, then the recording completes successfully. It looks like there are problems with block transfer.

KSergeyP

3 years 1 month ago

Thus GXDLMSDirector writes…

Thus GXDLMSDirector writes correctly. GuruxDLMS.c adds an attributeDescriptor to each block, while GXDLMSDirector only adds this data in the first block
Green Book: "The COSEM_Attribute_Descriptor parameter references a COSEM object attribute. It is present when Request_Type == NORMAL, FIRST-BLOCK, WITH-LIST and FIRST-BLOCK-WITH-LIST"
GuruxDLMS.c adds attributeDescriptor for LAST-BLOCK

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, Is your meter using…

Hi,

Is your meter using General Block Transfer?
Let me know this. I'll check this and let you know what happens after you have shared this information with me.

BR,
Mikko

KSergeyP

3 years 1 month ago

Good day, Yes the meter uses…

Good day,
Yes the meter uses General Block Transfer.
I added "if" in two functions. After that, the writing is successful. But I'm not 100% sure that my fix is correct

1. dlms_multipleBlocks:
void dlms_multipleBlocks(gxLNParameters *p, gxByteBuffer *reply, unsigned char ciphering)
{
// Check is all data fit to one message if data is given.
int len = bb_available(p->data);
if (p->attributeDescriptor != NULL)
{
if (!(p->command == DLMS_COMMAND_SET_REQUEST && p->requestType == DLMS_SET_COMMAND_TYPE_WITH_DATABLOCK))
{
len += p->attributeDescriptor->size;
}
}

2. dlms_getLNPdu
// Add attribute descriptor.
#ifndef DLMS_IGNORE_MALLOC
// Add attribute descriptor.
if (ret == 0 && p->attributeDescriptor != NULL)
{
if (!(p->command == DLMS_COMMAND_SET_REQUEST && p->requestType == DLMS_SET_COMMAND_TYPE_WITH_DATABLOCK))
{
ret = bb_set(reply, p->attributeDescriptor->data, p->attributeDescriptor->size);
}
}
#endif //DLMS_IGNORE_MALLOC

  • 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

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin