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");
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
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?
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.
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.
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?
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?
Hi,
Hi,
Your code looks correct. Can you read the meter with GXDLMSDirector?
Are you receiving an error from the meter?
BR,
Mikko
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
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
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
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
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
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?
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?
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).
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
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?
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
Hi, Mikko
Hi, Mikko
Thanks for the assistance its very appreciated
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?
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