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

issue when running several modbus_client (TCP/IP) instances #2

Closed
gentooza opened this issue Feb 21, 2017 · 2 comments
Closed

issue when running several modbus_client (TCP/IP) instances #2

gentooza opened this issue Feb 21, 2017 · 2 comments

Comments

@gentooza
Copy link

Hi pvbrowser community,

I've found an issue in a recent project, about using several instances of modbus_client with several slaves .ini files.

What I want is to communicate with several slaves via modbus TCP/IP, for achieving this, I'm running several instances of modbus_client chosing differents .ini files.

The issue I'm seeing is that there is some kind of competition between the instances, making communications very irregular. The first modbus_client seems to be quicker, and the last one the slower, and sometimes communications freezes during minutes, no refreshing any tag from the slave station.

It could be interesting to implement a sequential communication inside a single modbus_client instance with all stations, as in modbus RTU?

Someone else has already faced this problem?
Thanks!

@gentooza
Copy link
Author

Well, it seems I can have only one socket working.

So what I've done is change the .ini file to have several slaves in TCP/IP with:

[SOCKET]
NUM_SLAVES=3
PORT=502
IP1=172.26.0.17
IP2=172.26.0.112
IP3=172.26.0.127

and in cycles:

[CYCLES]
NUM_CYCLES=22
CYCLE1=50,holdingRegisters(1,100)
[...]
CYCLE7=50,holdingRegisters(2,12)
[...]
CYCLE18=50,holdingRegisters(3,1)
[...]

basically I change mysocket address with setAdr when I change the slave in modbusCycle, then I reconnect mysocket. It seems to work perfectly now

cheers

@gentooza
Copy link
Author

well
It takes too long to switch between sockets when failing, so it's not a well solution :-(

I've been testing now with rlmodbusclient, and it's working perfect with several instances of daemons for different PLCs

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

No branches or pull requests

1 participant