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. A Simple Example For Reading GXDLMSProfileGeneric ?

A simple example for reading GXDLMSProfileGeneric ?

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 wikican , 15 November, 2018
Forums
Gurux.Net

Hi,
sorry for this question but I'm new in dlms.
I could read DataRegisters with your support (thank you) it is easy: Console.WriteLine(reader.Read(new GXDLMSRegister("1.1.1.8.0.255"), 2));

But if I need pervious period data, previous month data (1.8.0*1 , 1.8.0*2.. in IEC)?
I found i have to use GXDLMSProfileGeneric object (am I right?)

I read lot of document and this forum examples, but unfortunatelly I couldn't find a simple example for reading previous period data for energy registers. example 1.8.0 Positive active energy previous month not .255. How can I read it?

GXDLMSProfileGeneric pg = new GXDLMSProfileGeneric("1.1.99.1.0.255");
//Set capture period to 60 second.
pg.From = DateTimeOffset.Now.AddDays(-1);
pg.To = DateTimeOffset.Now;

var res = reader.ReadRowsByRange(pg, DateTime.Now.AddDays(-1),DateTime.Now);

with this code I could read a byte array collection. Converting that datas to real values etc..
There is any example for reading ProfileGeneric Data ( previous periods?, load profile datas... etc.)

My meter is : Kamstrup Omnipower meter.

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

You can do it like this:

GXDLMSProfileGeneric pg = new GXDLMSProfileGeneric("1.1.99.1.0.255");
//Read capture objects.
reader.read(pg, 3);

reader.ReadRowsByRange(pg, DateTime.Now.AddDays(-1), DateTime.Now);

You can get data from pg.Buffer.

BR,

Mikko

wikican

7 years 7 months ago

Thank you Mikko,

Thank you Mikko,
Formatting that buffer data, there are any method in Gurux?
or am I read some documentation?

So, in this situation; I dont know what means byte0 what means byte 1 etc..

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

If you have read the capture objects you can see actual values from the pg.Buffer.
That is not in byte array.

BR,

Mikko

wikican

7 years 7 months ago

Hi Mikko,

Hi Mikko,
I got " Invalid attribute Index " excepiton.

may I send all log data email to you?

.............
RX: 2:10:55 PM 7E A1 88 25 21 FC CF DB E6 E7 00 C4 02 C1 01 00 00 00 05 00 82 01 70 02 08 09 0C 07 E2 0B 10 05 0B 0F 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 5E 06 00 00 00 00 06 00 00 00 35 06 00 00 08 D8 02 08 09 0C 07 E2 0B 10 05 0B 1E 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 5F 06 00 00 00 00 06 00 00 00 35 06 00 00 08 D8 02 08 09 0C 07 E2 0B 10 05 0B 2D 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 60 06 00 00 00 00 06 00 00 00 35 06 00 00 08 D9 02 08 09 0C 07 E2 0B 10 05 0C 00 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 62 06 00 00 00 00 06 00 00 00 35 06 00 00 08 DA 02 08 09 0C 07 E2 0B 10 05 0C 0F 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 63 06 00 00 00 00 06 00 00 00 35 06 00 00 08 DB 02 08 09 0C 07 E2 0B 10 05 0C 1E 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 64 06 00 00 00 00 06 00 00 00 35 06 00 00 08 DC 02 08 09 0C 07 E2 0B 10 05 0C 2D 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 66 06 00 00 00 00 06 00 00 00 35 06 00 00 08 DC 02 08 09 0C 07 E2 0B 10 05 0D 00 00 FF 80 00 00 12 00 00 06 00 00 01 00 0F 01 06 00 00 4B 67 06 00 00 00 00 06 00 00 00 35 06 00 00 08 DD D7 80 7E
+
Unhandled Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Invalid attribute Index.
at Gurux.DLMS.ManufacturerSettings.GXAttributeCollection.Find(Int32 index)
at Gurux.DLMS.Objects.GXDLMSObject.GetAttribute(Int32 index, GXAttributeCollection attributes)
at Gurux.DLMS.Objects.GXDLMSObject.GetUIDataType(Int32 index)
at Gurux.DLMS.Objects.GXDLMSProfileGeneric.SetBuffer(GXDLMSSettings settings, ValueEventArgs e)
at Gurux.DLMS.Objects.GXDLMSProfileGeneric.Gurux.DLMS.Objects.IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
at Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value, List`1 columns)
at Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value)
at GuruxTest.GXDLMSReader.ReadRowsByRange(GXDLMSProfileGeneric it, DateTime start, DateTime end) in C:\Repos\Gurux\Gurux\GuruxTest\GuruxDLMSReader.cs:line 884

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

Send log to me by email. Read also capture objects. It seems that your meter is configured wrong
and attribute index is less than zero. I'll check.

BR,
Mikko

wikican

7 years 7 months ago

I sent email for full log.

I sent email for full log. thank you Mikko;

wikican

7 years 7 months ago

Hello Mikko,

Hello Mikko,
I found abnormal data in the captured Objects :
Other 6 objects are ok.

But object number 1 and 2 has wrong AttributeIndex value,

{1.1.99.1.0.255 Ch. 1 Load profile with recording period 1 #1}
AttributeIndex -1 int

{1.1.99.1.0.255 Ch. 1 Load profile with recording period 1 #1}
AttributeIndex -2 int

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

As I expecting. The manufacturer uses negative values for attributes. Attributes start from 1.
Can you ask from manufacturer what is the meaning of negative values and why they are using them?

Negative values are not on the standard.
BR,

Mikko

wikican

7 years 7 months ago

Asked to the manifacturer

Asked to the manifacturer Mikko, I'll inform you when I learn something.

While waiting their answer, I wonder, can I ignore that wrong formatted objects easly.
But i guess it can break buffered data meanings, I'm not sure..

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

Open GXDLMSProfileGeneric file.
Sinf Setbuffer meth0d and change:

//Actaris SL 7000 and ACE 6000 returns 0.
if (index2 != 0)

to
if (index2 > 0)

BR,

Mikko

wikican

7 years 7 months ago

Nice hack,

Nice hack,
I got Capturedobject values clearly with your support.

For the previous month value (for billing), May I set this range to this month first day 00:00 - 00:15 ? isn't it?

Profile picture for user Kurumi

Kurumi

7 years 7 months ago

A simple example for reading GXDLMSProfileGeneric ?

Hi,

You can get data as you want to. Just give start and end time.

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