Multiple modbus clients over RS485 #2679
Unanswered
embedded-bed
asked this question in
Q&A
Replies: 1 comment
-
Pymodbus do not work as client on a multiline as documented, nor do any normal application! This is due to the way modbus signals frame end/start, which is by pausing the communication. If you want to do this you need to have rs485 hardware directly connected (no usb converter) and write a device driver that detects the pause and somehow signals the pause to the application. pymodbus do not have a "modbus handler" that you can just call, you would need to rewrite asyncio transport base class. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking for some guidance for implementing pymodbus for several drivers.
A short introduction to the setup:
Multiple modbus devices (slaves) are connected to a single master, where my application will run.
For each device, a small driver is made for the specific driver communication.
Each driver will inherit from a modbus handler class, that each registers the slave id and handles the modbus communication.
When initiating communication (either read or write), the modbus handler will call
client.connect()
and after finishing it will callclient.close()
.Now, everything is single threaded in the application so I am not worried about any concurrency issues and the drivers will therefore not fight for serial port access.
However, I was recommended to use a global modbus client instance that each driver should access instead of a having multiple modbus client objects calling connect and close.
But I am having trouble figuring out why when my application is single threaded.
I have not experienced any issues running my current setup.
Maybe I can get a better explanation from a modbus guru.
Looking forward to the response :D
Beta Was this translation helpful? Give feedback.
All reactions