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. Forums
  3. Out of Order or Missing Response When Requesting Several OBIS Codes With XmlClient

Out of order or missing response when requesting several OBIS codes with xmlClient

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By karlpy , 7 December, 2020
Forums
Gurux.DLMS

Hi, I'm having a problem when I use an xml file with several OBIS codes to perform readouts with the xmlClient. Sometimes the responses get mixed up.
These are the OBIS codes I'm reading

xml file link https://drive.google.com/file/d/18VCavxm5R-XO7zV9rFRxfhqw2EAbWBUd/view?…

<?xml version="1.0" encoding="utf-8"?>
<Messages>

<GetRequest>
<GetRequestNormal>
<InvokeIdAndPriority Value="193" />
<AttributeDescriptor>
<!--REGISTER-->
<ClassId Value="3" />
<!--1.0.15.8.0.255-->
<InstanceId Value="01000F0800FF" />
<AttributeId Value="2" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>

<GetRequest>
<GetRequestNormal>
<InvokeIdAndPriority Value="193" />
<AttributeDescriptor>
<!--REGISTER-->
<ClassId Value="3" />
<!--1.0.5.8.0.255-->
<InstanceId Value="0100050800FF" />
<AttributeId Value="2" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>

<GetRequest>
<GetRequestNormal>
<InvokeIdAndPriority Value="193" />
<AttributeDescriptor>
<!--REGISTER-->
<ClassId Value="3" />
<!-- 1.0.1.8.1.255 -->
<InstanceId Value="0100010801FF" />
<AttributeId Value="2" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>

</Messages>

Sometimes one value doesn't get sent back, for example active energy, then the other results get mixed up when writing to the database.

This is the part of my code which handles the replies

switch (action_name)
{
// if energia activa
case "01000F0800FF":
cmd_readouts.CommandText = "INSERT INTO readouts (active_energy, nis) VALUES (@energy, @nis)";
break;
// if energia reactiva
case "0100050800FF":
cmd_readouts.CommandText = "UPDATE readouts SET reactive_energy=@energy, status=@status WHERE date IN (SELECT date FROM readouts WHERE nis=@nis ORDER BY date DESC LIMIT 1)";
break;
// if cierre del mes
case "0100010801FF":
cmd_readouts.CommandText = "UPDATE readouts SET sum_li_active_power=@energy, status=@status WHERE date IN (SELECT date FROM readouts WHERE nis=@nis ORDER BY date DESC LIMIT 1)";
break;
default:
throw new ArgumentException("SQL request not supported!");
}

I also added the complete code which handles the reply in this link:
https://drive.google.com/file/d/1limqLA8M5e-VCxb1OLZuEAMePYIRHl9q/view?…

Image
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • Anaglyfos Trading CC
  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin