Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Unable To Read Instantaneous Profile.

Unable to read Instantaneous Profile.

By saraf_kshitiz , 30 January, 2025
Forums
Gurux DLMS for Android

Hello Mikko Sir, 
I'm trying to read rows by index because I have to read and display the data of Instantaneous Profile Object (1.0.94.91.0.255). 
For that, I am running the following code snippet which works perfectly fine for getting Name Plate Profile (0.0.94.91.10.255) object data :-

Object[] rows = {};
try {
    GXDLMSProfileGeneric pg = new GXDLMSProfileGeneric(ln);
    gxConnection.readObject(pg, 3);
    List<Map.Entry<GXDLMSObject, GXDLMSCaptureObject>> captureObjects = pg.getCaptureObjects();
    mCaptureObjects.clear();

    for (Map.Entry<GXDLMSObject, GXDLMSCaptureObject> entry : captureObjects) {
        mCaptureObjects.add(deviceObjects.findByLN(ObjectType.NONE,
                entry.getKey().getLogicalName()));
    }
    long startTime = System.currentTimeMillis();
    rows = gxConnection.readRowsByIndex(pg, 1, 1);
    long endTime = System.currentTimeMillis();
    Log.d(TAG, "Data fetch time: " + (endTime - startTime) + "ms");

} catch (Exception e) {
    new ExceptionHandler(requireActivity()).showError(e,
            getString(R.string.read_object_error));
}

The error I'm getting is :- 

 showError: Number of columns do not match. (Ask Gemini)
                                                                                                   java.lang.RuntimeException: Number of columns do not match.
                                                                                                       at gurux.dlms.objects.GXDLMSProfileGeneric.setBuffer(GXDLMSProfileGeneric.java:859)
                                                                                                       at gurux.dlms.objects.GXDLMSProfileGeneric.setValue(GXDLMSProfileGeneric.java:714)
                                                                                                       at gurux.dlms.GXDLMSClient.updateValue(GXDLMSClient.java:1482)
                                                                                                       at gurux.dlms.GXDLMSClient.updateValue(GXDLMSClient.java:1455)
                                                                                                       at gurux.dlms.android.connection.DeviceConnection.readRowsByIndex(DeviceConnection.java:317)
                                                                                                       at gurux.dlms.android.fragments.ObjectReadsFragment.lambda$getDataList$1$gurux-dlms-android-fragments-ObjectReadsFragment(ObjectReadsFragment.java:80)
                                                                                                       at gurux.dlms.android.fragments.ObjectReadsFragment$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                       at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                       at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                       at android.os.Looper.loopOnce(Looper.java:222)
                                                                                                       at android.os.Looper.loop(Looper.java:314)
                                                                                                       at android.app.ActivityThread.main(ActivityThread.java:8680)
                                                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                                                       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:565)
                                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)

Error is in line :- 

rows = gxConnection.readRowsByIndex(pg, 1, 1);

What am I doing wrong? And if this line works fine for reading Nameplate profile, then why there is internal gurux code error in case of Instantaneous profile?

I will be waiting for a response, sir. 
Thanks, 
Kshitiz

Profile picture for user Kurumi

Kurumi

1 year 4 months ago

Hello Mr. Kshitiz, The…

Hello Mr. Kshitiz,

The number of columns does not match. means that the number of columns in capture objects differs from the buffer.

Try to read your meter with GXDLMSDirector. If you get the same error, you need to ask the reason for this from the meter manufacturer and if there is a meter firmware update that fixes this.

BR,
Mikko

saraf_kshitiz

1 year 4 months ago

Hi Mikko Sir, Yes it was an…

Hi Mikko Sir, 
Yes it was an issue of column mismatch in capture objects and buffer. 
It has been fixed by reading all the indexes of the object and reading the capture objects separately.

gxConnection.read(pg);
gxConnection.readObject(pg, 3);

Thanks, 

Kshitiz

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin