Need to Read DLMS frame(Byte Stream) and Make a List of Objects With Values

4 posts / 0 new
Last post
Tauheedul Maruf
Need to Read DLMS frame(Byte Stream) and Make a List of Objects With Values

Hi,
I want to Parse this Byte array for DataNotification and Make a set of objects with their values and Im using wrapper protocol:

0x00, 0x01, 0x00, 0x02, 0x00, 0x10, 0x01, 0x7C, 0x0F, 0x80, 0x00, 0x00, 0x01, 0x0C, 0x07, 0xE3,
0x04, 0x02, 0x02, 0x0B, 0x29, 0x1A, 0x00, 0xFE, 0x98, 0x00, 0x02, 0x0F, 0x01, 0x0F, 0x02, 0x04,
0x12, 0x00, 0x28, 0x09, 0x06, 0x00, 0x07 ,0x19, 0x09, 0x00, 0xFF, 0x0F, 0x02 ,0x12, 0x00 ,0x00,
0x02, 0x04, 0x12, 0x00, 0x01, 0x09, 0x06 ,0x00, 0x00, 0x2A, 0x00, 0x00, 0xFF, 0x0F, 0x02 ,0x12,
0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x01 ,0x09, 0x06, 0x00, 0x00, 0x60, 0x07, 0x00, 0xFF ,0x0F,
0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12 ,0x00, 0x01, 0x09, 0x06, 0x00, 0x00, 0x60, 0x0B ,0x06,
0xFF, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x02 ,0x04, 0x12, 0x00, 0x01, 0x09, 0x06, 0x00, 0x00 ,0x60,
0x0B, 0x07, 0xFF, 0x0F, 0x02, 0x12, 0x00 ,0x00, 0x02, 0x04, 0x12, 0x00, 0x01, 0x09, 0x06 ,0x00,
0x00, 0x60, 0x0B, 0x09, 0xFF, 0x0F, 0x02 ,0x12, 0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x01 ,0x09,
0x06, 0x00, 0x00, 0x60, 0x32, 0x05, 0x0B ,0x0F, 0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12 ,0x00,
0x01, 0x09, 0x06, 0x00, 0x00, 0x60, 0x32 ,0x05, 0x0C, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x02 ,0x04,
0x12, 0x00, 0x01, 0x09, 0x06, 0x00, 0x00 ,0x60, 0x32, 0x05, 0x0D, 0x0F, 0x02, 0x12, 0x00 ,0x00,
0x02, 0x04, 0x12, 0x00, 0x01, 0x09, 0x06 ,0x00, 0x00, 0x60, 0x32, 0x05, 0x0E, 0x0F, 0x02 ,0x12,
0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x01 ,0x09, 0x06, 0x00, 0x00, 0x60, 0x32, 0x05, 0x0F ,0x0F,
0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12 ,0x00, 0x01, 0x09, 0x06, 0x00, 0x00, 0x60, 0x32 ,0x05,
0x10, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x01, 0x09, 0x06, 0x00, 0x00 ,0x60,
0x32, 0x05, 0x11, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x01, 0x09, 0x06, 0x00,
0x00, 0x60, 0x32, 0x05, 0x12, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x02, 0x04, 0x12, 0x00, 0x08, 0x09,
0x06, 0x00, 0x00, 0x01, 0x00, 0x00, 0xFF, 0x0F, 0x02, 0x12, 0x00, 0x00, 0x0A, 0x0F, 0x41, 0x50,
0x4C, 0x34, 0x34, 0x31, 0x38, 0x30, 0x30, 0x30, 0x31, 0x31, 0x30, 0x36, 0x30, 0x12, 0x00 ,0x8E,
0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06,
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F ,0x06, 0x00, 0x00 ,0x00, 0x03, 0x06, 0x00, 0x00,
0x00, 0x02, 0x06, 0x00, 0x00, 0x00 ,0x00, 0x19 ,0x07 ,0xD0 ,0x01 ,0x01 ,0x01, 0x00, 0x18, 0x30,
0xFF, 0xFE, 0x98, 0x00

I tried with GenerateDataNotificationMessages() Method in GXDLMSNotify class ...

Please Help Thanks

Kurumi
Kurumi's picture

Hi,

You can use GXDLMSClient.Parse method to get values out from this. Something like this:

GXReplyData reply = new GXReplyData();
GXReplyData notify = new GXReplyData();
GXDLMSClient cl = new GXDLMSClient(true, 2, 16);
Client.GetData("data", reply, notify))
GXDLMSTranslator t = new GXDLMSTranslator(TranslatorOutputType.SimpleXml);
t.DataToXml(notify.Data, out xml);
Console.WriteLine(xml);

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

Tauheedul Maruf

Hi Mikko,
Sorry, I cannot explain properly earlier. Actually my question is :
1) I have a Byte array which contains Data Notification that means it contains set of object but in "byte array" form.
2) Now i need to parse this Data Notification data stream and make a List of Objects.
Is there any way(Method or something like this) to Parse those object using Gurux Library from the ByteStream(Above) and make a list of objects in return so that the objects values can be fetch from the returned object list?
And I Also tried to Do with this method :

client.ParseObjects(GXByteBuffer data, bool onlyKnownObjects);

But for this data Notification frame that i given i have got "Invalid response." from ParseLNObjects() methods.

Please Let me know
Thank You

tauheedulmaruf

Kurumi
Kurumi's picture

Hi,

Your explanation was good. Give received bytearray to GetData as a "Data" parameter.
Client.GetData("data", reply, notify))

After that received data is storer to notify variable. You can access it by notify.Value.

GXByteBuffer bb = new GXByteBuffer();
//Append received bytes to bb.
bb.Set();
Client.GetData(bb, reply, notify))
Console.WriteLn(notify.Value);

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi