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

6 years 2 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

6 years 2 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

6 years 2 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

6 years 2 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

6 years 2 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

6 years 2 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

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
  • dw772
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin