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

9 months 3 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

  • Mon, 12/29/2025 - 10:38
    Gurux.Serial.Android 3.0.5
  • Mon, 12/15/2025 - 08:11
    Gurux.DLMS.Net 4.0.87
  • Fri, 12/12/2025 - 08:38
    Gurux.DLMS.Python 1.0.195
  • Thu, 12/11/2025 - 13:22
    Gurux.DLMS.Python 1.0.194
  • Thu, 12/11/2025 - 11:01
    gurux.dlms.java 4.0.88

New forum topics

  • Gurux DLMS Android App
  • AMR support for bidirectional meters.
  • addition of new object in object list, meter not working
  • old meter take to much time(l&t)
  • Unable to connect L&T ER300P Meter
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin