Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
  • Gurux Club
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Read Load profile

Read Load profile

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 C dV, 15 July, 2022
Forums
Gurux DLMS for Java

Good day,

I'm trying to read the Load Profile of a Landis+Gyr e460S but am not sure if I'm doing it correctly. I can read the instantaneous values but cannot get load profile data. Below is the code in my method ( I then cal the method in the GXDLMS.client .example instead of the association view reading)

Settings settings = new Settings();
GXDLMSReader reader = new GXDLMSReader(settings.client, settings.media,
settings.trace, settings.invocationCounter);
GXDLMSProfileGeneric obj = new GXDLMSProfileGeneric("1.0.99.1.0.255");

Calendar start= Calendar.getInstance();
start.set(2022,7,6);
Calendar end= Calendar.getInstance();
end.set(2022,7,8);

reader.readRowsByRange(obj, start.getTime(), end.getTime());

Could you please advise as to where I'm going wrong.

C dV

Profile picture for user Kurumi

Kurumi

8 months 1 week ago

Hi,

Hi,

Your code looks correct. Can you read the meter with GXDLMSDirector?
Are you receiving an error from the meter?

BR,
Mikko

C dV

8 months 1 week ago

In reply to Hi, by Kurumi

Hi,

Hi,

Yes I can Read it with GXDLMSDirector.
but when i run this code I get a"Capture Objects not read" prompt

I tried stepping through the code and see that the error is on the
byte[][] data = dlms.readRowsByRange(pg, start, end);
line in GXDLMSReader.java
Below is the function.

public Object[] readRowsByRange(final GXDLMSProfileGeneric pg, final Date start, final Date end) throws Exception {
GXReplyData reply = new GXReplyData();
byte[][] data = dlms.readRowsByRange(pg, start, end);
readDataBlock(data, reply);
return (Object[]) dlms.updateValue(pg, 2, reply.getValue());
}

I can get data using the -g flag in arguments but I can't get Load Profile data

C dV

8 months 1 week ago

In reply to Hi, by C dV

Hi,

Hi,

I notice that if I do obj.getCaptureObjects().isEmpty() it returns true is there something i need to put into the list before reading or does the "1.0.99.1.1.255" profile have all the set data?

C dV

Profile picture for user Kurumi

Kurumi

8 months 1 week ago

Hi,

Hi,

You need to read the captured objects before you can read the buffer.
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSProfileGeneric

Something like this:

GXDLMSProfileGeneric obj = new GXDLMSProfileGeneric("1.0.99.1.0.255");
reader.read(obj, 3);
reader.readRowsByRange(obj, start.getTime(), end.getTime());

BR,
Mikko

C dV

8 months 1 week ago

In reply to Hi, by Kurumi

Hi, Mikko

Hi, Mikko

I came across this yesterday and tried it out, but when I Copy your example from the last reply I get an Access Error: Unknown error. prompt on the reader.read(obj,3) line . But when using GXDLMSDirector I can read the load profile with this access level and password

1. what is the attribute index and how come it's set to 3?
2. Should the CaptureObjects array be empty after create a GXDLMSProfileGeneric object?

Thanks for the help and apologies if I'm misunderstanding something.

Regards,
C dV

Profile picture for user Kurumi

Kurumi

8 months 1 week ago

Hi,

Hi,

1. Attribute index #3 is capture objects.
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSProfileGeneric

2. No. You need to read or add capture objects before reading the buffer.

Don't worry. DLMS is a very complicated protocol.

BR,
Mikko

C dV

8 months 1 week ago

In reply to Hi, by Kurumi

Hi,

Hi,

I get an Access Error when i do reader.read(obj,3);

what is the access it needs? i checked on GXDLMSDirector on the access rights tab CaptureObjects access is ReadWrite but in the Method Access Rights tab the Capture attribute says NoAccess.

how do I get past this Access error?

C dV

8 months ago

In reply to Hi, by C dV

Hi,

Hi,

I seemed to have fixed the error and can see the trace for reading the capture objects and the the buffer. Then I do a read Rows By range and see the back and fourth comms there as well, but how do I get the actual data values? I saw you mentioned b.getbuffer() somewhere else on the forums page but what is b an object of?

bfajdek

4 months 1 week ago

In reply to Hi, by C dV

I am also having access

I am also having access issues. Maybe you can share how you managed to solve the access problem after calling reader.read(obj,3).

Profile picture for user Kurumi

Kurumi

8 months ago

Hi,

Hi,

After the reading the values you can show then with obj_rowsToString method.
You can see the example from here:
https://github.com/Gurux/GuruxDLMS.c/blob/9cde9cc8c893f9df362b76fdd060f…

BR,
Mikko

C dV

8 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

I cant seem to find the obj_rowsToString method in that example. I can see where it is being used but i want to see how it is working. is there another example that uses the same method perhaps?

Profile picture for user Kurumi

Kurumi

8 months ago

Hi C dV,

Hi C dV,

I'm sorry. You are using Java and not ANSI C and my example was wrong.

When you have read the profile generic buffer you can loop the cells like it's done in getProfileGenerics method.

https://github.com/Gurux/gurux.dlms.java/blob/afa78af2b5a5304f1e5e963d1…

BR,
Mikko

C dV

7 months 4 weeks ago

In reply to Hi C dV, by Kurumi

Hi, Mikko

Hi, Mikko

Thanks for the assistance its very appreciated

C dV

7 months 1 week ago

In reply to Hi, Mikko by C dV

Hi Mikko,

Hi Mikko,

I can get data from the file fine but I'm now trying to export this data to some other format.

I cannot get the name of the capture objects or their Obis Codes. could you please advise as to how i can get the name of the captureobject headings?

Profile picture for user Kurumi

Kurumi

7 months 1 week ago

Hi,

Hi,

When you have the profile generic you can get the capture objects like this:

int index = 0;
pg.getCaptureObjects().get(index).getKey().getLogicalName();

BR,
Mikko

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

Fri, 03/24/2023 - 14:22
gurux.dlms.c 20230324.1
Thu, 03/23/2023 - 11:01
GXDLMSDirector 9.0.2303.2301
Thu, 03/23/2023 - 09:10
Gurux.DLMS.Python 1.0.142
Wed, 03/22/2023 - 13:51
Gurux.DLMS.Net 9.0.2303.2201
Wed, 03/22/2023 - 10:15
gurux.dlms.c 20230322.1

Open bugs

Gurux.DLMS.AMI4
1
Gurux.DLMS.Android
1
gurux.dlms.c
3
gurux.dlms.cpp
3
gurux.dlms.delphi
1
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin