Modbus first holding register

I need to read a uint32 holding register from a modbus over rs485. I’m able to read all register but not the first.
if I set start: 1 in cfg and modbus=“device:0” in items, I read the second register, the register number 3 and not the number 1.
Someone had this problem?

You may set start to zero e.g.
serial.myserialslave.start=0
to refer to the first register in this slave

thanks for answer.
if I set zero I receive invalid data. data have a length of 2, so teorically I should set start: -1

As far I know modbus it does not support negative indexes…

sure, I’m talking about settings in openhab modbus and how they are interpreted inside the binding. I’m going deeper in code to understand

There is often confusion about address 0 / address 1. The first address that can be transmitted in the Modbus protocol is 0, zero. However, sometimes that is taken to mean the address of Register 1, the first register in a naming scheme starting with ‘one’.

The Openhab Modbus binding uses the start-at-zero convention, zero is always the first address.

If you are reading 32-bit registers (length 2 x 16-bit words) there is no definition of which is the high and low 16-bit words of the pair. That depends on your mystery slave device. You get to choose which way tointerpret it in your config, It’s in the Wiki

If you share your binding config, item definition, and modbus device there may be more help available?

the device is a Gavazzi EM210.

in cfg
modbus:serial.gavazzi.connection=/dev/ttyS2:38400:8:none:1:rtu
modbus:serial.gavazzi.type=holding
modbus:serial.gavazzi.id=3
modbus:serial.gavazzi.start=1
modbus:serial.gavazzi.length=36
modbus:serial.gavazzi.valuetype=uint32

in items
Number v2 “V L2-N [%d]” { modbus=“gavazzi:0”}
Number v3 “V L3-N [%d]” { modbus=“gavazzi:1”}

with this configuration I start to read from second register.

the datasheet of carlo gavazzi
Modicom address | Physical address | Length (words) | VARIABLE ENG. UNIT | Data Format
300001 | 0000h | 2 | V L1-N | INT32
300003 | 0002h | 2 | V L2-N | INT32
300005 | 0004h | 2 | V L3-N | INT32

I switched to 1.9.0 modbus binding and I changed the config llike below

in cfg
modbus:serial.gavazzi.connection=/dev/ttyS2:38400:8:none:1:rtu
modbus:serial.gavazzi.type=holding
modbus:serial.gavazzi.id=3
modbus:serial.gavazzi.start=0
modbus:serial.gavazzi.length=36
modbus:serial.gavazzi.valuetype=uint32_swap

in items
Number v1 “V L1-N [%d]” { modbus=“gavazzi:0”}
Number v2 “V L2-N [%d]” { modbus=“gavazzi:1”}
Number v3 “V L3-N [%d]” { modbus=“gavazzi:2”}

data seems to be corrects