Modbus4j won't talk with InTouch (DASMBTCP)
-
Hello,
I have a problem. I'm writing an android app (slave simulator) with modbus tcp implementation and when I use ModbusPoll (Witte software) on Windows for testing everything works fine, but my goal is to communicate it with Intouch and Freelance.
I can't get it to work with intouch, haven't tried freelance yet.
As a ModbusTCP driver i use DASMbTcp and as far as Intouch connection works when i start dummy mobus slave on different machine on ModbusSlave(Witte software) app but when I try to do the same with my app it won't work.
Could anyone help to resolve this problem? -
Hi Rafat, welcome to the forum!
Without you posting the code you've written to use Modbus4J and no output of any kind, it's anyone's guess what is happening.
If I were in your shoes and had one TCP client that worked and one that did not, I would point them both at a Linux machine running,
sudo nc -k -l 502 | hexdump -C
and compare the bytes that are arriving at port 502 on our Linux server to see what's happening. It could be something in the request is different, it could be your request is never being made. Both should be evident if you record what they're sending.
-
I'm sorry for posting without any specific content but i didn't know what will be best.
I think this isn't code specific problem, cause I'm just creating tcpslave and starting a listener on it and then getting and setting values in process image. I can post DASMbTcp setings screenshot if you want.I saved some wireshark logs, one with the working app and one with not working intouch.
Link to files: Wireshark logs -
OK I got it to work.
DasMbTCP have request Unit Id set to 255 and there's no posibility to change it, when i changed app slave id to 255 everything works like a charm.Is it possible to make modbus4j tcp slave to ignore Unit Id? Or some kind of setting to turn that off?
-
I'm sorry for posting without any specific content but i didn't know what will be best.
Understandable, and it can lead people down the wrong paths to focus on the
wrong thing. But assuredly we need something to even stand a chance of offering something back.I imagine you're adding a BasicProcessImage to a TcpSlave via the addProcessImage function. You should be able to instantiate a com.serotonin.modbus4j.BasicProcessImage with a slave ID of 255.