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.
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.
Hi Mikko,
I am trying to read DLMS/COSEM compatible ER300P meter using Gurux C++.
I am able to read register and data objects properly but not able to read profile generics objects.
I am reading profile generic object "1.0.99.1.0.255" (15 Minutes) by method ReadRowsByRange() but I am unable to read it. It some times returns Error "Device reports Read-Write denied" and some times
"Invalid parameter".
Actually, same I am able to read using "DLMSDirector". So, Why I am facing these error using Gurux C++ lib? What is the missing in my code sample?
Kindly suggest me asap.
Kindly find below mentioned code sample and communication data and respected errors.
------------------------------------------------------------------------
Sample-1:
-------------------------------------------------------------------------
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.99.1.0.255");
CGXDateTime start(2019, 06, 22, 8, 0, 0, 0);
CGXDateTime end(2019, 06, 22, 9, 0, 0, 0);
obj->SetAccess(2, DLMS_ACCESS_MODE_READ);
if ((ret = comm.ReadRowsByRange(obj, start, end, rows)) != 0)
{
str = "Error: ";
str += CGXDLMSConverter::GetErrorMessage(ret);
str += "\r\n";
WriteValue(str);
}else{
WriteValue(rows.ToString());
}
------------------------------------------------------------------
Communication string:
------------------------------------------------------------------
InitializeConnection
<- 14:20:12 00 01 00 20 00 01 00 34 60 32 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 06 80 04 6C 6E 74 31 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 1D FF FF
-> 14:20:13 00 01 00 01 00 20 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 02 00 00 07
<- 14:20:18 00 01 00 20 00 01 00 40 C0 01 C1 00 07 01 00 63 01 00 FF 02 01 01 02 04 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 09 0C 07 E3 06 16 07 08 00 00 FF FE B6 00 09 0C 07 E3 06 16 07 09 00 00 FF FE B6 00 01 00
-> 14:20:19 00 01 00 01 00 20 00 05 C4 01 C1 01 03
----------------------------------------------------
Error:
----------------------------------------------------
"Device reports Read-Write denied."
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------------------------------------------------
Sample-2:
-------------------------------------------------------------------------
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.99.1.0.255");
CGXDateTime start = CGXDateTime::Now();
start.AddHours(-2);
CGXDateTime end = CGXDateTime::Now();
end.AddHours(-1);
obj->SetAccess(2, DLMS_ACCESS_MODE_READ);
if ((ret = comm.ReadRowsByRange(obj, start, end, rows)) != 0)
{
str = "Error: ";
str += CGXDLMSConverter::GetErrorMessage(ret);
str += "\r\n";
WriteValue(str);
}else{
WriteValue(rows.ToString());
}
------------------------------------------------------------------
Communication string:
------------------------------------------------------------------
InitializeConnection
<- 14:23:54 00 01 00 20 00 01 00 34 60 32 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 06 80 04 6C 6E 74 31 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 1D FF FF
-> 14:23:54 00 01 00 01 00 20 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 02 00 00 07
<- 14:23:58 00 01 00 20 00 01 00 40 C0 01 C1 00 07 01 00 63 01 00 FF 02 01 01 02 04 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 09 0C 07 E3 05 16 02 0C 17 36 FF FE B6 00 09 0C 07 E3 05 16 02 0D 17 39 FF FE B6 00 01 00
-> 14:24:00 00 01 00 01 00 20 01 FE C4 01 C1 00 01 04 02 17 09 0C 07 E3 05 16 FF 0C 1E FF FF 01 4A 00 06 00 00 13 82 06 00 00 17 39 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 2E 05 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 DF FF 02 17 09 0C 07 E3 05 16 FF 0C 2D FF FF 01 4A
00 06 00 00 13 83 06 00 00 17 47 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 2F 05 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 DF FF 02 17 09 0C 07 E3 05 16 FF 0D 00 FF FF 01 4A 00 06 00 00 13 7F 06 00 00 17 59 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 05 00 00 00 00 06 00 00
00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 2D 05 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 DF FF 02 17 09 0C 07 E3 05 16 FF 0D 0F FF FF 01 4A 00 06 00 00 13 88 06 00 00 17 B1 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 05 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 32 05 00 00 00 00 05 00
00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 DF FF
----------------------------------------------------
Error:
----------------------------------------------------
"Invalid parameter."
Thanks & Regards,
Pradson
Hi,
Hi,
The reason usually for this is that ReadRowsByRange is not implemented very well for the meter.
Some meters expect that start and end time minutes and seconds are zero. Sometimes time zone must not use. Can you read profile generic with any app? If you can, I can find the correct parameters for you.
If you can't you should contact your meter vendor and ask this from them
BR,
Mikko
Hi Mikko,
Hi Mikko,
Many thanks for your prompt help.
Actually I am able to read this meter using Gurux DLMSDirector application. I mentioned this already. And if I am able to read using DLMSDirector app, then Gurux c++ lib should have worked.
I have one doubt, whenever I read meter using DLMSDirector app by ReadRowsByRange() method and if I pass "to date-Time" greater than the upcoming sample value, then DLMSDirector app tells "Access Error : Device reports Read-Write denied".
For example:
If the range is: (08:00 to 09:15) and meter time is 09:01 or 09:14, then app reports the same error.
Kindly suggest me.
One more question:
I want to read the last value of the profile generic objects ( "1.0.99.1.0.255"(15 Minutes) , "1.0.99.2.0.255" (daily) etc...) by single query. Could it possible for this meter? Kindly suggest me this also.
Thanks & Regards,
Pradson
Hi Mikko,
Hi Mikko,
I am able to read ER300P meter with method "ReadRowsByRange" using DLMSDirector app, but unable to read using Gurux C++.
Kindly suggest me asap...
Regards,
Pradson
Hi Mikko,
Hi Mikko,
I am waiting for your response.
Regards,
Pradson
Hi Mikko,
Hi Mikko,
The DLMSDirector application is working to read ER300P meter but I am facing problem in Gurux C++.
Kindly suggest me what will be the correct arguments for ReadRowsByRange() methods to read that meter?
Regards,
Pradson
Hi Mikko,
Hi Mikko,
The UpdateValue() function inside ReadRowsByRange() is returning 258 error.
Kindly check below mentioned function.
CGXCommunication::ReadRowsByRange()
{
...
ret = m_Parser->ReadRowsByRange(pObject, start, end, data); // ret =0 (Success)
ret = ReadDataBlock(data, reply); // ret =0 (Success)
ret = m_Parser->UpdateValue(*pObject, 2, reply.GetValue()); // ret = 258 (Error)
...
}
Regards,
Pradson
Hi Pradson,
Hi Pradson,
I'm sorry for the slow reply. This was a little busy week. I believe that you are right. Some meters return an error if the end time is too high. This is a meter issue, but meter manufacturers usually don't care.
I believe that star and end time must both be saved to the profile generic buffer. I propose that you set end time seconds and minutes to zero. Try if that helps.
BR,
Mikko
Hi Mikko,
Hi Mikko,
Thanks for your reply.
Actually, I want to read the last value of profile generics objects. How will I achieve this? Is any other method apart from "ReadRowsByRange()" and "ReadByEntry()" methods? Because these methods are not working. Can I make such function using Gurux C++?
Mikko, as suggested by you.
How will I save the Start and end time in the profile generic buffer?
Could you explain me with the help of a example?
For ex:
profile generic object is this:
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.99.1.0.255");
and
start and end date-time is:
CGXDateTime start(2019, 5, 30, 10, 0, 0, 0);
CGXDateTime end(2019, 5, 30, 11, 0, 30, 0);
Kindly suggest me asap.
Regards,
Pradson
Hi Pradson,
Hi Pradson,
Implementation of read by range and entry is different between devices. Some devices implement them well, some poorly.
Is read by entry working at all with your meter?
Is this working with your meter?
CGXDateTime start(2019, 5, 30,10, 0, 0, 0);
CGXDateTime end(2019, 5, 30,11, 0, 0, 0);
m_Parser->ReadRowsByRange(obj, start, end, data);
BR,
Mikko
Hi Mikko,
Hi Mikko,
Neither read by entry is working nor ReadRowsByRange with my meter.
So please suggest me what should I do?
I have to read last entry of profile generic object.
Regards,
Pradson
Hi,
Hi,
I just realize that you don't read capture objects before you read buffer.
Read attribute 2 of profile generic befo you call ReadRowsByRange. That is the reason why UpdateValue returns error.
BR,
Mikko
BR,
Mikko
Hi Mikko,
Hi Mikko,
Yes, it is working.
Thanks a lot.
Regards,
Pradson