I am new to DLMS, I have some problem in parse the response frame while using the gurux.dlms.cpp.master.
I want to read the IC 0x15, the OBIS "0.0.40.0.0.255" and the attribute 3 by constructing the CGXDLMSObject, then I read it through the CGXCommunication::Read(). Part of code is as follows:
CGXDLMSObject *obj = new CGXDLMSObject(classId, ln);
std::vector<CGXByteBuffer> data;
int ret = comm.Read(obj, attr, nullptr, data);
I have got the correct response frame from the meter. But I want to get the payload of the frame. I have searched for the way to do it. The mothod in the link(https://www.gurux.fi/node/14896) seems does not work correctly. Part of code is as follows:
I will try to generate the request frame through the method you had mentioned.
However, my question is how should I parse a unsigned char array with the response frame from meter, for example, to verify the intergrity of the response frame and get the payload of it.
Hi,
Hi,
Don't use CGXDLMSObject. Use CGXDLMSRegister, CGXDLMSData, etc. instead. They will parse data and you don't need to do anything.
Something like this:
CGXDLMSRegister*obj = new CGXDLMSRegister(ln);
BR,
Mikko
Thank you for your reply.
Thank you for your reply.
I will try to generate the request frame through the method you had mentioned.
However, my question is how should I parse a unsigned char array with the response frame from meter, for example, to verify the intergrity of the response frame and get the payload of it.
Hi,
Hi,
DLMS is a very complicated protocol and describing it shortly is not possible.
https://www.gurux.fi/DLMSInNutshell
Good thing is that DLMS is very well documented. You can get started if you read the following standard documents.
IEC 62056-47 COSEM transport layers for IPv4 networks
IEC 62056-53 COSEM application layer
IEC 62056-61 OBIS Object identification system
I strongly propose that you use Gurux open source libraries. It will save a lot of time.
BR,
Mikko