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. Convert Byte Array To GXDLMSObject

Convert byte array to GXDLMSObject

By PLAMEN VASILEV , 15 May, 2025
Forums
Gurux.DLMS

Hello,

I have an APDU byte array, and I'd like to convert it to GXDLMSObject so I can inspect and further work with it. I see that I can use GXDLMSTranslator to translate the byte array to XML, but I want to parse the byte array to a native GXDLMSObject. Is there any way to do that?

Many thanks
Plamen

PLAMEN VASILEV

1 year ago

So what I have is the…

So what I have is the following:
I have a hex string coming from an Hexing DCU grid meter reading upload.
The hex string is something like this:
0001010204090C07E902190200000000FF8800110006000000050600000032
which the Gurux PDU XML translator translates to:
<Data="01010204090C07E902190200000000FF8800110006000000050600000032" />
If I add C401C6 at the beginning to it - I am able to parse it as a response:
C401C60001010204090C07E902190200000000FF8800110006000000050600000032

<GetResponse>
<GetResponseNormal>
<!--Priority: HIGH ServiceClass: CONFIRMED invokeID: 6-->
<InvokeIdAndPriority Value="C6" />
<Result>
<Data>
<Array Qty="01" >
<Structure Qty="04" >
<!--2025-02-25 00:00:00-->
<OctetString Value="07E902190200000000FF8800" />
<UInt8 Value="00" />
<UInt32 Value="00000005" />
<UInt32 Value="00000032" />
</Structure>
</Array>
</Data>
</Result>
</GetResponseNormal>
</GetResponse>

-- Is there any way programatically to parse the byte array to a Gurux object so I can work with it. I don't want to have to parse the result XML if possible.

Thanks again
Plamen

PLAMEN VASILEV

1 year ago

Nevermind, I figured it out…

Nevermind, I figured it out. I removed the first byte and then used GXDLMSClient.getValue() and it returned a GXArray.

Profile picture for user Kurumi

Kurumi

1 year ago

Hi Plamen, I don't know why…

Hi Plamen,

I don't know why there is that one extra byte, but you are right. The data is there after you remove the first byte.

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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin