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

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin