Reading L & t meter using Indian Standard

18 posts / 0 new
Last post
sachinar007
Reading L & t meter using Indian Standard

Hi Mikko,

I am trying to read Profile Generic parameters from L & T , I am able to read Events 1, 2,3,4,5 using Gurux.DLMS.Client.Example.Net without any changes. but can't able to read 1.0.94.91.0.255 , 1.0.99.1.0.255 either by range or read by range or by index.

Where as i can read it through GuruxDirect, using Indian stand, lnt1 as password, Client add =20, but in this case also if i read 1.0.94.91.0.255 using read by index or range then it does not read it again with normal way ie All option.
Also same for 1.0.99.1.0.255 OBIS code, It can be read by range. but if read this OBIS code by Index and then again tried with range then it doesn't read again by range.

Kindly suggest.

Kurumi
Kurumi's picture

Hi,

Please, don't add trace if there is nothing wrong. I believe that read by entry is not implemented to the meter. That is a quite common. Try to set start and end time so minutes and seconds are zero.

Like: 01:00:00

Some meters are expecting that start and end times are hourly based.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

As suggested, Still I am not able to read real time profile Generic 1.0.94.91.0.255 code this has only one row .

But now I am able to read block data 1.0.99.1.0.255 ie 15 minutes interval.
code sample for reading last 4 days
object[] rows = ReadRowsByRange(it as GXDLMSProfileGeneric, DateTime.Now.Date.AddDays(-4), DateTime.Now.Date.AddHours(11));

Kindly suggest.

Sachin Ambre

Kurumi
Kurumi's picture

Hi,

1.0.94.91.0.255 is Instantaneous Profile. There should be only current values and there is only one row.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

yes Mikko,

but i am not able to read it as per suggestion .

Sachin Ambre

Kurumi
Kurumi's picture

Hi Sachin,

Try to read it using normal read. Like this:

Read(it, 3);

I don't believe that ReadRowsByRange is implemented for 1.0.94.91.0.255.

Try to read it using GXDLMSDirector first.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

I am able to read it now. but it returns object and can see data values in collection. So I tried to loop it as below code sample. But unable to get data. Can you Please share code/ logic to retrieve data from collection.

object rows = Read(it, 3);

foreach (GXKeyValuePair<GXDLMSObject, GXDLMSCaptureObject> row in (IEnumerable<Gurux.DLMS.GXKeyValuePair<Gurux.DLMS.Objects.GXDLMSObject, Gurux.DLMS.Objects.GXDLMSCaptureObject>>)rows)
{
code to find data.
}

Sachin Ambre

Kurumi
Kurumi's picture

Hi Sachin,

You are looping captured objects (columns), not the buffer. Find GetProfileGenerics-method from the client example. It does what you want to do.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

Instead of reading like Read(it, 3) I read by Read(it, 2) post this
I did like below code it gives me data. i just wanted to confirm it is correct way? if not suggest me

object[] rows = (object[])Read(it, 2);
StringBuilder sb = new StringBuilder();
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());

Sachin Ambre

Kurumi
Kurumi's picture

Hi Sachin,

When you read #2 you read capture object (columns). You need to read it first, but data is in attribute #3.
If you read only #2, buffer is empty.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

can below code work correctly for reading 1.0.94.91.0.255 ? if not please suggest.

GXDLMSProfileGeneric it = new GXDLMSProfileGeneric("1.0.94.91.0.255");
Read(it, 3);
GXDLMSObject[] cols = (it as GXDLMSProfileGeneric).GetCaptureObject();

object[] rows = (object[])Read(it, 2);
foreach (object[] DrRow in rows)
{
value = DrRow[rowIndex];
get data by index.
}

Sachin Ambre

Kurumi
Kurumi's picture

Hi Sachin,

It looks correct. You have all the column items in DrRow. Now you just loop them.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

thanks it is working now.. But now port hang issue occurred after first successful data fetch, I need to unplug Ethernet cable and plug it again in meter. post that again it block after one request.

I am currently building multi thread application so in each read i am doing below steps in while loops. but after first while it says connection disallowed. Where as when i follow same step through gurux director then it works without hang issue.

1 Create new media
2. assign ip and port
3. create client object.
4. create reader object
5. open media
6. then InitializeConnection();
7. read Generic Profile by index 3 and then by 2
8 collect data
9 call reader.Close()

secondly When I put while loop only for step 7 & 8 then it works correctly but after application close it through same error. I tried this only to find out issue. i have to go with first option .

Kindly suggest.

Sachin Ambre

Kurumi
Kurumi's picture

Hi,

Check are ReleaseRequest and DisconnectRequest called.
If connection is not closed correctly meter waits until inactivity timeout is elapsed before you can connect again.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

yes, both request are send to close and release port. I am using Interface type as InterfaceType.WRAPPER.

sill issue persist

Sachin Ambre

Kurumi
Kurumi's picture

Hi,

All Indian meter doesn't support protected release. Try to change cl_releaseRequest to cl_releaseRequest2, where useProtectedRelease parameter is false.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sachinar007

Hi Mikko,

I am using .net client code. I did not find suggested option in reader.close() to try it.

Kindly Suggest or provide sample code if possible.

Sachin Ambre

Kurumi
Kurumi's picture

Hi,

Set UseProtectedRelease to False. If it doesn't help try to comment ReleaseRequest. Some (older) meters can't handle it.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi