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. GuruxDLMSServerExample C++

GuruxDLMSServerExample C++

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 Filip Grepl , 7 July, 2021
Forums
Gurux.DLMS

Hi,

I have tried run DLMSServerExample and have read its objects with DLMS Director. When I have read the whole group of objects, for example Registers, everything has worked correctly. But if I have read only single object (with right click on object and select Read option or Read object option), this exception on DLMSServerExample server occurs:

Exception: read access violation.
**_Pnext** – 0xDDDDDDE1.

GuruxDLMSServerExample.exe!std::_Container_base12::_Orphan_all() Line 1206 C++
GuruxDLMSServerExample.exe!std::vector<CGXDLMSVariant,std::allocator<CGXDLMSVariant>>::clear() Line 1390 C++
GuruxDLMSServerExample.exe!CGXDLMSVariant::Clear() Line 428 C++
GuruxDLMSServerExample.exe!CGXDLMSVariant::~CGXDLMSVariant() Line 455 C++
GuruxDLMSServerExample.exe!CGXDLMSValueEventCollection::~CGXDLMSValueEventCollection() Line 51 C++
GuruxDLMSServerExample.exe!CGXDLMSLNCommandHandler::HandleAccessRequest(CGXDLMSSettings & settings, CGXDLMSServer * server, CGXByteBuffer & data, CGXByteBuffer * replyData, CGXDLMSTranslatorStructure * xml, unsigned char cipheredCommand) Line 1525 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleCommand(DLMS_COMMAND cmd, CGXByteBuffer & data, CGXServerReply & sr, unsigned char cipheredCommand) Line 964 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleRequest(CGXServerReply & sr) Line 1204 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleRequest(CGXDLMSConnectionEventArgs & connectionInfo, CGXByteBuffer & data, CGXByteBuffer & reply) Line 1070 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleRequest(CGXDLMSConnectionEventArgs & connectionInfo, unsigned char * buff, unsigned short size, CGXByteBuffer & reply) Line 1095 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleRequest(unsigned char * buff, unsigned short size, CGXByteBuffer & reply) Line 1085 C++
GuruxDLMSServerExample.exe!CGXDLMSServer::HandleRequest(CGXByteBuffer & data, CGXByteBuffer & reply) Line 1061 C++
GuruxDLMSServerExample.exe!ListenerThread(void * pVoid) Line 185 C++

I have tried read the objects with my own client, which uses the Gurux library. If I have read single register everything has worked correctly. I have tried to decode the messages which are sent from my client and from DLMS Director. The difference is that my client send request to the server for each attribute of object separately, but DLMS Director send one request which contains all attributes (multiple references service). The DLMS Director uses this service (send same message) also if I unchecked it in Device Properties -> Supported Services.

Note: This problem occurs only with LN referencing.

I don't know how to create the server to support the multiple references service.

Thank you in advance for your answer.

Profile picture for user Kurumi

Kurumi

4 years 11 months ago

Hi,

Hi,

Maybe it's the object that you try to read.
What compiler you are using? I just checked this and it works without problems, so I need more info.

BR,
Mikko

Filip Grepl

4 years 11 months ago

Hi,

Hi,

I have simply downloaded the source code from https://github.com/Gurux/Gurux.DLMS.cpp. Then I have built it with VS Community 2019 and have ran the GuruxDLMSServerExample. I didn't add any of my code.

After that I add new device to the DLMS Director. You can see the configuration of DLMS Director on the screenshot below.

The reading works on Data objects and doesn't work (the exception which I described above occurs) for example on Clock, Register, IecHdlcSetup and Security Setup objects.

Thank you so much.

Philip

Image

germka

4 years 10 months ago

Got the same bug while read

Got the same bug while read profile generic on ServerExample, old version of GuruxCGXDLMSDirector reads data normaly, and new version sends incorrect request to server or server unable correct handle request data, such as m_RowToPdu and m_Selector always equal 0.

Image

germka

4 years 10 months ago

In reply to Got the same bug while read by germka

On old version same request

On old version same request of same profile generic on same ServerExample.

Image
Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

Please, don't add images. They are hard to read. When you are reading profile generic do you try to read with "Read by Entry", "Read by Range" or "Read All"?

BR,
Mikko

germka

4 years 10 months ago

In reply to Hi, by Kurumi

Hi, i am trying to read by

Hi, i am trying to read by range (in default it "read last 0 days")

  • 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