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. How To Send Data To Meter a New Obis

how to send data to meter a new obis

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

hi Mikko,
I am using the server dlms example to set some values to obis,
Suppose if i want to set some data and send that to meter, and the data type is something like <structure><long-unsigned></long-unsigned></structure> how do we add this type of value???
in the code we have obis like
e.g
void addFirmwareVersion() {
GXDLMSData d = new GXDLMSData("1.0.0.2.0.255");
d.setValue("Gurux FW 0.0.1");
getItems().add(d);
}
if I want to give the value like mentioned above how can i do that?

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,

You can do it like this:

GXStructure data = new GXStructure();
data.Add(new GXUInt16(1));
data.Add(new GXUInt16(2));

GXDLMSData d = new GXDLMSData("1.0.0.2.0.255");
d.setValue(data);

BR,
Mikko

nishitha

6 years 1 month ago

Hi Mikko,

Hi Mikko,
i have structure
long
octet-string
visible-string
How can i add these to structure, I see there are only GXUInt8,GXUInt16,GXUInt32,GXUInt64
how can i add the above values?

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

Hi,

Hi,

data.Add(new Short(2));
data.Add(new Long(2));
data.Add(new byte[]{1, 2, 3});
data.Add("Gurux");

BR,
Mikko

Rubent

5 years 3 months ago

Hi Mikko,

Hi Mikko,

I am having a problem like the one described in this post.
I use gurux as a server so that it acts as a simulator of a Dlms device

I am trying to create Modem Information object which is of type IC 1 -> Data with DataType of type structure.

This structure is made up of three elements of type OctetString.

ModemInformation (IC: 1, DataType: Structure)
{
IMEI: OctetString,
ICCID: OctetString,
IMSI: OctetString
}

For I have developed the following code:

var modemInformation = (GXDLMSData) companionObjectCollection.FindByLN (ObjectType.Data, obisCodeList.ModemInformation);
modemInformation.SetDataType (2, DataType.Structure);
modemInformation.SetUIDataType (2, DataType.Structure);

var data = new GXStructure ();
data.Add ("Simulator IMEI");
data.Add ("Simulator ICCID");
data.Add ("Simulator IMSI");

modemInformation.Value = data;

When I execute a read of said object it is returning me the following apdu:
C401400002030A0E53696D756C61746F7220494D45490A0F53696D756C61746F722049434349440A0E53696D756C61746F7220494D5349

Which translated with Gurux has the following structure.

<GetResponse>
<GetResponseNormal>
<!--Priority: NORMAL ServiceClass: CONFIRMED invokeID: 0-->
<InvokeIdAndPriority Value="40" />
<Result>
<Data>
<Structure Qty="03" >
<String Value="Simulator IMEI" />
<String Value="Simulator ICCID" />
<String Value="Simulator IMSI" />
</Structure>
</Data>
</Result>
</GetResponseNormal>
</GetResponse>

These objects are of type string instead of OctetString.

Can you help me with this???? I am very grateful to you in advance.

Sincerely,

Rubent

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200
  • Mon, 06/15/2026 - 08:52
    gurux.dlms.c 9.0.2606.1501

New forum topics

  • Service not known error on gprs communication
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • Dawsontot
  • Jerrylam
  • qvlLdJweKzGUYaSOVS
  • LindanEt
  • annoyingconsultants
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin