@Rayman said:
Guess had a 50/50 shot at getting byte order correct and of course was wrong...
Yeah, Modbus is something of a dog's breakfast when it comes to consistency. When reading the docs it's apparent it had distinctly different authors between the original and later extensions. It shows the likely ages it was written. Before the PC became dominant Big Endian was seen as the right way but after, then Little Endian gets preferential treatment.
Ray: I noticed that you're using jm_fullduplexserial in your code. Are you going through an RS-485 converter? If yes, are you using a 4-wire connection? I don't see any mechanism in your code to enable the transmit of a '485 chip.
Comments
Yeah, Modbus is something of a dog's breakfast when it comes to consistency. When reading the docs it's apparent it had distinctly different authors between the original and later extensions. It shows the likely ages it was written. Before the PC became dominant Big Endian was seen as the right way but after, then Little Endian gets preferential treatment.
Eg: There is a 32-bit extension for register sizes.
Ray: I noticed that you're using jm_fullduplexserial in your code. Are you going through an RS-485 converter? If yes, are you using a 4-wire connection? I don't see any mechanism in your code to enable the transmit of a '485 chip.
Just using regular serial via FTDI USB chip, nothing special.
Although in future will probably be Modbus TCP. Although maybe a serial connection to something nearby might be useful, who knows...