Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. ImageBlockTransfer Send Wrong Image_block_number

ImageBlockTransfer send wrong image_block_number

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 SgmUsr , 29 October, 2019
Forums
Gurux.DLMS

Hi,

I'm following the example of Image Transfer in Gurux.DLMS.Client but when I use ImageBlockTransfer() method, it always sends image_block_number = 0 and the correct segment for each segment.

Where is the problem?

Thanks

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

Have you read ImageBlockSize? What it's the size? What is the size of your image in bytes?

Check that you have not modified the source code.

BR,
Mikko

SgmUsr

6 years 9 months ago

Hi,

Hi,

I have ImageBlockSize is 183, Number of Segments is 1461, ImageSize is 267363.

I set them with those values.

Thanks

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

I tested this with one meter. image_block_number is correct. Can you send the second message that you send to the meter where the image index should be 1.

Note that image_block_number is UInt32.

BR,

Mikko

SgmUsr

6 years 9 months ago

But when GetImageBlocks(byte[

But when GetImageBlocks(byte[] image) creates frame, I have:

for (int pos = 0; pos != cnt; ++pos)
{
GXByteBuffer data = new GXByteBuffer();
data.SetUInt8((byte)DataType.Structure);
data.SetUInt8((byte)2);
GXCommon.SetData(null, data, DataType.UInt32, pos); -> pos is always 0
...}

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

This is for loop where pos is increased every time (++pos).
It's zero in the first time. Can you add this line before packets.Add(...)

System.Diagnostics.Debug.WriteLine(data);
Post the second debug line and I'll verify this from the bytes.
BR,

Mikko

SgmUsr

6 years 9 months ago

Ok, I found my error: I used

Ok, I found my error: I used ImageBlockTransfer() method fo each segment and not with all segment together.
Now it work correctly.

Thanks for help

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

Thanks for the info. Have a nice coding.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • SgwTHoQsOQXBixXP
  • omOOQJmnOZZWWf…
  • Wooplke djoole…
  • Duaneduh
  • ClaytonPap
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin