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

  • 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

  • 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
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • LutzG
  • Ralf Schmitz
  • prosper.abanga
  • moGiaco
  • RobertEncum
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin