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");
}
}
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