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. Figuring Out How Set With List Feature Works In Gurux.

Figuring out how set with list feature works in gurux.

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 kedros , 14 August, 2017
Forums
Gurux DLMS for Java

Hello,
I am figuring out, how to generate an byte array with the writeList method of GXDLMSClient.
Version of gurux.dlms library is 2.1.6.

The method has following signature:
public final byte[][] writeList(final List<GXWriteItem> list)

But I am not sure, how to correctly fill the properties of GXWriteItem.
In this piece of code, I am trying to do so:

// Here I am creating object for particular class id.
ObjectType objType = ObjectType.forValue(simp.getClassid());
GXDLMSObject obj = dlms.createObject(objType);

// Setting logical name
obj.setLogicalName(simp.getObisCode());

//Creating GXWriteItem
GXWriteItem gXWriteItem = new GXWriteItem();
DataType dataType = DataType.forValue(simp.getDataType());
gXWriteItem.setDataType(dataType); // setting data type
gXWriteItem.setTarget(obj); // setting object
gXWriteItem.setIndex(simp.getAttr()); // setting attribute index

But I am unable to figure out some general mechanism, how to set the value of an GXDLMSObject.

Method setValue of GXDLMSObject appears to be unimplemented:

public void setValue(final GXDLMSSettings settings,
final ValueEventArgs e) {
throw new UnsupportedOperationException("setValue");
}

Can you please provide us an example, how to correctly use set with list, or point us to some online documentation?

Sincerely
Jaroslav Bálik

Profile picture for user Kurumi

Kurumi

8 years 9 months ago

Figuring out how set with list feature works in gurux.

Hi Jaroslav,

GXDLMSClock clock = new GXDLMSClock();
GXWriteItem item = new GXWriteItem();
//Target object. Example clock.
item.setTarget(clock);
//Attribute index.
item.setIndex(2);
//This is optional parameter. It's used because there are no unsigned values in Java.
item.setDataType(DataType.OCTET_STRING);

BR,

Mikko

kedros

8 years 9 months ago

Thank you for your response.

Thank you for your response.

  • 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