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. Getting Objetcs of DLMS/COSEM By OBIS Code.

Getting objetcs of DLMS/COSEM by 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 pradson , 5 December, 2017
Forums
General discussion

Hi,

I am new for DLMS/COSEM. I want just try to make DLMS/COSEM Client. I want read a single register's data.
I have tried below mentioned code but it goes

"TRACE("Err! Failed to read register: Access Error : Device reports a undefined object" here.

Kindly suggest me.

if ((ret = comm.Connect("localhost", 4061)) != 0)
{
TRACE("Connect failed %s.\r\n", CGXDLMSConverter::GetErrorMessage(ret));
return 1;
}
if ((ret = comm.InitializeConnection()) != 0)
{
TRACE("InitializeConnection failed %s.\r\n", CGXDLMSConverter::GetErrorMessage(ret));
return 1;
}

std::string value;
CGXDLMSObject *obj = new CGXDLMSObject(DLMS_OBJECT_TYPE_ALL, "0.0.1.0.0.255");
if ((ret = comm.Read(obj, 3, value)) != 0)
{
TRACE("Err! Failed to read register: %s", CGXDLMSConverter::GetErrorMessage(ret));
}
else
{
TRACE("Test: %s", value.c_str());
}

Thanks & Regards,
Pradson

pradson

8 years 6 months ago

Help needed in reading only wanted objects

Could anybody help me???

Thanks...

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Getting objetcs of DLMS/COSEM by OBIS code.

Hi,

You try to read the object that doesn't exist. Check your logical name. Read your meter with GXLMDSDirector first to check what kind of objects you have.

BR,
Mikko

pradson

8 years 6 months ago

Getting objetcs of DLMS/COSEM by OBIS code.

Hi,

Thanks for your prompt response.
Actually I am using "GuruxDLMSServerExample" application as a meter and this ("0.0.1.0.0.255") OBIS code is for clock object.

The below mentioned code is working. kindly refer.

CGXDLMSClock *clock = new CGXDLMSClock("0.0.1.0.0.255");
if ((ret = comm.Read(clock, 2, value)) != 0)
{
TRACE("err! failed to read register: %s", CGXDLMSConverter::GetErrorMessage(ret));
}
else
{
TRACE("3 result isssss: %s", value.c_str());
}

Actually I have to skip the association view and want to read only single object with the help of OBIS code.
Is any function available which take OBIS code as a argument and return an object of the device to read???

or

any common object suppose "CGXDLMSxyz" which take any device's objects and passes it to read device data????

Kindly refer the mentioned code.

CGXDLMSxyz *obj = new CGXDLMSxyz("0.0.1.0.0.255");
if ((ret = comm.Read(obj , 2, value)) != 0)
{
TRACE("err! failed to read register: %s", CGXDLMSConverter::GetErrorMessage(ret));
}
else
{
TRACE("3 result isssss: %s", value.c_str());
}

Kindly suggest me. What should I do?

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Getting objetcs of DLMS/COSEM by OBIS code.

Hi,
When you are reading the object from the meter, you must know object type and it must be correct.
If the object type is wrong "undefined object" exception is returned.
Check your object type.

Save Logical name and object type so you don't need to read association view.

BR,

Mikko

  • 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