I am not able to use Disconnect control object to send disconnect or connect operations for short name referencing. For logical referencing it is working fine though.
On trying to send through the short name referencing, I am getting following exception:-
IllegalArgumentException : "methodIndex"
I am using following call to send the disconnect meter call:-
com.dlms.method(disconnectControl, 1, new Integer(0), DataType.INT8);
On looking further error seems to be coming from GXDLMSClient's method . Th eissue seems to be occuring as in getActionInfo of GXDLMS class, DISCONNECT_CONTROL case is not handled.
Please look into it urgently as we are stuck on this.
The short name referencing is also not working for Profile Generics. While trying to read the attribute 3 for the profile generic, the attribute is looking for the recieved logical names instead.:-
else if (e.getIndex() == 3) {
captureObjects.clear();
buffer.clear();
entriesInUse = 0;
if (e.getValue() != null) {
for (Object it : (Object[]) e.getValue()) {
Object[] tmp = (Object[]) it;
if (tmp.length != 4) {
throw new GXDLMSException("Invalid structure format.");
}
ObjectType type =
ObjectType.forValue(((Number) tmp[0]).intValue());
String ln = GXCommon.toLogicalName((byte[]) tmp[1]);
GXDLMSObject obj = null;
if (settings != null && settings.getObjects() != null) {
obj = settings.getObjects().findByLN(type, ln);
}
if (obj == null) {
obj = gurux.dlms.GXDLMSClient.createObject(type);
obj.setLogicalName(ln);
}
addCaptureObject(obj, ((Number) tmp[2]).intValue(),
((Number) tmp[3]).intValue());
}
}
So, do you mean we should expect the logical names to be received along with short names from the meter for profile generics case while short name referencing is used? In case we are trying to get the attribute index 2 for profile generic objects from mock meter, please tell what should be the code present in onpreread when short name referencing is used?
Captured objects (attribute index 3 in profile generic) describe all columns that are saved to profile generic. Object type, logical name, and data index are saved there. Short name is not there and you are not using Short name if you want to read profile generic buffer by columns.
Usually, you should read captured objects first and then buffer of profile generic.
On PreRead you check is profile generic read. The current example reads values from the file.
Can you use a file or do you want to set values in when the client reads them?
Both ways are possible. Current example uses the file because sometimes there are so many rows that it might cause problems with memory. Usually memory is not a problem with Java.
short name referencing
Hi
The short name referencing is also not working for Profile Generics. While trying to read the attribute 3 for the profile generic, the attribute is looking for the recieved logical names instead.:-
else if (e.getIndex() == 3) {
captureObjects.clear();
buffer.clear();
entriesInUse = 0;
if (e.getValue() != null) {
for (Object it : (Object[]) e.getValue()) {
Object[] tmp = (Object[]) it;
if (tmp.length != 4) {
throw new GXDLMSException("Invalid structure format.");
}
ObjectType type =
ObjectType.forValue(((Number) tmp[0]).intValue());
String ln = GXCommon.toLogicalName((byte[]) tmp[1]);
GXDLMSObject obj = null;
if (settings != null && settings.getObjects() != null) {
obj = settings.getObjects().findByLN(type, ln);
}
if (obj == null) {
obj = gurux.dlms.GXDLMSClient.createObject(type);
obj.setLogicalName(ln);
}
addCaptureObject(obj, ((Number) tmp[2]).intValue(),
((Number) tmp[3]).intValue());
}
}
Thanks
Yatin
Using Disconnect control object with short name referencing
Hi,
We were on Christmas holiday and just come back. We'll check this today.
BR,
Mikko
short name referencing
Hi,
The target name is given using Logical Name also when Short Name referencing is used.
BR,
Mikko
Using Disconnect control object with short name referencing
Hi,
We have released a new version.
http://www.gurux.fi/node/6535
BR,
Mikko
short name referencing profile generics
So, do you mean we should expect the logical names to be received along with short names from the meter for profile generics case while short name referencing is used? In case we are trying to get the attribute index 2 for profile generic objects from mock meter, please tell what should be the code present in onpreread when short name referencing is used?
Thanks
Yatin
Using Disconnect control object with short name referencing
Hi,
Captured objects (attribute index 3 in profile generic) describe all columns that are saved to profile generic. Object type, logical name, and data index are saved there. Short name is not there and you are not using Short name if you want to read profile generic buffer by columns.
Usually, you should read captured objects first and then buffer of profile generic.
On PreRead you check is profile generic read. The current example reads values from the file.
Can you use a file or do you want to set values in when the client reads them?
Both ways are possible. Current example uses the file because sometimes there are so many rows that it might cause problems with memory. Usually memory is not a problem with Java.
BR,
Mikko