Reading profile generic

2 posts / 0 new
Last post
hanumaan
Reading profile generic

Hi ...
I am.. try to reading profile generic data, below is the code snippet i have tried..

GXDLMSProfileGeneric gp = new GXDLMSProfileGeneric("1.0.94.91.0.255");
GXReplyData reply_data = new GXReplyData();

byte[][] temp = mClient.read(gp, 3);
for (byte[] it : temp) {
readDataBlock(temp, reply_data);
}
if (gp.getDataType(3) == DataType.NONE) {
gp.setDataType(3, reply_data.getValueType());
}
mClient.updateValue(gp, 3, reply_data.getValue());
byte[][] temp1 = mClient.read(gp, 2);
for (byte[] it : temp1) {
readDataBlock(temp1, reply_data);
}
if (gp.getDataType(2) == DataType.NONE) {
gp.setDataType(2, reply_data.getValueType());
}
mClient.updateValue(gp, 2, reply_data.getValue());

GXDLMSProfileGeneric gpScalar = new GXDLMSProfileGeneric("1.0.94.91.3.255");
byte[][] temp2 = mClient.read(gpScalar, 3);

for (byte[] it : temp2) {
readDataBlock(temp2, reply_data);
}
if (gpScalar.getDataType(3) == DataType.NONE) {
gpScalar.setDataType(3, reply_data.getValueType());
}
mClient.updateValue(gpScalar, 3, reply_data.getValue());

byte[][] temp4 = mClient.read(gpScalar, 2);
for (byte[] it : temp4) {
readDataBlock(temp4, reply_data);
}
if (gpScalar.getDataType(2) == DataType.NONE) {
gpScalar.setDataType(2, reply_data.getValueType());
}
mClient.updateValue(gpScalar, 2, reply_data.getValue());

first question Is this the write way to get profile generic data and its scalar values? or there is better way or readymade methods to read package recieved from the meter.

kurumi
kurumi's picture
Reading profile generic

Hi,

It's always better to read scalers and units before and save them an example to the file.
In that way, you don't need to read them from the meter every time again and again.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org