Hi!
I have a problem with setValue/addCaptureObject in GXDLMSProfileGeneric: I get an exception that the attributeIndex is not valid because it is < 1. I think that the conversion from byte to integer for attributeIndex in setValue is wrong. In blue book 12.2 5.4.2 profile generic the attributeIndex of capture objects is defined as unsigned. The conversion in GXDLMSProfileGeneric seems to be signed. SO if I use the following line I get the expcted positive value:
Attribute indexes are unsigned and I believe that your meter is returning -1 (0xFF). This is causing problems because there aren't so many attributes. What meter you are reading?
the meter is returning i.e. 254 but in Java byte is signed. So if you use ((Number) tmp[2]).intValue() for int conversion you get a negative value. If you use ((Byte)tmp[2]) & 0xFF) you get the real value because it handles the byte value as unsigned.
For most meters it is not relevant because they don't use such high attributeIndex but my Kamstrup Omnipower does use them for placeholders.
Kind regards
flo
Problem with setValue/addCaptureObject in GXDLMSProfileGeneric
Hi,
Attribute indexes are unsigned and I believe that your meter is returning -1 (0xFF). This is causing problems because there aren't so many attributes. What meter you are reading?
BR,
Mikko
Hi,
Hi,
the meter is returning i.e. 254 but in Java byte is signed. So if you use ((Number) tmp[2]).intValue() for int conversion you get a negative value. If you use ((Byte)tmp[2]) & 0xFF) you get the real value because it handles the byte value as unsigned.
For most meters it is not relevant because they don't use such high attributeIndex but my Kamstrup Omnipower does use them for placeholders.
Kind regards
flo
Problem with setValue/addCaptureObject in GXDLMSProfileGeneric
Hi,
I'll have to check that this is not causing any problems with the old meters.
What 0xFE means in Omnipower?
BR,
Mikko
Problem with setValue/addCaptureObject in GXDLMSProfileGeneric
Hi,
We added new version where is XMLClient implementation. We also changed this in that way that attribute index is always positive.
BR,
Mikko