Skip to main content
Home
for DLMS smart meters

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

8 months 2 weeks 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

  • Thu, 12/11/2025 - 13:22
    Gurux.DLMS.Python 1.0.194
  • Thu, 12/11/2025 - 11:01
    gurux.dlms.java 4.0.86
  • Wed, 12/10/2025 - 08:45
    gurux.dlms.java 4.0.85
  • Tue, 12/02/2025 - 10:21
    gurux.dlms.c 9.0.2512.0201
  • Mon, 12/01/2025 - 13:55
    Gurux.DLMS.Python 1.0.193

New forum topics

  • Gurux.Net
  • GXTIME Conversion Issue
  • DLMS Meter Gurux DLMS Director Properties
  • Using MAX3232 + FT232RL to Energy meter with GXDLMS Director
  • Incomplete Firmware Upgrade Process
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin