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

Regarding Converting 4 Modbus RTU to Ethernet #21

Closed
abhishekricky opened this issue Nov 14, 2017 · 12 comments
Closed

Regarding Converting 4 Modbus RTU to Ethernet #21

abhishekricky opened this issue Nov 14, 2017 · 12 comments
Assignees

Comments

@abhishekricky
Copy link

Hi,

Is it possible to have 4 usb ports converted to Ethernet on different ports via this software ?

@3cky
Copy link
Owner

3cky commented Nov 23, 2017

Yes, it's possible, but you should run mbusd instances using custom script because current systemd service doesn't support multiple TCP port configurations.

@3cky 3cky self-assigned this Nov 29, 2017
@3cky 3cky added the question label Nov 29, 2017
@3cky
Copy link
Owner

3cky commented Nov 29, 2017

I've added support for multiple mbusd instances in 3ea2084.

@nickma82
Copy link
Contributor

nickma82 commented Dec 1, 2017

@abhishekricky please close the ticket

@joeychen
Copy link

Is it possible to support multiple serial port in one instance with one TCP port?

@nickma82
Copy link
Contributor

Consider two ModbusRTU (Serial) devices with the same address on two different serial Ports and a request sent from TCP to be sent via RTU.
How would one decide which RTU-serial port to prefer? If one sends it out on both serial buses, which response to choose?

IMHO nothing like that is integrated atm.
Best

@joeychen
Copy link

joeychen commented Jan 20, 2018

In general, a routing table can be achieved for gateways with two or more serial ports.

Scenario 1:
If the Modbus devices with different slave IDs are connected to different serial ports on a gateway,
slave ID can be used to route to different serial port.
For example, the Modbus requests with slave ID 1 to 5 will be routed to serial port1.
The Modbus requests with slave ID 6 to 10 will be routed to serial port2.

Scenario 2:
It's the scenario that you mentioned, two Modbus device with the same slave ID are connecting to different serial ports.
For example, there are a device A and a device B with the same slave ID 1.
The device A is connected to serial port 1 and device B is connected to serial port 2.
If gateway has a virtual-to-real slave ID mechanism,
on the Modbus Master side, the Modbus request for device A is recognized by slave ID 1
and the request for device B is recognized by slave ID 2.
When gateway received a command with slave ID 2, it can just minus 1, and send this command with slave ID 1 to serial port 2.

@3cky
Copy link
Owner

3cky commented Jan 22, 2018

Is it possible to support multiple serial port in one instance with one TCP port?

Since I trying to keep mbusd functionality as simple as it could be, adding multiple serial ports support with full-fledged Modbus routing table isn't something that looks good to me. Probably the best (Unix-)way to achieve this functionality is a dedicated app implementing Modbus TCP routing atop of multiple mbusd instances.

@joeychen
Copy link

Has such app been already implemented by anyone in github ?
If not, I was wondering if you have more detailed information for implementation?
For example, since mbusd is binding to a socket,
how to use another app to route packets atop of mbusd?
Is there a way to achieve this function without modify mbusd?

@nickma82
Copy link
Contributor

Side question: Why not using two TCP front-ends (i.e. two ports) and route on client side?

@nickma82
Copy link
Contributor

how to use another app to route packets atop of mbusd?
Is there a way to achieve this function without modify mbusd?

I'd give one of the various python modbus libs a go.
If you have static routing tables (i.e. your modbus devices do not change) it shoudn't be that complicated. Two to four man days?

@nickma82
Copy link
Contributor

@abhishekricky Concerning your original question: This is now possible since mbusd supports setup via systemd.

Please close this ticket

@stale
Copy link

stale bot commented Sep 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 23, 2019
@stale stale bot closed this as completed Oct 23, 2019
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

4 participants