epsilonrt / libmodbuspp

Much more than a C++ wrapper for libmodbus
https://epsilonrt.fr/modbuspp
GNU Lesser General Public License v3.0
73 stars 44 forks source link

Multiple connection to Server or Router #6

Closed Uskok closed 4 years ago

Uskok commented 4 years ago

Hi,

how can I make multiple connections to the server/router in the same time? I try to connect two masters (QModMaster installed on two computers) but only first connection is able to collect data. From the source or example I am not able to find what to do. Testing environment: Ubuntu 18.04 where the sources are installed and compiled Windows 10 for master part (QModMaster ) Thank in advance.

Boris
epsilonrt commented 4 years ago

Have you read carefully the comments of the router-simple example program?

Uskok commented 4 years ago

Thank you for you fast response. I couldn't test with your suggested example I tried the simplest clock-server when I got stuck in my analysis. How I can make two or more masters connected to clock-server in the same time? I would appreciate your help.

epsilonrt commented 4 years ago

Once again what you are asking is totally inconsistent. The modbus protocol is a master-slave protocol: there can only be one master at a given time on a link. Thank you for documenting yourself by reading the reference documents on mordbus.org, after if you wish we can discuss possible things ...

Uskok commented 4 years ago

In the documentation of the libmodbus is example how to connect multiple masters on the same slave/server over TCP. The base socket communication has no different using in Modbus, IEC61850, web, or any other client/server approach. I'm just trying to politely ask if that's possible with your library.

epsilonrt commented 4 years ago

As far as I am concerned, I always refer to the reference documentation, so it is not because an implementation has made non-standard choices that I should do the same. So concurrent access (parallel) to a meaningless slave, this has not been implemented in libmodbuspp. So I advise you to use libmodbus if you want to do this sort of thing.

Uskok commented 4 years ago

Thank you for your support.