Hi,
I am going to read active energy from a meter. As I am working based on logical name referencing, So I found that I need a LN constructor of CGXDLMSObject class as the input of GXClient::Read function. But I do not know how to set ln variable for CGXDLMSObject(). Could you help me?
Generally, how can I get normal request for active energy and then decode the response?
Thanks in advance.
I used below source, however it sends zero to the meter instead of OBIS code.
char *cstr1 = "0101010800FF";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);
Thank you for your kind response.
I changed my code as below, but the meter yet sends zero as Instance Id.
Could you help me? What's wrong with my source code?
char *cstr1 = "1.1.1.8.0.255";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);
The source used
I used below source, however it sends zero to the meter instead of OBIS code.
char *cstr1 = "0101010800FF";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);
Logican name referencing
Hi,
You should give OBIS code as dot notation.
Something like:
"1.1.1.8.0.255"
BR,
Mikko
Fill logical name variable
Hi,
Thank you for your kind response.
I changed my code as below, but the meter yet sends zero as Instance Id.
Could you help me? What's wrong with my source code?
char *cstr1 = "1.1.1.8.0.255";
basic_string <char> str1 (cstr1, sizeof(cstr1));
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, str1);
comm.Read(&pObject, 2, value);
Best regards,
Fill logical name variable
Hi again,
I changed the code as below:
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, "1.1.1.8.0.255");
comm.Read(&pObject, 2, value);
and then I got the result.
Thank you.
Fill logical name variable
Hi,
You should start to use New API for ANSI C++.
It's faster and and we have made several improvements.
You can read more here:
http://www.gurux.fi/newAPI
BR,
Mikko