Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Register Value In Gurux.DLMS.CPP Missing

Register value in Gurux.DLMS.CPP missing

Forum Rules

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.

By jankrejci , 5 January, 2018
Forums
Gurux.DLMS

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?

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

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

jankrejci

8 years 5 months ago

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.

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

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)
}
}
}

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin