I am using below functions to get the value of Active Power:
CGXDLMSVariant value;
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, "1.1.1.8.0.255");
comm.Read(&pObject, 2, value);
long unsigned int IntValue = value.ToDouble();
But value variable in CGXCommunication::Read function returns nothing. (The value variable in not used in the function.
This way worked with the previews version written without Linux OS option.
could you help me how to read an active power value?!
I solved the problem by making below changes in the source codes:
1. In GuruxDLMSClientExample.cpp file, in main function, after initializing, I added:
CGXDLMSVariant value;
CGXReplyData reply;
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, "1.1.1.8.0.255");
comm.Read(&pObject, 2, reply);
value = reply.GetValue();
printf("Register value is:(int) %d\n", value.iVal);
2. In CGXCommunication::Read function, I modified the function inputs:
int CGXCommunication::Read(CGXDLMSObject* pObject, int attributeIndex, /*CGXDLMSVariant& value*/CGXReplyData& reply)
3. In CGXCommunication::Read function, I commented:
//value.Clear();
//CGXReplyData reply;
4. In CGXCommunication::UpdateAccess function, I commented all except:
return ERROR_CODES_OK;
The number four change is not a efficient way, but it helps the software to work.
Could you help me how to solve the problem more efficiently?
Hi Leila,
I am also trying to read obis value of my meter i fallowed your changes in gurux c++ code, it returns nothing for the same obis code and if i use the obis code of voltage my code getting crash please guide me to solve this issue.
Read the value of an OBIS code
Hi,
I solved the problem by making below changes in the source codes:
1. In GuruxDLMSClientExample.cpp file, in main function, after initializing, I added:
CGXDLMSVariant value;
CGXReplyData reply;
CGXDLMSObject pObject(OBJECT_TYPE_REGISTER, "1.1.1.8.0.255");
comm.Read(&pObject, 2, reply);
value = reply.GetValue();
printf("Register value is:(int) %d\n", value.iVal);
2. In CGXCommunication::Read function, I modified the function inputs:
int CGXCommunication::Read(CGXDLMSObject* pObject, int attributeIndex, /*CGXDLMSVariant& value*/CGXReplyData& reply)
3. In CGXCommunication::Read function, I commented:
//value.Clear();
//CGXReplyData reply;
4. In CGXCommunication::UpdateAccess function, I commented all except:
return ERROR_CODES_OK;
The number four change is not a efficient way, but it helps the software to work.
Could you help me how to solve the problem more efficiently?
Best regards,
Leila
Read the value of an OBIS code
Hi Leila,
I am also trying to read obis value of my meter i fallowed your changes in gurux c++ code, it returns nothing for the same obis code and if i use the obis code of voltage my code getting crash please guide me to solve this issue.
Read the value of an OBIS code
Hi Leila,
I have miss this post. I'm sorry that I have not reply. What meter you try to read? Can you send trace to me by email. We'll check this.
BR,
Mikko