The issue with 1-offset is that the "Register Number" found in documentation is at an "Address" one position less. So Reg 41 has Address 40. Som libraries expect Register Numbers and some expect Register Address. And every so often, one mixes that up.
On Wed, Jul 15, 2020 at 2:53 PM Christofer Dutz <christofer.d...@c-ware.de> wrote: > .... > > While looking for more Infos I found out I once wrote a tutorial page for > PLC4X __ > > https://plc4x.apache.org/users/plc4j/virtual-modbus.html > > I so totally hate searching the web and getting my answers answered by > myself. > > Chris > > Am 15.07.20, 08:31 schrieb "Christofer Dutz" <christofer.d...@c-ware.de>: > > Hi Niclas, > > when preparing a workshop for the Building IoT we were looking for > something where you could simulate a Modbus Slave. > Most of these were Windows only solutions, so ModbusPAL was one of the > very few solutions that were pure-java. > > Don't quite understand what the thing with the offset is however ... > should be easy to fix ... I mean if I say address 42 in PLC4X, Wireshark > says 42, but in Modbus Pal I think it has to be 43 ... don't quite get it. > > Chris > > > > Am 15.07.20, 03:54 schrieb "Niclas Hedhman" <nic...@hedhman.org>: > > What is ModbusPAL? > > The 1-offset in Modbus has caused a lot of confusion over the > years. > > On Tue, Jul 14, 2020 at 11:03 PM Christofer Dutz < > christofer.d...@c-ware.de> > wrote: > > > Sorry for the noise ... > > > > this was a false positive ... the driver was doing things > correctly. > > It seems the ModbusPAL was just off by one ;-) > > > > Chris > > > > > > > > Am 14.07.20, 15:51 schrieb "Christofer Dutz (Jira)" < > j...@apache.org>: > > > > Christofer Dutz created PLC4X-214: > > ------------------------------------- > > > > Summary: [Modbus] Holding register addresses > have an > > offset of 1 (Not reading the correct address) > > Key: PLC4X-214 > > URL: > https://issues.apache.org/jira/browse/PLC4X-214 > > Project: Apache PLC4X > > Issue Type: Bug > > Components: Driver-Modbus > > Affects Versions: 0.7.0 > > Reporter: Christofer Dutz > > Assignee: Christofer Dutz > > Fix For: 0.8.0 > > > > > > If I set holding the following holding registers to: > > > > 1000: 41 > > 1001: 42 > > 1002: 43 > > > > And then read: holding-register:1001 ... I get the value 43 > returned. > > > > > > > > -- > > This message was sent by Atlassian Jira > > (v8.3.4#803005) > > > > > > >