We are reading Instantaneous Profile data from a DLMS meter using the Gurux library.
Normally the read works correctly and all values are returned as expected. However, sometimes we receive the following response:
Index: 2 Value: [ ]
Index: 3 Value: [Clock 0.0.1.0.0.255, Register 1.0.31.7.0.255, Register 1.0.51.7.0.255, Register 1.0.71.7.0.255, Register 1.0.32.7.0.255, Register 1.0.52.7.0.255, Register 1.0.72.7.0.255, Register 1.0.33.7.0.255, Register 1.0.53.7.0.255, Register 1.0.73.7.0.255, Register 1.0.13.7.0.255, Register 1.0.14.7.0.255, Register 1.0.9.7.0.255, Register 1.0.1.7.0.255, Register 1.0.3.7.0.255, Data 0.0.96.7.0.255, Register 0.0.94.91.8.255, Data 0.0.94.91.0.255, Data 0.0.0.1.0.255, Data 0.0.96.2.0.255, Register 0.0.0.1.2.255, Register 1.0.1.8.0.255, Register 1.0.5.8.0.255, Register 1.0.8.8.0.255, Register 1.0.9.8.0.255, ExtendedRegister 1.0.1.6.0.255, ExtendedRegister 1.0.1.6.0.255, ExtendedRegister 1.0.9.6.0.255, ExtendedRegister 1.0.9.6.0.255, Register 1.0.36.7.0.255, Register 1.0.56.7.0.255, Register 1.0.76.7.0.255, Register 1.0.128.7.65.255, Register 1.0.128.7.68.255, Register 1.0.128.7.66.255, Register 1.0.128.7.67.255, Register 1.0.128.7.38.255, Register 1.0.128.7.39.255, Register 1.0.128.7.40.255, Register 1.0.128.7.53.255, Register 1.0.128.7.54.255, Register 1.0.128.7.55.255, Register 1.0.128.7.35.255, Register 1.0.128.7.36.255, Register 1.0.128.7.37.255, Register 1.0.128.8.39.255, Register 1.0.128.8.23.255, Register 1.0.128.8.25.255, Register 1.0.128.8.24.255, Register 1.0.128.8.27.255, Register 1.0.128.8.26.255, Register 1.0.128.8.29.255, Register 1.0.128.8.28.255, Register 1.0.128.8.34.255, Data 1.0.128.7.41.255, Data 1.0.128.7.45.255, Data 1.0.128.7.46.255, Data 1.0.128.7.52.255, Data 1.0.128.7.42.255, Data 1.0.128.7.48.255, Data 1.0.128.7.47.255, Data 1.0.128.7.51.255, Data 1.0.128.7.50.255, Data 1.0.128.7.44.255, Data 1.0.128.7.43.255, Data 1.0.128.7.49.255]
Index: 4 Value: 0
Index: 5 Value: 0
Index: 6 Value:
Index: 7 Value: 0
Index: 8 Value: 0The read call used is:
com_read(&pg,1);
ret3= com_read(&pg,3);
com_read(&pg,4);
com_read(&pg,5);
com_read(&pg,6);
com_read(&pg,7);
com_read(&pg,8);
ret2 = com_read(&pg, 2);In this case, ret2 is still 0, which normally indicates that the response is valid.
However, as seen above:
> Index 2 (data buffer) is empty
> Other values appear incomplete
Questions:
> Why does the Gurux library return ret = 0 even when the data block is empty or incomplete?
> Is there an internal condition where the library considers this a valid DLMS response?
> What is the recommended way to detect and handle this situation programmatically?
> Should we manually validate the returned data length or structure after com_read()?
Additional Notes:
> This issue occurs intermittently, not always.
> When it occurs, re-reading the profile usually returns correct data.
> Any guidance on detecting or handling this condition correctly would be appreciated.
Hi, No errors are returned…
Hi,
No errors are returned if the return value is zero. I believe that the meter is returning empty data for some reason. You need to verify this from the hex trace.
BR,
Mikko