You was not saying what meter you try to read. All meters don't implement read by entry(index and count). Try with read by range(between start and end date).
I am reading the data from meter using optical probe. How can i read the Profile Generic values for selective read like in gurux director in android. When i read the profile generic values(Obis codes of profile generic: 1.0.98.1.0.255) in the gurux director with read all option it was returning a list. Like wise how can i read profile generic obis codes in android. Please help me with this.
You have to modify source code. Our example reads all data at the moment and there are no start and end time on UI.
You can modify read method and check is object profile generic.
/**
* Reads profile generic using start and end time.
*
* @param item
* @param attributeIndex
* @return
* @throws Exception
*/
public void readRowsByRange(final GXDLMSProfileGeneric pg,
final Date start, final Date end) throws Exception {
GXReplyData reply = new GXReplyData();
byte[][] data = mClient.readRowsByRange(pg, start, end);
readDataBlock(data, reply);
mClient.updateValue(pg, 2, reply.getValue());
}
public void read(GXDLMSObject obj) throws Exception {
if (obj instanceof GXDLMSProfileGeneric)
{
readRowsByRange((GXDLMSProfileGeneric)obj, start time, end time) ;
}
else{
for (int it : ((IGXDLMSBase) obj).getAttributeIndexToRead()) {
readObject(obj, it);
}
}
}
I tried your code thank you for saving me, Sorry to disturbing you again and again I want to read ALL the profile generic values insted of from date, to date how can i do that
Billing profile
Hi,
Message is correct:
http://www.gurux.fi/GuruxDLMSTranslator?pdu=C001C100070100620100FF02010…
You was not saying what meter you try to read. All meters don't implement read by entry(index and count). Try with read by range(between start and end date).
BR,
Mikko
How to get PROFILE GENERIC values in android DLMS
Hi,
I am reading the data from meter using optical probe. How can i read the Profile Generic values for selective read like in gurux director in android. When i read the profile generic values(Obis codes of profile generic: 1.0.98.1.0.255) in the gurux director with read all option it was returning a list. Like wise how can i read profile generic obis codes in android. Please help me with this.
How to get PROFILE GENERIC values in android DLMS
Hi,
You have to modify source code. Our example reads all data at the moment and there are no start and end time on UI.
You can modify read method and check is object profile generic.
/**
* Reads profile generic using start and end time.
*
* @param item
* @param attributeIndex
* @return
* @throws Exception
*/
public void readRowsByRange(final GXDLMSProfileGeneric pg,
final Date start, final Date end) throws Exception {
GXReplyData reply = new GXReplyData();
byte[][] data = mClient.readRowsByRange(pg, start, end);
readDataBlock(data, reply);
mClient.updateValue(pg, 2, reply.getValue());
}
public void read(GXDLMSObject obj) throws Exception {
if (obj instanceof GXDLMSProfileGeneric)
{
readRowsByRange((GXDLMSProfileGeneric)obj, start time, end time) ;
}
else{
for (int it : ((IGXDLMSBase) obj).getAttributeIndexToRead()) {
readObject(obj, it);
}
}
}
How to get PROFILE GENERIC values in android DLMS
I got it, Will you send me some example code with profile generic data reading.
How to get PROFILE GENERIC values in android DLMS
Hai,
I tried your code thank you for saving me, Sorry to disturbing you again and again I want to read ALL the profile generic values insted of from date, to date how can i do that
Thank you,
How to get PROFILE GENERIC values in android DLMS
Hi.
Read buffer using read-method. That reads all data from the DB.
Like this:
//Read capture objects.
Read(pg, 3);
//Read ALL data.
Read(pg, 2);
BR,
Mikko
How to get PROFILE GENERIC values in android DLMS
Hai,
I had wrote the code like this but it wasn't returning any values for profile generic can you tell me why.
Please correct me if i am wrong
public void read(GXDLMSObject obj) throws Exception {
GXReplyData reply_data = new GXReplyData();
if(obj instanceof GXDLMSProfileGeneric){
byte[][]temp;
CurrentProfileGeneric = (GXDLMSProfileGeneric) obj ;
temp = mClient.read(CurrentProfileGeneric,2);
readDataBlock(temp,reply_data);
}else {
for (int it : ((IGXDLMSBase) obj).getAttributeIndexToRead()) {
readObject(obj, it);
}
}
}
How to get PROFILE GENERIC values in android DLMS
Hi,
Read captured columns first. Something like:
readObject(pg, 3);
temp = mClient.read(CurrentProfileGeneric,2);
readDataBlock(temp,reply_data);
BR,
Mikko