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 4 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • gurux_dlms.GXDateTime.GXDateTime object Error in Python
  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin