OpenModScan icon indicating copy to clipboard operation
OpenModScan copied to clipboard

address offset

Open tosione opened this issue 1 year ago • 5 comments

There seems to be an offset of 2 in the address, at least with the 32bit data with Modbus TCP (I can only test the Modbus on a machine that only uses 32bit data: long int, or float32).

The get the correct data I must increase the address by 2, as it can be seen on screenshot:

Tested on version 1.7.0 for windows.

address ofset issue

tosione avatar Jun 17 '24 21:06 tosione

Hello @tosione. Why do you think there is a offset in addresses here?

sanny32 avatar Jun 18 '24 05:06 sanny32

Because I know the values to expect at each address, as we design the machine: values of ~411 are expected on addresses 16078, 16080, 16082, not the ones before or after. Besides, with other programs (QModMaster and Radzio! Modbus Master Simulator ) this coincides.

tosione avatar Jun 18 '24 20:06 tosione

@tosione can you show hex values of your server address space?

sanny32 avatar Jun 19 '24 04:06 sanny32

Sorry for delay @sanny32,

It is a bit difficult, and possibly senseless, to show you my hex values from server address (microcontroller): that's because we are using a Raspberry Pi as a gateway, and the software on the Raspberry is not easily available to me:

Windows-PC ---(ModBus TCP)---> Raspberry-Pi ---(ModBus RTU)---> Microcontroller

I can't assure that the gateway is not adding any address offset, but again, this do not happen with other programs.

Reading on the internet I have seen that address offset is not such a uncommon problem, and many programs offer a way the configure this offset (at least for configuring the 0 or 1 based addressing). Maybe it would be possible to implement this, to allow greater compatibility.

tosione avatar Jun 27 '24 20:06 tosione

Yes, the base address in Open Modscan is 1, not 0. If your device has base address 0 you can think, that the program has address offset.

sanny32 avatar Jun 28 '24 05:06 sanny32

Yes, the base address in Open Modscan is 1, not 0. If your device has base address 0 you can think, that the program has address offset.

Can you add an option for the Modbus start address (1 or 0)? Some Modbus device datasheets use 0, while others use 1. For example, Modbus address 1 corresponds to 40001 (option 1), and Modbus address 0 corresponds to 40001 (option 0, automatically adds 1 to this address).

dangkhoa1612 avatar Oct 16 '24 07:10 dangkhoa1612

Hello @dangkhoa1612. This may be possible to do in one of the future releases.

sanny32 avatar Oct 16 '24 08:10 sanny32

Implemented at version 1.8.0

sanny32 avatar Oct 24 '24 09:10 sanny32