Git Product home page Git Product logo

Comments (12)

3cky avatar 3cky commented on June 19, 2024

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

from mbusd.

3cky avatar 3cky commented on June 19, 2024

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

from mbusd.

nickma82 avatar nickma82 commented on June 19, 2024

@abhishekricky please close the ticket

from mbusd.

joeychen avatar joeychen commented on June 19, 2024

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

from mbusd.

nickma82 avatar nickma82 commented on June 19, 2024

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

from mbusd.

joeychen avatar joeychen commented on June 19, 2024

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.

from mbusd.

3cky avatar 3cky commented on June 19, 2024

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.

from mbusd.

joeychen avatar joeychen commented on June 19, 2024

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?

from mbusd.

nickma82 avatar nickma82 commented on June 19, 2024

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

from mbusd.

nickma82 avatar nickma82 commented on June 19, 2024

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?

from mbusd.

nickma82 avatar nickma82 commented on June 19, 2024

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

Please close this ticket

from mbusd.

stale avatar stale commented on June 19, 2024

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.

from mbusd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.