A simple example for reading GXDLMSProfileGeneric ?

13 posts / 0 new
Last post
wikican
A simple example for reading GXDLMSProfileGeneric ?

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.

Kurumi
Kurumi's picture

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

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

wikican

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..

Kurumi
Kurumi's picture

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

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

wikican

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

Kurumi
Kurumi's picture

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

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

wikican

I sent email for full log. thank you Mikko;

wikican

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

Kurumi
Kurumi's picture

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

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

wikican

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..

Kurumi
Kurumi's picture

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

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

wikican

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?

Kurumi
Kurumi's picture

Hi,

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

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi