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

2 years 12 months 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

2 years 12 months 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

2 years 11 months 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

  • 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