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. Error! Failed To Read First Row

Error! Failed to read first row

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 Techapirant , 18 October, 2019
Forums
Gurux.DLMS

Hello,

I am using .Net Gurux Client Example and trying to read Profile Generic (1.0.99.1.0.255) over TCP/IP
Wrapper mode but It results error as Error! Failed to read first row Access denied Read write where as with same configuration over DLMS Director it works.
Can You please tell me what else I have to do in case of .Net Client Example ?

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Change authentication level to the same as in GXDLMSDirector.

BR,

Mikko

Techapirant

6 years 7 months ago

Hello,

Hello,

In my case authentication level in both DLMS Director and Client Example .Net is same.
'Low with Password'

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

They are both using the same source code. Can you post profile generic read and reply trace here? Post only those 2 lines. I'll check what might be the problem.

BR,
Mikko

Techapirant

6 years 7 months ago

Below is the code and

Below is the code and attached is the log file for reference

public void GetProfileGenerics()
{
//Find profile generics register objects and read them.
foreach (GXDLMSObject it in Client.Objects.GetObjects(ObjectType.ProfileGeneric))
{

//If trace is info.
if (Trace > TraceLevel.Warning)
{
Console.WriteLine("-------- Reading " + it.GetType().Name + " " + it.Name + " " + it.Description);
}
long entriesInUse = Convert.ToInt64(Read(it, 7));
long entries = Convert.ToInt64(Read(it, 8));
//If trace is info.
if (Trace > TraceLevel.Warning)
{
Console.WriteLine("Entries: " + entriesInUse + "/" + entries);
}
//If there are no columns or rows.
if (entriesInUse == 0 || (it as GXDLMSProfileGeneric).CaptureObjects.Count == 0)
{
continue;
}

//All meters are not supporting parameterized read.
if ((Client.NegotiatedConformance & (Gurux.DLMS.Enums.Conformance.ParameterizedAccess | Gurux.DLMS.Enums.Conformance.SelectiveAccess | Gurux.DLMS.Enums.Conformance.Read)) != 0)
{
Read(it, 2);

try
{
//Read first row from Profile Generic.

object[] rows = ReadRowsByEntry(it as GXDLMSProfileGeneric, 1, 1);
//If trace is info.
if (Trace > TraceLevel.Warning)
{
StringBuilder sb = new StringBuilder();
foreach (object[] row in rows)
{
foreach (object cell in row)
{
if (cell is byte[])
{
sb.Append(GXCommon.ToHex((byte[])cell, true));
}
else
{
sb.Append(Convert.ToString(cell));
}
sb.Append(" | ");
}
sb.Append("\r\n");
}
Console.WriteLine(sb.ToString());
}
}
catch (Exception ex)
{
Console.WriteLine("Error! Failed to read first row: " + ex.Message);
//Continue reading.
}
}
//All meters are not supporting parameterized read.
if ((Client.NegotiatedConformance & (Gurux.DLMS.Enums.Conformance.ParameterizedAccess | Gurux.DLMS.Enums.Conformance.SelectiveAccess)) != 0)
{
try
{
//Read last day from Profile Generic.
object[] rows = ReadRowsByRange(it as GXDLMSProfileGeneric, DateTime.Now.Date, DateTime.MaxValue);
//If trace is info.
if (Trace > TraceLevel.Warning)
{
StringBuilder sb = new StringBuilder();
foreach (object[] row in rows)
{
foreach (object cell in row)
{
if (cell is byte[])
{
sb.Append(GXCommon.ToHex((byte[])cell, true));
}
else
{
sb.Append(Convert.ToString(cell));
}
sb.Append(" | ");
}
sb.Append("\r\n");
}
Console.WriteLine(sb.ToString());
}
}
catch (Exception ex)
{
Console.WriteLine("Error! Failed to read last day: " + ex.Message);
//Continue reading.
}
}

}
}

Techapirant

6 years 7 months ago

Hello,

Hello,

I am getting values in this as I enable breakpoint
Read(it, 2)

How can I iterate for loop on Read(it, 2) to get all the values ?

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Please, don't post client example or full log. I'll ask admin to remove it.

BR,
Mikko

Techapirant

6 years 7 months ago

Hello,

Hello,

Using Below code I am able to read and get the values
var obj = Read(it, 2);
object[] arr = obj as object[];

How can I get buffer based on timestamp as start time and end time ?

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

You can use ReadRowsByRange method.

BR,

Mikko

Techapirant

6 years 7 months ago

In reply to Hi, by Kurumi

Using ReadRowsByRange I am

Using ReadRowsByRange I am getting error as Access Error : Device reports Read-Write denied
object[] arr_temp = ReadRowsByRange(it as GXDLMSProfileGeneric, Convert.ToDateTime("2019-10-11"), Convert.ToDateTime("2019-10-12"));

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Make sure that there is data between that date. Some meters are returning an error if there is no data available between the given range.

BR,
Mikko

  • 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