Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-09-02 Thread Christofer Dutz
Hi Ben, while I just updated the Modbus documentation I noticed your recent additions aren't documented anywhere. I could probably do it, but I would feel more comfortable if you could do so as you actually understand the stuff :-) Would be super awesome, if you could add the description of

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-17 Thread Christofer Dutz
Hi Ben ... I just merged your pull request ... currently doing the full build with all tests but so-far it's looking good. Thanks a lot for this. Chris Am 17.07.20, 10:34 schrieb "Christofer Dutz" : Hi Ben, I just reviewed your changes and I like them a lot ... I did find some

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-17 Thread Christofer Dutz
Hi Ben, I just reviewed your changes and I like them a lot ... I did find some minor things that might deserve tweaking. But thanks for that :) Chris Am 17.07.20, 05:14 schrieb "Ben Hutcheson" : Hi, Sure I'll give it a shot, I have created a pull request to be able to use the

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Ben Hutcheson
Hi, Sure I'll give it a shot, I have created a pull request to be able to use the (01, 0x1, 11, etc..) address formats as well as to change the minimum address to 1. Corresponding to 01 or the first coil. Please don't hold back on criticizing it, it is the only way I'll learn.

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Christofer Dutz
Aaaahh ... perfect Thanks Ben and Niclas. Guess I'll be doing some Modbus coding pretty soon :-) But if someone wants to try I'd be more than happy :) Chris Am 16.07.20, 11:48 schrieb "Ben Hutcheson" : Hi, *I think we have 6 separate memory areas. Do you have a mapping, That I

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Ben Hutcheson
Hi, *I think we have 6 separate memory areas. Do you have a mapping, That I could use? I mean which first digit represents which memory area?* I thought there were only 5 areas? 0x - Coils 1x - Inputs 3x - Input Registers 4x - Holding Registers 6x - Extended Registers I've seen the IEEE format

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Niclas Hedhman
For floats, I have only seen IEEE format. But can't rule out other. On Thu, Jul 16, 2020, 14:57 Christofer Dutz wrote: > Guess it should be possible for plc4x to interpret INT as two shorts long > as four... In that case it could probably also handle half precision floats > (16 bit), full

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Christofer Dutz
Guess it should be possible for plc4x to interpret INT as two shorts long as four... In that case it could probably also handle half precision floats (16 bit), full floats and double, if the encoding is somewhat standard (which I assume it's not) Chris Von:

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Niclas Hedhman
To make things worse, there is equipment on the market with both 32-bit numbers as well IEEE floats. And many clients are incapable of doing something meaningful with those... And then there is equipment that uses one register to indicate the magnitude of one or more other registers, say

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-16 Thread Christofer Dutz
Hi Ben and Otto, First off all, thank you Ben for that very detailed explanation. It does seem as if we should extend the parser to support the different numeric variants. I don't see any problems in supporting both the hex-like one as well as the pure numeric one. I think we have 6 separate

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Otto Fowler
Don’t forget embedded protocols are possible, different devices format floats differently some devices don’t want persistent connections etc etc On July 15, 2020 at 20:48:39, Ben Hutcheson (ben.hut...@gmail.com) wrote: Hi, Answering some of the questions:- *I guess what would be interesting,

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Ben Hutcheson
Hi, Answering some of the questions:- *I guess what would be interesting, would be what address is going over the wire for "30001" for example.* The address that gets sent over the wire is the address starting from 0 i.e 31 would be address 0. I didn't know that. *Also as a register is

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Niclas Hedhman
Let me try again; There is no 3 addresses in the products. It is a notation written with text, by people. the first written digit convey the type. That's it. Long time ago, back when the Modbus came to life it was simply a memory area that one could read and possibly write. And then

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
Hi Niclas, Protocol-wise the numbers could be up to 65535 as they use an unsigned 16 bit integer as an address. I guess what would be interesting, would be what address is going over the wire for "30001" for example. Also as a register is always a 16 bit value, the increments by two sort of

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Niclas Hedhman
It is a common format in equipment documentation. I am currently working with an electric meter. See screenshot from its manual; https://ipfs.subutai.io/ipfs/QmPsra6ExrkSX9GCYWgHa6CTfJbBnddLVXJ3NmJjmAYrAk At protocol level, there are no such "high numbers", just that the industry got used to

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
Hi Ben, please excuse this potentially stupid question ... so would you suggest we leave things the way they are or should we change something? Right now we're using the modbus address syntax, ignoring any potential mapping strategy. I guess we might think about adding different address parser

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Ben Hutcheson
Hi, I've new but been listening to this conversation, this issue always pops up when setting up Modbus communications. I would vote for the API using the modbus register 41, 01, etc.. The translation between modbus registers and the address in the PLC/simulator is handled within the

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
Hmmm ... Regarding: 10012 being a coil and 4 a register. Well the coils and registers are completely different things ... They are accessed via completely different requests. That might be some sort of convenience convention, but I wouldn't call that a standard (I've actually never seen

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Niclas Hedhman
Personall, I prefer that Register Numbers are used in APIs and that the address is only seen if you analyze the over-the-wire format, but maybe that is just me. A big reason for this is that any interface presented to an operator would need to use RegNumbers, as most (possibly all) documentation

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
Hmm .. so are we doing it correctly? I mean Wireshark isn't the ideal reference here as I have several valid packets in the KNX space, where WireShark just says "corrupt package". So if you enter an "holding-register:42" address it tries to read the register number 43 in ModbusPAL. I guess as

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Niclas Hedhman
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

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
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" : Hi

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-15 Thread Christofer Dutz
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

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-14 Thread Niclas Hedhman
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 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 ;-) >

Re: [jira] [Created] (PLC4X-214) [Modbus] Holding register addresses have an offset of 1 (Not reading the correct address)

2020-07-14 Thread Christofer Dutz
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)" : Christofer Dutz created PLC4X-214: -