Skip to main content
Home
for DLMS smart meters

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 1 month 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 1 month 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 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, 04/07/2026 - 17:17
    Gurux.DLMS.Python 1.0.197
  • Tue, 04/07/2026 - 15:03
    gurux.dlms.c 9.0.2604.0701
  • Tue, 04/07/2026 - 14:50
    gurux.dlms.java 4.0.91
  • Tue, 04/07/2026 - 14:00
    Gurux.DLMS.Net 9.0.2604.0701
  • Mon, 03/30/2026 - 15:39
    gurux.dlms.c 9.0.2603.3001

New forum topics

  • Issue when reading Itron Type620 meter
  • Handling Unexpected Disconnects
  • DLMS Communication Issue – No Response (L&T Meter via USB Probe)
  • Unable to cast object of type Gurux.DLMS.GXStructure to type Gurux.DLMS.GXArray
  • How to properly invoke KeyAgreement
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin