Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second approach for implementing 'RTU over RTP' #445

Closed
wants to merge 2 commits into from

Conversation

myssta
Copy link

@myssta myssta commented Aug 30, 2018

Issue #260 only implemented the client part of 'RTU over TCP', I needed the server part.
Also the approach of #260 some how contaminates the TCP files with RTU content.

Please consider my approach, I implemented both the client and the server for both
contexts 'RTU over TCP' and 'RTU over TCP IP' and I extended the tests and documents accordingly.

There is only one diffenence in behavior comparing to #260, my implementation requires a slave
to be set as required for context RTU, while #260 ignores it as does context TCP.

I tested the code for linux (debian strech) and Windows Visual Studio 2010.
However the test code needs some adoptions to compile with Visual Studio 2010.

@pboettch
Copy link
Contributor

I don't know much about RTU over TCP with modbus, but from quickly (too quickly?) reading your code is seems to me, that this is MODBUS-RTU with a TCP a socket instead of a serial-port-file-descriptor. Or are there some details which I oversaw.

In other words, would it work to do a modbus_new_rtu() on a dummy device and then set the filedescripor (via modbus_set_socket()) to a socket which is actually a TCP-connection?

@myssta
Copy link
Author

myssta commented Sep 14, 2018

First I haven't tried as this is manly a refactoring of the patch in issue #385 with the goal not to contaminate the tcp context files with some addons (manly the server part).
I guess for windows a modbus_set_socket should not work, at least at the first glance it seems that the native Win32 file API is used to read/write to the serial interface.
Injecting the socket for the server side would mean to write as user the main part of the TCP backends again, so not my favorite approach (for what ever that counts :-).

@v-zhuravlev
Copy link
Contributor

It would be very nice to know from libmodbus author or maintainers whether this or any other implementation of RTUTCP will be accepted at some point? Is libmodbus still an active project? Thank you

@Mk123K
Copy link

Mk123K commented Jul 5, 2019

Encapsulated support (RTU over TCP) (updated #260) #385 -> not working?

The new modbus RTU over TCP functions do not work for server/client connection. It a project for QtCreator C++ in linux ubuntu 18.04 system. Does anyone have the same problem or can help?
Missing, for example, to set the slave...

added encapsulated to 3.1.4, works with libzbxmodbus.:

It only works with libzbxmodbus or with a basic libmodus/ modpoll in 18.04 ubuntu?

@myssta
Copy link
Author

myssta commented Jul 16, 2019

I didn't tried it with libzbxmodbus. It worked with Windows 10 & Visual Studio 2010 and very likly with debian stretch. I started with the stable source code tar ball.

@myssta myssta closed this Jul 16, 2019
lss4 added a commit to lss4/libmodbus that referenced this pull request Sep 14, 2020
Merge remote-tracking branch 'myssta/unstable_rtutcp' into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants