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. Gurux.dlms.Delphi

Gurux.dlms.Delphi

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 TaeSoo_Han , 14 October, 2019
Forums
Gurux.DLMS

Parsing of Date and Time is impossible in Gurux.dlms.delphi

Hello, Sir

I found estimated bug of gurux.dlms.delphi source code as bellows

(1) Thanks to example of TGXProgram, I got Get-Response from meter using Client.GetObjectRequest() and PDU data is "09 0C 07 E3 0A 0C 06 12 0D 1F 01 80 00 02"
it is date and time data of meter.

(2) When above PDU data is applied to Client.ParseObjects(Reply.Data, True), Invalid response Exception error is occurred as bellows;

size := buffer.GetUint8();
if size <> 1 then
raise TGXDLMSException.Create('Invalid response.');

First byte of PDU data is "09" and it is applied to size.

data Time of Obis code is 0.0.1.0.0.255 and it is general code.

Is there any parse function of data time of obis code besides Client.ParseObjects()?

Please rely to my question.

Thanks a lot.

Image
Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

ParseObjects method is called only after you have read the association view.

I propose that you check TGXProgram.Read -method. It reads wanted object and updates value.

BR,

Mikko

TaeSoo_Han

6 years 8 months ago

Thank you sir, I will check

Thank you sir, I will check it according to your good comment.

TaeSoo_Han

6 years 7 months ago

Dear Sir,

Dear Sir,

I checked read-method of TGXP Program and found it same of GetObjectsRequest to get sender data to meter.

When I send Activity Calendar data day profile ( array, structure of unsigned, Structure of octet string and long unsigned) to get responding data from meter, I got data using "TGXDLMSClient.GetData(reply: TBytes; data: TGXReplyData)" and it contained various kind of data like this;

resultval := Common.GetData(Reply.Data, info);
--> resultval is Tvalue data type.

Reply.Data of TGXByteBuffer is as bellows;

01 0A // Array data type, 10ea
02 02 // Structure data type, member varialbe 2ea
11 00 // Unsigned data type
01 0c // array data type 12ea
...

when I extract data from resultval of Tvalue like this
"extractdata := resultval.AsType<Tbytes>",

function TValue.AsType<T>: T;
begin
if not TryAsType<T>(Result) then
raise EInvalidCast.CreateRes(@SInvalidCast);
end;

"Invalid class typecast" exception error is occurred.

The reason of exception error is seemed to containing various data type of resultval (Tvalue type).

How can I solve this status to extract data from resultval?

Please comment to find best function or method.

Thanks a lot.

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Create TGXDLMSActivityCalendar object and read it. Then you can access read attribute from TGXDLMSActivityCalendar parameters.

BR,
Mikko

TaeSoo_Han

6 years 7 months ago

Thanks a lot Sir.

Thanks a lot Sir.

  • 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