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. Forums
  3. DLMS Client C Code

DLMS client C code

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By ajmal , 5 February, 2020
Forums
Gurux.DLMS

Hi,

I'm working on TI - MSP 432. i am toltaly new to DLMS protocol, i took
Arduino client code from gurux library and i ported serial communication to
MSP 432. Now i can able to read the DLMS_OBJECT_TYPE_REGISTER values.

bb_init(&frameData);
//Set frame size.
bb_capacity(&frameData, 128);
cl_init(&meterSettings,1,32,1,DLMS_AUTHENTICATION_LOW,"lnt1",
DLMS_INTERFACE_TYPE_HDLC);
cosem_init(&reg_value.base, DLMS_OBJECT_TYPE_REGISTER, "1.0.14.7.0.255");

gxRegister reg_value;
if(com_read(&reg_value.base, 2) == DLMS_ERROR_CODE_OK)
{
Reg_value = reg_value.value.lVal;
}

But i dont know how to read DLMS_OBJECT_TYPE_DATA and
DLMS_OBJECT_TYPE_PROFILE_GENERIC,

please help me in this, How to read both data.

Thanks & regards
Ajmal

Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi,

Hi,

Check GuruxDLMSClientExample. That reads the association view from the meter and reads all the data.

You can read all objects in the same way as register.

gxData data;
int ret;
const unsigned char ln[6] = { 1,1,21,25,0,255 };
if ((ret = INIT_OBJECT(data, DLMS_OBJECT_TYPE_DATA, ln)) == 0)
{
if(com_read(BASE(data), 2) == DLMS_ERROR_CODE_OK)
{
}
}

BR,
Mikko

ajmal

6 years 4 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks for your valuable reply, now i can able to read DLMS_OBJECT_TYPE_DATA . can you please help me how to read DLMS_OBJECT_TYPE_PROFILE_GENERIC.

Thanks & Regards
Ajmal

Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi Ajmal,

Hi Ajmal,

There are several ways to read profile generic. Check GuruxDLMSClientExample. It'll read historical data by range and entry.

BR,
Mikko

ajmal

6 years 4 months ago

In reply to Hi Ajmal, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks, i tried to use GuruxDLMSClientExample code, on that i am not getting any data. For me Gurux arduino example code is working fine. Can please help me how to read profile generic in Gurux arduino example code. I tried to called this function " com_readProfileGenerics(); " still it is not working, i dont know how to use where i will get the data, please help me in this.

Thanks & Regards
Ajmal

Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi,

Hi,

Can you try to read your meter with GXDLMSDirector? Make sure that you can read same profile generic that you try to read. Let me know what happened.

BR,
Mikko

ajmal

6 years 4 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Yes I can able to receive data from GXDLMSDirector. i just called the function "com_readProfileGenerics" i don't know what changes to be done in the function.

when i call the function it is not entering into the For loop, please find the attached screenshot

Thanks & Regards
Ajmal

Image
Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi Ajmal,

Hi Ajmal,

Did you read capture columns first (attribute index 3)?
What OBIS code you try to read?

BR,
Mikko

ajmal

6 years 4 months ago

In reply to Hi Ajmal, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks for your replay. Yes, i am calling the function still i am facing the same problem. please check this is the correct way to call the function

gxProfileGeneric profile_g;

cosem_init(&profile_g.base, DLMS_OBJECT_TYPE_PROFILE_GENERIC,"0.0.99.98.0.255");
com_readProfileGenericColumns();
com_readProfileGenerics();

After calling this function in which structure i will get the data.

Thanks & Regards
Ajmal

Image

ajmal

6 years 4 months ago

Hi Mikko,

Hi Mikko,

Need any permission to read Profile Generic

gxProfileGeneric profile_g;

cosem_init(&profile_g.base, DLMS_OBJECT_TYPE_PROFILE_GENERIC,"0.0.99.98.0.255");
com_readProfileGenericColumns();
com_readProfileGenerics();

Thanks & Regards
Ajmal

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin