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. Forums
  3. Getting Null Object In ReadScalerAndUnits() Method

Getting Null object in readScalerAndUnits() method

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By rahul.singh@ra… , 24 January, 2019
Forums
Gurux DLMS for Java

void readScalerAndUnits() throws Exception {
GXDLMSObjectCollection objs = dlms.getObjects()
.getObjects(new ObjectType[] { ObjectType.REGISTER,
ObjectType.DEMAND_REGISTER,
ObjectType.EXTENDED_REGISTER });
try {
if (dlms.getNegotiatedConformance()
.contains(Conformance.MULTIPLE_REFERENCES)) {
List<Entry<GXDLMSObject, Integer>> list =
new ArrayList<Entry<GXDLMSObject, Integer>>();
for (GXDLMSObject it : objs) {
if (it instanceof GXDLMSRegister) {
list.add(new GXSimpleEntry<GXDLMSObject, Integer>(it,
3));
}
if (it instanceof GXDLMSDemandRegister) {
list.add(new GXSimpleEntry<GXDLMSObject, Integer>(it,
4));
}
}
readList(list);
}

Unable to add readList .

i amd using sample client java .

Please Help

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

Getting Null object in readScalerAndUnits() method

Hi,

On what row you are getting this error? Have you made any changes?

BR,

Mikko

rahul.singh@ra…

7 years 4 months ago

In reply to Getting Null object in readScalerAndUnits() method by Kurumi

Hi Mikko

Hi Mikko

Am not getting any error .

it just data in ReadAll() Method we can only able to read AssociativeView .

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

Getting Null object in readScalerAndUnits() method

Hi,

I believe that you have connected using Authentication None. Some meters don't return any registers with that authentication. You need to change authentication to Low or High and try again.

You can test this with GXDLMSDirector.

BR,

Mikko

rahul.singh@ra…

7 years 4 months ago

In reply to Getting Null object in readScalerAndUnits() method by Kurumi

Hi Mikko,

Hi Mikko,

static int getParameters(String[] args, Settings settings) {
GXNet net = null;
settings.client.setInterfaceType(InterfaceType.HDLC);
settings.client.setUseLogicalNameReferencing(true);
settings.media = new GXNet();
net = (GXNet) settings.media;
net.setHostName("192.168.54.32");
net.setPort(Integer.parseInt("1234"));
settings.client.setPassword("ABCD0001".getBytes());
settings.iec = false;
settings.client.setAuthentication(Authentication.valueOfString("Low"));
settings.client.setClientAddress(Integer.parseInt("29"));
settings.client.setServerAddress(Integer.parseInt("01"));
return 0;
}

i have used authentyication = LOw

Somewhere else i need to mention .

I am using Gurux java client example

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

Getting Null object in readScalerAndUnits() method

Hi,

Is list empty of what exactly is the problem?
BR,
Mikko

rahul.singh@ra…

7 years 4 months ago

Yes list is empty for

Yes list is empty for readandscal.

rahul.singh@ra…

7 years 4 months ago

Yes list is empty for

Yes list is empty for readandscal.

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

Getting Null object in readScalerAndUnits() method

Hi,

If the list is empty there are no registers. Try to connect using higher authentication level.
I believe that you are using authentication level None.

BR,
Mikko

rahul.singh@ra…

7 years 4 months ago

In reply to Getting Null object in readScalerAndUnits() method by Kurumi

Am Using LOW Authentication

Am Using LOW Authentication
Tried With
settings.client.setAuthentication(Authentication.valueOfString("LOW"));

1. settings.client.setPassword("ABCD0001".getBytes("ASCII"));
2. settings.client.setPassword("ABCD0001".getBytes());
3. settings.client.setPassword("ABCD0001");

rahul.singh@ra…

7 years 4 months ago

In reply to Getting Null object in readScalerAndUnits() method by Kurumi

Am Using LOW Authentication

Am Using LOW Authentication
Tried With
settings.client.setAuthentication(Authentication.valueOfString("LOW"));

1. settings.client.setPassword("ABCD0001".getBytes("ASCII"));
2. settings.client.setPassword("ABCD0001".getBytes());
3. settings.client.setPassword("ABCD0001");

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

Getting Null object in readScalerAndUnits() method

Hi,

Try to connect with High Authentication. Problem is that there are no register objects in the association view.

BR,

Mikko

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin