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

rtu over tcp #177

Closed
pnpdb opened this issue Mar 23, 2023 · 11 comments
Closed

rtu over tcp #177

pnpdb opened this issue Mar 23, 2023 · 11 comments
Milestone

Comments

@pnpdb
Copy link

pnpdb commented Mar 23, 2023

Is there any implementation of modbus rtu over tcp?

@uklotzde
Copy link
Member

Please provide context and references. But I guess no.

@pnpdb
Copy link
Author

pnpdb commented Mar 24, 2023

http://www.simplymodbus.ca/TCP.htm
Here is a simple explanation about RTU over TCP.
3681679630039_ pic

@imawaki
Copy link

imawaki commented Apr 17, 2023

@pnpdb does this question relate? hirschenberger/modbus-rs#37
@uklotzde is it difficult to implement?

@uklotzde
Copy link
Member

Before thinking about possible implementations I recommend to start evaluating the implications for the API and how it needs to be changed or extended. Then open a Draft PR for discussion.

@cdbennett
Copy link
Contributor

Could be interesting to be able to do this. But, seems like quite an edge case, how many people actually would use this? Is this the best way to really solve the problem you have? Maybe you could explain the bigger picture.

The way I've usually seen access to Modbus RTU devices done recently is to use a Modbus TCP to Modbus RTU gateway device. Typically this is a little embedded hardware device costing $100-$1000. But it could be a pure software component too that has a Modbus TCP server and Modbus RTU client in one application -- this would be more general purpose and clean, I think. We could implement such a software gateway using tokio-modbus.

@wheregmis
Copy link

I am currently trying to combine server and client into one application, the purpose is different in my case but is doable. I am currently bridging multiple tcp sources under one server. If my workspace will have anything similar kind of use case, i will try to put some more insights.

@barisdigi
Copy link

This is the issue preventing us from using tokio-modbus, some gateway devices unfortunately only support modbus rtu over tcp

@uklotzde
Copy link
Member

This is the issue preventing us from using tokio-modbus, some gateway devices unfortunately only support modbus rtu over tcp

Then why don't you implement the missing pieces and and submit a PR?

@HrvojeJuric
Copy link

HrvojeJuric commented Oct 25, 2023

u can connect rtu over tcp like this

let transport = TcpStream::connect(socket).await?;
tokio_modbus::prelude::rtu::attach_slave(transport, slave)

this works for me

@uklotzde uklotzde added this to the v0.10.0 milestone Jan 2, 2024
@uklotzde
Copy link
Member

uklotzde commented Jan 3, 2024

Does the server-side implementation added in #228 fix this issue or is the client-side part missing?

@uklotzde uklotzde modified the milestone: v0.10.0 Jan 3, 2024
@uklotzde
Copy link
Member

uklotzde commented Jan 3, 2024

I will close this issue. Please create a new, more specific issue for any missing parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants