Modbus *TCP <-> RTU over TCP* Gateway #825
ArcticSnowSky
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
This discussion is not intended as advertising. If you feel it's inappropriate, please let me know.
I'm sharing this because I saw that over the years others been looking for similar solutions and investing time into their own approaches.
So did I and I hope what I built might be useful to others — so that the time I spent feels a little more worthwhile.
TLDR
I made a tiny program for windows (usable also as a windows service) acting as a TCP -> RTU over TCP gateway (and RTU over TCP -> TCP gateway).
Final outcome
So in the end I made a simple generic little tool that helps me out right now.
https://github.com/ArcticSnowSky/Modbus_TCP_RTUoverTCP_gateway
It can be used as a Gateway from TCP -> RTU over TCP or RTU over TCP -> TCP
Main goal:
I had to connect one of my programs (Windows environment, it uses this library) as master with a slave that only had Modbus RTU over TCP capability.
Side goal:
Even simulators like pyModSlave, qModMaster etc. do not support RTU over TCP.
In regard to my maingoal it would ease my situation being able to do read/write-tests with well proven test-applications.
Possible solutions:
I searched and read about a few pull requests and issues regarding RTU over TCP.
I tested Virtual Serial Ports in combination with com2tcp socat etc., it worked but it felt too unstable in the long run.
Some infos are about patches implementing the functionality into libmodbus itself.
This would have been a nice and easy way, but they have never been implemented in this main repo.
The forks that implemented it, have probably become outdated meanwhile.
I could have forked it myself with a recent version and combined it with a patch, but this would only mean a fork more that will be outdated soon.
And also this way I would not be able to do testing with independet programs.
Another solution would have been a gateway.
Such type of solution would help me with my maingoal and my sidegoal, and in addition I could stay on the original libmodbus without altering and ruining something that works already well.
But I only found gateways that were TCP <-> "RTU on Serial Interface".
Links regarding this topic
Links to some programs noted in these topics
Beta Was this translation helpful? Give feedback.
All reactions