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. How To Use Object Methods?

How to use object methods?

Profile picture for user Frank
By Frank , 10 March, 2025
Forums
General discussion

Hi

I have been exploring the library and I am wondering how to use the object methods.

Using a GXDLMSRegister object as am example, it has a Reset method that takes a gxdlmsclient input. i tried to pass a secure client to it and nothing happened. I tried reading after running the method but it throws unacceptable frame error.

I can also see that it returns a byte[][]. Do I have to write this bytes to the meter? but the write method in the communicator class takes an gxdlmsobject and attribute index as an input.

i tried to follow the director code but its a little hard to find the button binding because the selectedview is dynamically generated by which i meant that the ui is not created in the designer so its a bit hard to follow the ui bindings.

Lastly, to the dev team, I've been learning a lot about coding just from reviewing your library/products. Thanks for being FOSS as well as for being responsive!!

Profile picture for user Frank

Frank

1 year 3 months ago

Hi So, i've tried debugging…

Hi

So, i've tried running the director in debug mode and was able to somewhat get how it is done??

GXDLMSSecureClient client = dev.Comm.client;

GXActionArgs ve = new GXActionArgs(RegisterObject, 1);
ve.Client = client;
dev.KeepAliveStop();
ve.Action = ActionType.Action;
ve.Value = (sbyte)0;

GXReplyData reply = new GXReplyData();
if (ve.Index < 0 || ve.Client.CanInvoke(ve.Target, ve.Index))
{
dev.Comm.MethodRequest(ve.Target, ve.Index, ve.Value, ve.Text, reply);
}
object data = dev.Comm.ReadValue(ve.Target, ve.Index);

im wondering how i can utilize the built in methods in the objects tho since it is already there

object ob = RegisterObject.Reset(client);

Edit:

so far this is the implementation that i have mocked up

GXDLMSSecureClient client = GXDevice.Comm.client;
GXReplyData reply = new GXReplyData();
GXDevice.KeepAliveStop();

byte[][] ob = RegisterObject.Reset(client);
string str = string.Format("Method object {0}, interface {1}", RegisterObject.LogicalName, RegisterObject.ObjectType);
foreach (byte[] it in ob)
{
reply.Clear();
GXDevice.Comm.ReadDataBlock(it, str, 1, reply);
}
//GXDevice.Comm.ReadValue(RegisterObject, 2);
GXDevice.Comm.Read(null, RegisterObject, false);
RefreshData();
GXDevice.KeepAliveStart();

maybe there is a more straightforward way for this?

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, the method generates the…

Hi,

the method generates the bytes and you need to send the generated bytes to the meter like this:

GXReplyData reply = new GXReplyData();
GXDLMSRegister r = new GXDLMSRegister();
byte[][] data = r.Reset(client);
ReadDataBlock(data, reply);

BR,
Mikko

Profile picture for user Frank

Frank

1 year 3 months ago

hi mikko thanks for the…

hi mikko

thanks for the reply^^
that is what i do now, thank you!

  • 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