Hello Mikko,
I have solved one problem with you before (thank you very much). I believe that this also will be fast and inspiring.
I would like to read last x day ProfileGeneric data (0.0.98.1.0.255) with Iskraemeco T880 meter.
The best is the last record.
It is easy with GXDLMSDirector but I dont know how to do it in java.
Java requires Read Capture Object first but I dont know how to do it.
How can I know index of last record?
Peter.
Maybe it is easy only I dont see it...
1. I get an Object (array in this case) with read(pg, 3). There are columns OBIS code (?)
2. How to find required code and number of column I can get it then from readByRange(pg, startTime, endTime) (if exists).
Peter.
Maybe it is easy only I dont see it...
1. I get an Object (array in this case) with read(pg, 3). There are columns OBIS code (?)
2. How to find required code and number of column I can get it then from readByRange(pg, startTime, endTime) (if exists).
Peter.
I did following:
...
GXDLMSProfileGeneric iprof = new GXDLMSProfileGeneric(ri.getReadingItemCode());
val = this.read(iprof,3);
readRowsByRange(iprof, startTime, endTime);
//reads only one row...it is correct
ListIterator<Entry<GXDLMSObject, GXDLMSCaptureObject>> colsi =iprof.getCaptureObjects().listIterator();
while (colsi.hasNext()) {
Entry<GXDLMSObject, GXDLMSCaptureObject> ci = colsi.next();
....
}
I found required ci where (1.0.1.8.0.255)
How to extract data from it? (scaler, unit, value)
Peter.
I did following:
...
GXDLMSProfileGeneric iprof = new GXDLMSProfileGeneric(ri.getReadingItemCode());
val = this.read(iprof,3);
readRowsByRange(iprof, startTime, endTime);
//reads only one row...it is correct
ListIterator<Entry<GXDLMSObject, GXDLMSCaptureObject>> colsi =iprof.getCaptureObjects().listIterator();
while (colsi.hasNext()) {
Entry<GXDLMSObject, GXDLMSCaptureObject> ci = colsi.next();
....
}
I found required ci where (1.0.1.8.0.255)
How to extract data from it? (scaler, unit, value)
Peter.
Please, don't post same question several times. Data is the profile generic buffer. The content of the data depends on what is saved to the profile generic.
You must loop all the rows and columns to get the data. Check the client example. It does that.
Hi,
Hi,
Before you can read the buffer you need to read the capture object. Read attribute index 3 and after that, you can read buffer.
read(pg, 3);
readByRange(pg, ...
BR,
Mikko
read(pg, 3) object print:
read(pg, 3) object print: [gurux.dlms.GXSimpleEntry@512ddf17, gurux.dlms.GXSimpleEntry@2c13da15, gurux.dlms.GXSimpleEntry@77556fd, gurux.dlms.GXSimpleEntry@368239c8, gurux.dlms.GXSimpleEntry@9e89d68, gurux.dlms.GXSimpleEntry@3b192d32, gurux.dlms.GXSimpleEntry@16f65612, gurux.dlms.GXSimpleEntry@311d617d, gurux.dlms.GXSimpleEntry@7c53a9eb, gurux.dlms.GXSimpleEntry@ed17bee, gurux.dlms.GXSimpleEntry@2a33fae0, gurux.dlms.GXSimpleEntry@707f7052, gurux.dlms.GXSimpleEntry@11028347, gurux.dlms.GXSimpleEntry@14899482, gurux.dlms.GXSimpleEntry@21588809, gurux.dlms.GXSimpleEntry@2aae9190, gurux.dlms.GXSimpleEntry@2f333739, gurux.dlms.GXSimpleEntry@77468bd9, gurux.dlms.GXSimpleEntry@12bb4df8, gurux.dlms.GXSimpleEntry@4cc77c2e, gurux.dlms.GXSimpleEntry@7a7b0070, gurux.dlms.GXSimpleEntry@39a054a5, gurux.dlms.GXSimpleEntry@71bc1ae4, gurux.dlms.GXSimpleEntry@6ed3ef1, gurux.dlms.GXSimpleEntry@2437c6dc]
How I can get data from Object[] readByRange(pg, startTime, endTime)???
Peter.
Hi Peter,
Hi Peter,
After readByRange data is on profile generic buffer. You can loop it one row at the time.
BR,
Mikko
Maybe it is easy only I dont
Maybe it is easy only I dont see it...
1. I get an Object (array in this case) with read(pg, 3). There are columns OBIS code (?)
2. How to find required code and number of column I can get it then from readByRange(pg, startTime, endTime) (if exists).
Peter.
Maybe it is easy only I dont
Maybe it is easy only I dont see it...
1. I get an Object (array in this case) with read(pg, 3). There are columns OBIS code (?)
2. How to find required code and number of column I can get it then from readByRange(pg, startTime, endTime) (if exists).
Peter.
Hi,
Hi,
You need to first read the capture object. You need to do it only once.
There are capture objects and attribute and data index.
read(pg, 3)
Then you can buffer using readByRange, readByEntry or normal read.
Now read data can be found from pg.buffer.
BR,
Mikko
Then you can read
I did following:
I did following:
...
GXDLMSProfileGeneric iprof = new GXDLMSProfileGeneric(ri.getReadingItemCode());
val = this.read(iprof,3);
readRowsByRange(iprof, startTime, endTime);
//reads only one row...it is correct
ListIterator<Entry<GXDLMSObject, GXDLMSCaptureObject>> colsi =iprof.getCaptureObjects().listIterator();
while (colsi.hasNext()) {
Entry<GXDLMSObject, GXDLMSCaptureObject> ci = colsi.next();
....
}
I found required ci where (1.0.1.8.0.255)
How to extract data from it? (scaler, unit, value)
Peter.
I did following:
I did following:
...
GXDLMSProfileGeneric iprof = new GXDLMSProfileGeneric(ri.getReadingItemCode());
val = this.read(iprof,3);
readRowsByRange(iprof, startTime, endTime);
//reads only one row...it is correct
ListIterator<Entry<GXDLMSObject, GXDLMSCaptureObject>> colsi =iprof.getCaptureObjects().listIterator();
while (colsi.hasNext()) {
Entry<GXDLMSObject, GXDLMSCaptureObject> ci = colsi.next();
....
}
I found required ci where (1.0.1.8.0.255)
How to extract data from it? (scaler, unit, value)
Peter.
Hello Mikko,
Hello Mikko,
this is my nightmare. Where I am wrong?
GXDLMSProfileGeneric iprof = new GXDLMSProfileGeneric(ri.getReadingItemCode());
System.out.println("Capture Request:"+ri.getReadingItemCode()+":3");
val = this.read(iprof,3);//capture register
System.out.print("Request:"+ri.getReadingItemCode()+">"+ri.getReadingItemAttrib()+" : ");
System.out.println(settings.startTime+":"+settings.endTime);
readRowsByRange(iprof, settings.startTime, settings.endTime);
ListIterator<Entry<GXDLMSObject, GXDLMSCaptureObject>> colsi = iprof.getCaptureObjects().listIterator();
ListIterator<Settings.readingItem> pitr = settings.readingProfileItems.listIterator();//here is list of two LN codes i want to extract from Profile Generic data
int numObj=0;
while (colsi.hasNext()) {
Entry<GXDLMSObject, GXDLMSCaptureObject> ci = colsi.next();
while (pitr.hasNext()) {
Settings.readingItem pri = pitr.next();
for(Object io:ci.getKey().getValues())
System.out.println("->"+io);
if(pri.getReadingItemCode().equalsIgnoreCase(ci.getKey().toString())) {
numObj++;
break;
}
}
if(settings.readingProfileItems.size()==numObj)break;
pitr=settings.readingProfileItems.listIterator();//reset iterator
}
this is printout:
Capture Request:0.0.98.1.0.255:3
Request:0.0.98.1.0.255>2 : Mon Oct 07 20:18:35 CEST 2019:Thu Nov 07 20:18:35 CET 2019
->0.0.1.0.0.255
->7.11.2019 20:18
->0
->[OK]
->.2019 20:18:37
->.2019 20:18:37
->0
->false
->NONE
->0.0.1.0.0.255
->7.11.2019 20:18
->0
->[OK]
->.2019 20:18:37
->.2019 20:18:37
->0
->false
->NONE
->1.0.1.2.0.255
->null
->Scaler: 1 Unit: None
->1.0.1.2.0.255
->null
->Scaler: 1 Unit: None
->1.0.1.2.1.255
->null
->Scaler: 1 Unit: None
->1.0.1.2.1.255
->null
->Scaler: 1 Unit: None
->1.0.1.6.0.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.0.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.0.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.0.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.1.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.1.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.1.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.6.1.255
->null
->Scaler: 1 Unit: None
->null
->7.11.2019 20:18
->1.0.1.8.0.255
->null
->Scaler: 1 Unit: None
->1.0.1.8.0.255
->null
->Scaler: 1 Unit: None
->1.0.1.8.1.255
->null
->Scaler: 1 Unit: None
->1.0.1.8.1.255
->null
->Scaler: 1 Unit: None
->1.0.1.8.2.255
->null
->Scaler: 1 Unit: None
->1.0.1.8.2.255
->null
->Scaler: 1 Unit: None
->1.0.2.8.0.255
->null
->Scaler: 1 Unit: None
Hi,
Hi,
Please, don't post same question several times. Data is the profile generic buffer. The content of the data depends on what is saved to the profile generic.
You must loop all the rows and columns to get the data. Check the client example. It does that.
BR,
Mikko