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. Problem With Get Data CGXDLMSProfileGeneric On Server Side

Problem with get data CGXDLMSProfileGeneric on server side

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.

Profile picture for user Dmitry
By Dmitry , 20 October, 2021
Forums
Gurux.DLMS

Hi, Mikko!

I try to capture CGXDLMSProfileGeneric and read it with DLMSDIrector.
Here my code:
std::string name("0.0.94.7.138.255");
CGXDLMSProfileGeneric* lst = new CGXDLMSProfileGeneric(name);
lst->SetAccess(2, DLMS_ACCESS_MODE::DLMS_ACCESS_MODE_READ);
lst->SetAccess(3, DLMS_ACCESS_MODE::DLMS_ACCESS_MODE_READ);
lst->SetCapturePeriod(0);

CGXDLMSData *d1 = new CGXDLMSData("0.0.94.7.138.1");
CGXDLMSVariant id1=111;
d1->SetValue(id1);
d1->GetAttributes().push_back(CGXDLMSAttribute(2, DLMS_DATA_TYPE_UINT8));
GetItems().push_back(d1);

CGXDLMSData *d2 = new CGXDLMSData("0.0.94.7.138.2");
CGXDLMSVariant id2=112;
d2->SetValue(id2);
d2->GetAttributes().push_back(CGXDLMSAttribute(2, DLMS_DATA_TYPE_UINT8));
GetItems().push_back(d2);

lst->AddCaptureObject(d1, 2, 0);
lst->AddCaptureObject(d2, 2, 0);
lst->SetProfileEntries(5000);

GetItems().push_back(lst);

lst->Capture(this);

But in DLMSDirector empty columns after read. Entires 1 of 5000.

Log from DLMSDirector:
16:42:55 Access Request
7E A0 56 03 41 70 62 78 E6 E6 00 D9 C0 00 00 02 00 06 01 00 07 00 00 5E 07 8A FF 04 01 00 07 00 00 5E 07 8A FF 05 01 00 07 00 00 5E 07 8A FF 06 01 00 07 00 00 5E 07 8A FF 02 01 00 07 00 00 5E 07 8A FF 07 01 00 07 00 00 5E 07 8A FF 08 06 00 00 00 00 00 00 C8 43 7E
16:42:55
7E A0 45 41 03 36 24 7F E6 E7 00 DA C0 00 00 02 00 00 06 06 00 00 00 00 16 01 02 04 12 00 00 09 06 00 00 00 00 00 00 0F 00 12 00 00 00 06 00 00 00 01 06 00 00 13 88 06 01 00 01 00 01 00 01 03 01 00 01 00 7B AB 7E

Both request and answer in Gurux translator on press "Translate" button show message "Invalid DLMS Framing."

How to show 111 and 112 values in columns in DLMSDirector?
Thanks!

Profile picture for user Dmitry

Dmitry

4 years 7 months ago

For debug i commented row

For debug i commented row with code:
settings.SetIndex(settings.GetIndex() + 1);
(see attached image)
in method int CGXDLMSProfileGeneric::GetData(
CGXDLMSSettings& settings,
CGXDLMSValueEventArg& e,
std::vector< std::vector<CGXDLMSVariant> >& table,
std::vector<std::pair<CGXDLMSObject*, CGXDLMSCaptureObject*> >& columns,
CGXByteBuffer& data)

And all rows show in DLMSDirector OK.
But i don't shure is it correct fix.

Image
Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi,

Hi,

Thank you for this info. I can repeat this and I know the reason. Your fix will solve this with your data, but it might cause problems when you have a lot of rows. Access service works with simple COSEM objects, but Profile Generic is causing problems. I need to think about this a little bit.

You can fix this temporarily if you remove Access conformance bit from server like this:
SetConformance((DLMS_CONFORMANCE) (GetConformance() & ~DLMS_CONFORMANCE_ACCESS));

Or then you un-check the Access From Supported Services -tab in GXDLMSDirector.

BR,
Mikko

bushidik

2 years 4 months ago

Can you please provide an…

Can you please provide an answer for the initial question?

I've copied the code from the first message and can't get the correct values output via DLMSDirector.
I see the values in m_CaptureObjects field - how to get these values?

Best regards!

Profile picture for user Kurumi

Kurumi

2 years 4 months ago

Hi, I'm not sure why this…

Hi,

I'm not sure why this happens, but there are a couple of reasons for this.
Select the Supported Services tab from device settings and unselect Access service. It will read each argument differently and it makes easier to solve this.

You have only two values in the buffer, not 5000. Remove this line.
lst->SetProfileEntries(5000);

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