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. Creating LN Constructor of CGXDLMSObject Class

Creating LN constructor of CGXDLMSObject class

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 Leila , 2 March, 2016
Forums
Gurux.DLMS

Hi,
I am going to read active energy from a meter. As I am working based on logical name referencing, So I found that I need a LN constructor of CGXDLMSObject class as the input of GXClient::Read function. But I do not know how to set ln variable for CGXDLMSObject(). Could you help me?
Generally, how can I get normal request for active energy and then decode the response?
Thanks in advance.

Leila

10 years 3 months ago

The source used

I used below source, however it sends zero to the meter instead of OBIS code.
char *cstr1 = "0101010800FF";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);

Profile picture for user Kurumi

Kurumi

10 years 3 months ago

Logican name referencing

Hi,

You should give OBIS code as dot notation.
Something like:
"1.1.1.8.0.255"

BR,

Mikko

Leila

10 years 3 months ago

Fill logical name variable

Hi,

Thank you for your kind response.
I changed my code as below, but the meter yet sends zero as Instance Id.
Could you help me? What's wrong with my source code?
char *cstr1 = "1.1.1.8.0.255";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);

Best regards,

Leila

10 years 3 months ago

Fill logical name variable

Hi again,

I changed the code as below:

CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, "1.1.1.8.0.255");
comm.Read(&pObject, 2, value);

and then I got the result.

Thank you.

Profile picture for user Kurumi

Kurumi

10 years 2 months ago

Fill logical name variable

Hi,

You should start to use New API for ANSI C++.
It's faster and and we have made several improvements.

You can read more here:
http://www.gurux.fi/newAPI

BR,

Mikko

  • 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