Hello Sir,
I am working with the following HDLC frame:
byte[] frame = GXCommon.HexToBytes("7E 16 38 04 7E A0 1F 21 03 96 DB D6 E6 E7 00 C4 01 C1 00 09 0D 41 4C 4C 49 45 44 2D 44 4C 4D 53 30 33 D6 B5 7E");
Using the GXDLMSTranslator, I am able to successfully convert this frame into a readable XML format:
GXDLMSTranslator t = new GXDLMSTranslator();
string xml = t.MessageToXml(frame );
However, when I use the GXDLMSSecureClient to process the same frame, the result is false:
GXDLMSSecureClient dlms3 = new GXDLMSSecureClient(true);
GXByteBuffer buffer = new GXByteBuffer(frame);
GXReplyData reply = new GXReplyData();
GXReplyData noti = new GXReplyData();
var result = dlms3.GetData(frame, reply, noti);
Upon investigation, I found that the issue occurs inside the GetHdlcData function in GXDLMS. The condition:
if (data.Xml == null && !settings.CheckFrame(frame, data.Xml))
is failing because data.Xml is null when using GXDLMSSecureClient, whereas it is properly populated when using the GXDLMSTranslator.
The main issue is that the GXReplyData.Xml property is inaccessible due to its protection level, so I am unable to assign a GXDLMSTranslatorStructure object to it in the SecureClient context.
If I manually assign the GXDLMSTranslatorStructure to data.Xml, the frame is processed successfully.
Kindly advise on how to proceed or if it would be possible to expose the Xml property to enable this functionality.
Note - I can't assign the GXDLMSTranslatorStructure object into data.Xml in SecureClient class.
reason - 'GXReplyData.Xml' is inaccessible due to its protection level
Hi, You need to set the…
Hi,
You need to set the client and server addresses to the dlms3.
dlms3.ClientAddress = 0x10;
dlms3.ServerAddress = 1;
It is not intended that you set the XML property.
BR,
Mikko
Thank you for your response…
Thank you for your response.
Unfortunately, the current setup still doesn't work as expected. I've already configured the DLMS settings as follows:
dlms3.ClientAddress = 0x10;
dlms3.ServerAddress = 1;
dlms3.Authentication = Authentication.None;
dlms3.Security = Security.None;
I'm receiving the following RX data from the meter:
byte[] frame = GXCommon.HexToBytes("7E 16 38 04 7E A0 1F 21 03 96 DB D6 E6 E7 00 C4 01 C1 00 09 0D 41 4C 4C 49 45 44 2D 44 4C 4D 53 30 33 D6 B5 7E");
I'm using dlms3.GetData(frame, new GXReplyData(),new GXReplyData()) to process the received data, but it's not yielding the expected results.
Could you please help me identify what might be going wrong or what additional settings or steps are needed?
Hi, You can't just select…
Hi,
You can't just select one frame and try to get the data. There is a frame id that blocks invalid frames. You need to establish the connection to the meter and let framework handle all the frames.
Use GXDLMSDTranslator if you want to handle random frames.
BR,
Mikko