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. Forums
  3. Encoding Array

Encoding array

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By simba, 21 October, 2011

Can somebody explain me how to read array data type? For example I have array which I get reading all cosem objects and one small part in hex values, is showed bellow:

01 82 01 71 02 04 12 00 08 11 00 09 06 00 00 01 00 00 ff 02 02 01 09 02 03 . . .

So first byte "01" is for data type ( in this case array data type, according to blue book), but I don't know what means next 3 bytes. Can somebody help me? Thanks

Best regards,

Profile picture for user Kurumi

Kurumi

14 years 6 months ago

Encoding array

Hi,

Following tree bytes tell amount of the items.

Accordin DLMS/COSEM spesification, if there are more than 127 items
amount is divided to multible bytes.

Example: Items count = {byte array according DLMS/COSEM}

2 = {0x2} //Higgest bit is not set. Data item count is two.
127 = {0x7F} //Higgest bit is not set. 127 items.
240 (0xF0) = {0x81, 0xF0} //Higgest bit is set. Data count takes one byte.
287 (0x11F) = {0x82, 0x01, 0x1f} //Higgest bit is set. Data count takes two bytes.

So higgest bit of the first byte is set if number of items is more than 127.
Lowest byte tells how many bytes takes to show the number.

Hope this helps. :-)

Happy coding,

Mikko

maltova

10 years 10 months ago

In reply to Encoding array by Kurumi

Encoding structure

Dear kurumi,

Same encoding procedure applies to structure also (If structure contains more than 127 elements)?

Profile picture for user Kurumi

Kurumi

10 years 10 months ago

Encoding structure

Hi,

This same applies to structure.

BR,

Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94
  • Thu, 05/28/2026 - 13:16
    Gurux.DLMS.Net 9.0.2605.2801
  • Thu, 05/28/2026 - 13:14
    Gurux.DLMS.Python 1.0.198
  • Tue, 05/26/2026 - 11:37
    gurux.dlms.c 9.0.2605.2601

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin