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. GXStructure

GXStructure

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 Srinivasan , 22 June, 2020
Forums
Gurux DLMS for Java

Im trying to do write operation using Java.

Code:
GXStructure input = new GXStructure();
input.add(0, 400);
input.add(1, 1800);
input.add(2, 4);
input.add(3, new GXDateTime(2020, 10, 22, 0,0,0,0));

Above code generate the following PDU
<SetRequest>
<SetRequestNormal>
.......
<Value>
<Structure Qty="04" >
<Int32 Value="400" />
<Int32 Value="1800" />
<Int32 Value="4" />
# 7/27/2020 9:55:00 PM
<Date Time Value="07E4071BFF0A3700FF014A00" />
</Structure>
</Value>
</SetRequestNormal>
</SetRequest>

But device report it as error like "Access Error : Device reports a unmatched type"

Expected behavior:
Meter expect the PDU exactly like
<Value>
<Structure Qty="04" >
<UInt32 Value="00000190" />
<UInt32 Value="00000708" />
<UInt8 Value="04" />
# 7/27/2020 9:55:00 PM
<OctetString Value="07E4071BFF0A3700FF014A00" />
</Structure>
</Value>

Please guide me to how to create above GXStructure using java code.

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

You can try with this.

GXStructure input = new GXStructure();
input.add(0, new GXUInt32(400));
input.add(1, GXUInt32(1800));
input.add(2, GXUInt8(4));
input.add(3, new GXDateTime(2020, 10, 22, 0,0,0,0));

BR,
Mikko

Srinivasan

5 years 11 months ago

In reply to Hi, by Kurumi

Thanks for your quick

Thanks for your quick response

As per your suggestion i got partial success :), see the below PDU
<Value>
<Structure Qty="04" >
<UInt32 Value="00000190" />
<UInt32 Value="00000708" />
<UInt8 Value="04" />
# 10/22/2020 12:00:00 AM
<DateTime Value="07E40A1604000000FFFEB600" />
</Structure>
</Value>
</SetRequestNormal>

Only DateTime need to converted into OctetString type.
Please guide me on this.

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

I need to think about this a little bit. We have used XML to set values like this, but I'll think something.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi Srinivasan,

Hi Srinivasan,

We have added new class for date time octect string.
You can use it like this:

GXStructure input = new GXStructure();
input.add(0, new GXUInt32(400));
input.add(1, GXUInt32(1800));
input.add(2, GXUInt8(4));
input.add(3, new GXDateTimeOS(2020, 10, 22, 0,0,0,0));

Now date-time is sent as an octet string.

BR,
Mikko

Srinivasan

5 years 11 months ago

Sorry for the late response.

Sorry for the late response.

I Have followed the above code snippet, which is also not giving correct datatype. PFB for Request PDU:
<Structure Qty="04" >
<UInt32 Value="0000012C" />
<UInt32 Value="00000708" />
<UInt8 Value="04" />
# 09/07/20, 7:00 AM
<DateTime Value="07E407080314000000014A00" />
</Structure>

Expected:
<Structure Qty="04" >
<UInt32 Value="0000012C" />
<UInt32 Value="00000708" />
<UInt8 Value="04" />
# 09/07/20, 7:00 AM
<OctetString Value="07E407080314000000014A00" />
</Structure>

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

This is fixed. Update to the latest version (4.0.19).

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