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. Forums
  3. Read The Value of An OBIS Code

Read the value of an OBIS code

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 Leila , 23 April, 2016
Forums
Gurux.DLMS

Hi,

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?!

Best regards,
Leila

Leila

10 years 3 months ago

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

vamsi

9 years 3 months ago

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.

Profile picture for user Kurumi

Kurumi

9 years 3 months ago

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

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
More

Who's new

  • software_P
  • eloisedc16
  • OlegVoiva
  • Martaepili
  • Vegazone-Alini
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin