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. HDLC DLMS Data Decryption

HDLC DLMS data Decryption

By ERAIYARUL K , 22 July, 2025
Forums
Gurux.DLMS

Hello Sir,

I am working with the following HDLC frame:
byte[] frame = GXCommon.HexToBytes("7E 16 38 04 7E A0 1F 21 03 96 DB D6 E6 E7 00 C4 01 C1 00 09 0D 41 4C 4C 49 45 44 2D 44 4C 4D 53 30 33 D6 B5 7E");

Using the GXDLMSTranslator, I am able to successfully convert this frame into a readable XML format:

GXDLMSTranslator t = new GXDLMSTranslator();
string xml = t.MessageToXml(frame );

However, when I use the GXDLMSSecureClient to process the same frame, the result is false:

GXDLMSSecureClient dlms3 = new GXDLMSSecureClient(true);
GXByteBuffer buffer = new GXByteBuffer(frame);
GXReplyData reply = new GXReplyData();
GXReplyData noti = new GXReplyData();
var result = dlms3.GetData(frame, reply, noti);

Upon investigation, I found that the issue occurs inside the GetHdlcData function in GXDLMS. The condition:

if (data.Xml == null && !settings.CheckFrame(frame, data.Xml))

is failing because data.Xml is null when using GXDLMSSecureClient, whereas it is properly populated when using the GXDLMSTranslator.

The main issue is that the GXReplyData.Xml property is inaccessible due to its protection level, so I am unable to assign a GXDLMSTranslatorStructure object to it in the SecureClient context.

If I manually assign the GXDLMSTranslatorStructure to data.Xml, the frame is processed successfully.

Kindly advise on how to proceed or if it would be possible to expose the Xml property to enable this functionality.

Note - I can't assign the GXDLMSTranslatorStructure object into data.Xml in SecureClient class.

reason - 'GXReplyData.Xml' is inaccessible due to its protection level

Profile picture for user Kurumi

Kurumi

10 months 3 weeks ago

Hi, You need to set the…

Hi,

You need to set the client and server addresses to the dlms3.

dlms3.ClientAddress = 0x10;
dlms3.ServerAddress = 1;

It is not intended that you set the XML property.

BR,
Mikko

ERAIYARUL K

10 months 2 weeks ago

Thank you for your response…

Thank you for your response.

Unfortunately, the current setup still doesn't work as expected. I've already configured the DLMS settings as follows:
dlms3.ClientAddress = 0x10;
dlms3.ServerAddress = 1;
dlms3.Authentication = Authentication.None;
dlms3.Security = Security.None;

I'm receiving the following RX data from the meter:
byte[] frame = GXCommon.HexToBytes("7E 16 38 04 7E A0 1F 21 03 96 DB D6 E6 E7 00 C4 01 C1 00 09 0D 41 4C 4C 49 45 44 2D 44 4C 4D 53 30 33 D6 B5 7E");

I'm using dlms3.GetData(frame, new GXReplyData(),new GXReplyData()) to process the received data, but it's not yielding the expected results.

Could you please help me identify what might be going wrong or what additional settings or steps are needed?

Profile picture for user Kurumi

Kurumi

10 months 1 week ago

Hi, You can't just select…

Hi,

You can't just select one frame and try to get the data. There is a frame id that blocks invalid frames. You need to establish the connection to the meter and let framework handle all the frames.

Use GXDLMSDTranslator if you want to handle random frames.

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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin