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. Read Meter Register Via TCP/IP

Read meter register via TCP/IP

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 mishelin , 20 May, 2020
Forums
Gurux DLMS for Java

Hi!
I'm quite new with java and I'd like to ask what should I write after connecting server to get value from specified register. I mean the active energy with address: 1.1.1.8.0.255. I'd like to write a simple application which connect to tcp server and get value of specified register. When I try to read port with standard "read" command I'm getting something like this:

/ABB5\@V4.50
P0(00459594)`1-1:0.9.1(16:45:06)-1-1:0.9.2(20-05-12)*1-1:C.1.0(459594)W1-1:32.7.0(60.9*V)~1-1:52.7.0(61.0*V)p1-1:72.7.0(61.1*V)s1-1:31.7.0(0.008*A)]1-1:51.7.0(0.007*A)T1-1:71.7.0(0.007*A)V/ABB5\@V4.50
P0(00459594)`1-1:C.1.0(459594)W1-1:0.9.1(16:45:26)/1-1:0.9.2(20-05-12)*P.01(1200512161500)(00)(15)(6)(1-1:1.9)(kWh)(1-1:2.9)(kWh)(1-1:5.9)(kvarh)(1-1:6.9)(kvarh)(1-1:7.9)(kvarh)(1-1:8.9)(kvarh)
...
1-1:C.1.0(459594)
1-1:0.9.1(16:48:36)
1-1:0.9.2(20-05-12)
1-1:0.2.2(00000823)
1-1:1.8.0(00089.302*kWh)
1-1:1.8.0*04(00089.028*kWh)
1-1:1.8.0*03(00088.324*kWh)
1-1:1.8.0*02(00087.544*kWh)
1-1:1.8.0*01(00086.752*kWh)
1-1:1.8.0*12(00086.092*kWh)
1-1:1.8.1(00018.240*kWh)
1-1:1.8.1*04(00018.199*kWh)
1-1:1.8.1*03(00018.078*kWh)
1-1:1.8.1*02(00017.932*kWh)
1-1:1.8.1*01(00017.722*kWh)
1-1:1.8.1*12(00017.605*kWh)
1-1:1.8.2(00010.716*kWh)
1-1:1.8.2*04(00010.696*kWh)
1-1:1.8.2*03(00010.624*kWh)
1-1:1.8.2*02(00010.511*kWh)
1-1:1.8.2*01(00010.408*kWh)
...

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

This is IEC 62056-21 readout. There is an OBIS code that describes data and after that is value.
https://www.gurux.fi/DLMSCOSEMFAQ

The easiest way to start is if you parse this readout and find data from there.
It's a good option if you don't need to write anything. Writing is more complex. You need to generate the seed, etc.

BR,
Mikko

mishelin

6 years ago

Parsing whole readout takes

Reading whole readout takes about 10 minutes, but I'd like to read specified register to save time instead of waiting. I guess I should send a binary frame? There's no simple solution with few lines?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

I don't know the model of your meter but there are some differences between IEC 62056-21 meters. I don't know is your meter using the checksum, etc.

This might help you. It's how to connect to the Elster meter. You are reading ABB meter and I can't remember how the password is counted in ABB.
https://www.gurux.fi/node/5415

I believe that you can't read your meter with just a few lines of code. If you want to make it easy, get readout and parse the data.

BR,
Mikko

mishelin

6 years ago

Your link gave me some advice

Your link gave me some advice, but I have question how to add <ACK> to the message? The initiational message was read correctly but I have problem implementing <ACK> <STX> etc. like ASCII code [0x6] - ack.

This working for initiation:

OutputStream out = socket.getOutputStream();
String test = "/?!\r\n";
byte[] xd = test.getBytes("ASCII");
out.write(xd);

But when I try to send the next message meter doesn't recognize it:
String test2 = (char)0x6 + "051\r\n";
byte[] xd2 = test2.getBytes("ASCII");
out.write(xd2);

mishelin

6 years ago

I've managed to solve it I

I've managed to solve it I guess but meter sends me in respond NAK flag and I don't know why. Here in the picture You can se the part of the code when request with type of message selected (051). In the output are ascii value od characters and under them are converted to string text.

Image

mishelin

6 years ago

And the naswer with ascii and

And the naswer with ascii and converted to string

Image
Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

Please, don't paste images. Paste plain text. It's hard to read.

If you send 050 is that working?
Try also add small delay, ( About 1 second) before sending data.

BR,

Mikko

mishelin

6 years ago

050 working and it's fine

050 working and it's fine because I'm receiving my data in few seconds instead of 10 minutes. But I don't know why it keeps sending me NAK flag with 051 request.

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

If 051 fails your meter is using Mode A. It means that you can get only readout from the meter.
You can't write anything to the meter.
BR,
Mikko

mishelin

6 years ago

Is it possible to change the

Is it possible to change the mode?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

You need to ask this from the meter vendor.

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