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!!
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?
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
hi mikko thanks for the…
hi mikko
thanks for the reply^^
that is what i do now, thank you!