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. Connecting To Landis+Gyr E650 Meter Using HDLC_WITH_MODE_E Failes In Java But Works In GX DLMS Director

Connecting to Landis+Gyr E650 meter using HDLC_WITH_MODE_E failes in Java but works in GX DLMS Director

By flygfantast , 26 March, 2025
Forums
Gurux DLMS for Java

I've been trying to connect to a L+G E650 meter over IP with HDLC_WITH_MODE_E but it failes with "IllegalArgumentException: InterfaceType" in the aarqRequest() call.

When using the GX DLMS Director it works fine.

I've narrowed it down (I think) to getSnMessages in GXDLMS.java.
Checking the .NET project corresponding file GXDLMS.cs I noticed that a check for HdlcWithModeE was missing in the java project.

GXDLMS.java:
// Command is not add to next PDUs.
while (reply.position() != reply.size()) {
if (p.getSettings().getInterfaceType() == InterfaceType.WRAPPER) {
messages.add(getWrapperFrame(p.getSettings(), p.getCommand(), reply));
} else if (p.getSettings().getInterfaceType() == InterfaceType.HDLC) {
messages.add(getHdlcFrame(p.getSettings(), frame, reply));
if (reply.position() != reply.size()) {
frame = p.getSettings().getNextSend(false);
}
} else if (p.getSettings().getInterfaceType() == InterfaceType.PDU) {
messages.add(reply.array());
break;
} else {
throw new IllegalArgumentException("InterfaceType");
}
}

GXDLMS.cs:

//Command is not add to next PDUs.
while (reply.Position != reply.Size)
{
if (p.settings.InterfaceType == Enums.InterfaceType.WRAPPER)
{
messages.Add(GetWrapperFrame(p.settings, p.command, reply));
}
else if (p.settings.InterfaceType == Enums.InterfaceType.HDLC ||
p.settings.InterfaceType == Enums.InterfaceType.HdlcWithModeE)
{
messages.Add(GetHdlcFrame(p.settings, frame, reply));
if (reply.Position != reply.Size)
{
frame = p.settings.NextSend(false);
}
}
else if (p.settings.InterfaceType == Enums.InterfaceType.PDU)
{
messages.Add(reply.Array());
break;
}
else if (p.settings.InterfaceType == Enums.InterfaceType.Plc)
{
int val;
if (p.command == Command.Aarq)
{
val = 0x90;
}
else
{
val = p.settings.Plc.InitialCredit << 5;
val |= p.settings.Plc.CurrentCredit << 2;
val |= p.settings.Plc.DeltaCredit & 0x3;
}
messages.Add(GetPlcFrame(p.settings, (byte)val, reply));
break;
}
else
{
throw new ArgumentOutOfRangeException("InterfaceType");
}
}

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, You are right. Thank you…

Hi,

You are right. Thank you for pointing this out. This is now fixed to version 4.0.77.

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