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. GXDLMSData: Specify Class Id and Attribute Id

GXDLMSData: specify class id and attribute id

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 Swappage , 6 January, 2018
Forums
Gurux.DLMS

Hello everyone,
sorry if this might sound dumb, i'm taking my first steps into DLMS and with this library in particular.

I'm trying to read some informations from my meter device, but while coding my simple app i'm figuring out i cant find a way to set some specific values.

here is how, for instance, i'm reading the LDN.
GXDLMSData ldn = new GXDLMSData("0.0.42.0.0.255");
DataType dt = DataType.OctetString;

ldn.SetDataType(2, dt);
reader.Read(ldn, 2);

where reader is an instance of GXDLMSReader

this generatess an APDU that is correctly understhood by my meter:
C0 01 C1 00 01 00 00 2A 00 00 FF 02 00
which translates in the XML:

<GetRequest>
<GetRequestNormal>
<InvokeIdAndPriority Value="C1" />
<AttributeDescriptor>
<!--DATA-->
<ClassId Value="0001" />
<!--0.0.42.0.0.255-->
<InstanceId Value="00002A0000FF" />
<AttributeId Value="02" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>

the problem is when i have to read something that has a different classID and possibly attributeID values.
how do i create, from code, a PDU like this?

C0 01 C1 00 44 00 00 19 04 00 FF 05 00

this is derived from the following XML

<GetRequest>
<GetRequestNormal>
<InvokeIdAndPriority Value="C1" />
<AttributeDescriptor>
<!--DATA-->
<ClassId Value="44" />
<!--0.0.25.3.0.255-->
<InstanceId Value="0000190400FF" />
<AttributeId Value="05" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>

thanks for your kind reply.

Also: is there any example of using Gurux DLMS to perform a SET request?

rohitmehra027

8 years 5 months ago

integrating actaris Meter getting Issue.

i got stuck at get profile generic coloumns...

what might be the reason.

app got hangged cant able to view the logs even.

Rohit.

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

Hi Swappage,

Hi Swappage,

What programming language you want to use? If you are planning to parse bytes by your self, I strongly recommend that think again. :-) DLMS is very complicated protocol. I believe that you can read simple data objects quite fast, but complex data where data is split into multiple PDUs and ciphered is taking time.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

In reply to integrating actaris Meter getting Issue. by rohitmehra027

integrating actaris Meter getting Issue

Hi Rohit,
Please, create a new topic if you have the new question.

Are you using GXDLMSDirector or client example?

BR,
Mikko

Swappage

8 years 5 months ago

Hi,

Hi,

i'm using c#.

I don't need to read bytes by myself, but i need to access specific informations from the meter, and i need to figure out how to do that using gurux DLMS c# library.

according to my knowledge (which might be wrong) different informations are described by an OBIS identifier, a class ID and an attribute id.

i have the XML, how can i make a request to the meter?

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

Reading the meter.

Hi Swappage,

Download GXDLMSDirector and use that to study your meter. Each meter must implement association view. Association view tells what kind of functionality meter is offering (Left side of GXDLMSDirector under the meter).

After you can read your meter with GXDLMSDirector study Gurux.DLMS.Client.Example.Net or Gurux.DLMS.XmlClient to read data what you want from the meter.

BR,

Mikko

Swappage

8 years 5 months ago

Hi Mikko, thanks for your

Hi Mikko, thanks for your kind reply, i cant use the director because it's a GPRS device.

In fact i'm using the example from the github repository as a starting point for my code.

I can get the device to connect and i can read certain informations like (as said), LDN, but i cant figure out how to read properties that have a different class id

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

Reading the meter

Hi Swappage,

You need to create the object and then read it like data object.
Something like this:

GXDLMSClock cl = new GXDLMSClock();
client.Read(cl, 2);

BR,

Mikko

Swappage

8 years 4 months ago

Hi, sorry for the so late

Hi, sorry for the so late reply.

I'm still grasping on it :)

I've noticed that there are a bunch of objects that are ready to use, like clock, as you suggested.

But is there a way to create a custom object?

  • 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