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

10 months 1 week 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

10 months 1 week 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

10 months 1 week 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

  • Mon, 12/29/2025 - 10:38
    Gurux.Serial.Android 3.0.5
  • Mon, 12/15/2025 - 08:11
    Gurux.DLMS.Net 4.0.87
  • Fri, 12/12/2025 - 08:38
    Gurux.DLMS.Python 1.0.195
  • Thu, 12/11/2025 - 13:22
    Gurux.DLMS.Python 1.0.194
  • Thu, 12/11/2025 - 11:01
    gurux.dlms.java 4.0.88

New forum topics

  • Gurux DLMS Android App
  • AMR support for bidirectional meters.
  • addition of new object in object list, meter not working
  • old meter take to much time(l&t)
  • Unable to connect L&T ER300P Meter
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin