I am new to j2mod and modbus. I need to implement a modbus TCP server and I would like to build it on top of j2mod. I looked everywhere and I couldn't find a single tutorial on how to build this server. Something somewhere is wrong. Have I missed something obvious? I see a lot of client examples, but no servers. Ideally the example/tutorial should work with j2mod 1.03 (this seems to be the most recent version that is compiled with Java 6 which is a requirement for my stuff). Can anybody point to such tutorial/example?
Thank you in advance,
Cornelius
Last edit: Corneliu Dabija 2016-06-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure what you mean. As far as I know each request gets a feedback message. So the client should always receive a response. This is standard modbus stuff.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey guys,
I am new to j2mod and modbus. I need to implement a modbus TCP server and I would like to build it on top of j2mod. I looked everywhere and I couldn't find a single tutorial on how to build this server. Something somewhere is wrong. Have I missed something obvious? I see a lot of client examples, but no servers. Ideally the example/tutorial should work with j2mod 1.03 (this seems to be the most recent version that is compiled with Java 6 which is a requirement for my stuff). Can anybody point to such tutorial/example?
Thank you in advance,
Cornelius
Last edit: Corneliu Dabija 2016-06-15
It's OK. I finally found an example and it actually works if you convert the code to use j2mod classes.
https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.modbus/src/main/java/net/wimpi/modbus/cmd/TCPSlaveTest.java
Last edit: Corneliu Dabija 2016-06-15
I'm also wondering it there is any general documentation or samples available for setting up a TCP slave.
I'm wondering if it's possible to respond to a client (master) writing a value in a register?
I am not sure what you mean. As far as I know each request gets a feedback message. So the client should always receive a response. This is standard modbus stuff.