Hi, Im trying to understand Gurux.DLMS.CPP example app and have some misunderstanding.
Im run example server app and trying to read his values with Gurux Director, but for Register 1.1.21.25.0.255 Im getting empty /means nothing, not null or something that/ value. Doing Im something bad or its only missing the command "pRegister->setValue(123456)" in the server code?
Thanks, Im now able to create object with static value.
About dynamic values - what means PreRead? I found some objects of this name in the code, but I dont undestand them. I suppose, that i must call modified instance of this object before reading the register, right? Sorry about this stupid question, I havesome knowledge about DLMS, but i dont fully understand how works some objects, i have only excepts of dlms specification.
Register value in Gurux.DLMS.CPP missing
Hi,
If your value is static (it don't change) you can set when you create the object. If that is dynamic you can update the new value on PreRead.
BR,
Mikko
Register value in Gurux.DLMS.CPP missing
Thanks, Im now able to create object with static value.
About dynamic values - what means PreRead? I found some objects of this name in the code, but I dont undestand them. I suppose, that i must call modified instance of this object before reading the register, right? Sorry about this stupid question, I havesome knowledge about DLMS, but i dont fully understand how works some objects, i have only excepts of dlms specification.
Register value in Gurux.DLMS.CPP missing
Hi,
You can update value dynamically like this:
void CGXDLMSBase::PreGet(std::vector<CGXDLMSValueEventArg*>& args)
{
std::string ln;
for (std::vector<CGXDLMSValueEventArg*>::iterator it = args.begin(); it != args.end(); ++it)
{
(*it)->GetTarget()->GetLogicalName(ln);
if ((*it)->GetTarget()->GetObjectType() == DLMS_OBJECT_TYPE_REGISTER &&
&& ln == "Change to Register LN")
{
CGXDLMSRegister* pRegister = (CGXDLMSRegister*)(*it)->GetTarget();
pRegister->setValue(123456)
}
}
}