Hi all,
I'm a beginner on ModBus I/F, please excuse me.
Using jamod I wrote a Slave on TCP that manages a pool of registers (Jamod SimpleInputRegister).
When I use an external Server (not wrote by myself) and it reads the registers with the Function Code 3 everything works fine.
If the Server reads the registers with the Function Code 4 I face a problem:
An exception rise with the value Illegal Data Address.
Probably this issue is due to my erroneous use of Analog Output Holding Registers vs Analog Input Registers.
How can I do to solve my Slave issue ?
Thanks in advance fior the help.
:D
Luca
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your Modbus/TCP slave needs to allow reads via wither FC 3 or FC 4 to use the same variables. You don't provide your slave source code, but I assume you are creating it using the "SimpleProcessImage" class that is using in many of the examples in this folder -
Assuming you're using a SimpleRegister() for your value, you would instead need to use a SimpleInputRegister() and pass that register object to both addRegister() and addInputRegister().
If you are still having issues, you may want to convert your project to use j2mod, which is a fork of jamod that my company greenHouse Gas and Electric supports. You can find that project here -
Hi all,
I'm a beginner on ModBus I/F, please excuse me.
Using jamod I wrote a Slave on TCP that manages a pool of registers (Jamod SimpleInputRegister).
When I use an external Server (not wrote by myself) and it reads the registers with the Function Code 3 everything works fine.
If the Server reads the registers with the Function Code 4 I face a problem:
An exception rise with the value Illegal Data Address.
Probably this issue is due to my erroneous use of Analog Output Holding Registers vs Analog Input Registers.
How can I do to solve my Slave issue ?
Thanks in advance fior the help.
:D
Luca
Your Modbus/TCP slave needs to allow reads via wither FC 3 or FC 4 to use the same variables. You don't provide your slave source code, but I assume you are creating it using the "SimpleProcessImage" class that is using in many of the examples in this folder -
https://sourceforge.net/p/j2mod/code/HEAD/tree/trunk/src/com/ghgande/j2mod/modbus/cmd/
Assuming you're using a SimpleRegister() for your value, you would instead need to use a SimpleInputRegister() and pass that register object to both addRegister() and addInputRegister().
If you are still having issues, you may want to convert your project to use j2mod, which is a fork of jamod that my company greenHouse Gas and Electric supports. You can find that project here -
https://sourceforge.net/projects/j2mod/