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. Node
  3. DLMS Server - Profile Generic - Can't Add Too Many Items To Profile Generic Capture Object - How To Set Maximum Profile Entries

DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries

Profile picture for user jack 001
By jack 001 , 25 September, 2026
Forums
Gurux DLMS for ANSI C

Hi, i'm trying to make dlms server. i have a piece of code below for adding Instanttaneous Profile Generic:


void addCaptureObject(gxProfileGeneric *pg, gxObject *obj, unsigned char attrIndex)
{
    gxTarget *capture;
    capture = (gxTarget *)malloc(sizeof(gxTarget));
    capture->attributeIndex = attrIndex;
    capture->dataIndex = 0;
    arr_push(&pg->captureObjects, key_init(obj, capture));
}

///////////////////////////////////////////////////////////////////////
// Add profile generic - instant profile object.
///////////////////////////////////////////////////////////////////////
int addInstantProfileProfileGeneric(dlmsSettings *settings)
{
   int ret;
   const unsigned char ln[6] = {1, 96, 98, 128, 0, 255};
   if ((ret = INIT_OBJECT(instantProfile, DLMS_OBJECT_TYPE_PROFILE_GENERIC, ln)) == 0)
   {
       instantProfile.sortMethod = DLMS_SORT_METHOD_FIFO;
       gxTarget *capture;
       addCaptureObject(&instantProfile, BASE(clock1), 2);
       addCaptureObject(&instantProfile, BASE(ecuId), 2);
       addCaptureObject(&instantProfile, BASE(reg_volt_R_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_volt_S_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_volt_T_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_curr_R_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_curr_S_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_curr_T_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_curr_N_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_pf_R_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_pf_S_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_pf_T_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_pf_all_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_uu_RR_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_uu_SR_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_uu_TR_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_iu_RR_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_iu_SS_LN), 2);
       addCaptureObject(&instantProfile, BASE(reg_ang_iu_TT_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_ang_iu_NR_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_app_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_app_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_app_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_app_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_app_power_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_app_power_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_app_power_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_app_power_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_energy_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_energy_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_energy_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_act_energy_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_energy_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_energy_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_energy_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_act_energy_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_energy_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_energy_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_energy_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_exp_react_energy_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_energy_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_energy_S_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_energy_T_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_imp_react_energy_all_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_freq_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_curr_thd_R_LN), 2);
       // addCaptureObject(&instantProfile, BASE(reg_curr_tdd_R_LN), 2);
       
       printf("instant profile object count : %u\n", (unsigned int)instantProfile.captureObjects.size);

       instantProfile.sortObject = BASE(clock1);
       instantProfile.sortObjectAttributeIndex = 2;
       setProfileGenericEntries(&instantProfile, INSTANT_PROFILE_MAX_ENTRIES);
       instantProfile.capturePeriod = 0;
   }
   return 0;
}

I use GuruxDLMSServerExample as base, then extending it to my needs. as you can see there are many objects that are commented for this profile. if i uncomment it, the capture object failed to load and show nothing when i refresh the profile. how to work around this? 
 

And also, how to set maximum entries allowed for some profile? some profile need to contains thousands of data, e.g Load Profile, while some profiles like alarm and event only need to store max 100 entries.

 
Thank you
jack

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701

New forum topics

  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
  • HDLC Frames sequencing
  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin