Skip to content

Conversation

@Cougar
Copy link
Contributor

@Cougar Cougar commented Oct 4, 2020

This is a major rewrite for pymodbus.client.asynchronous.tornado.AsyncModbusSerialClient class. In addition, the pymodbus.exceptions.TimeOutException class has been added.

Existing tests have been fixed but the new flow is not covered with any additional test cases yet.

There are two differences with details described in #533:

First, there is more error handling. It still doesn't catch every write error but works better when waiting for serial data. In case of fd error it closes stream and returns ModbusIOException to the app. This happens when serial port disappears (for instance removing USB device). App should try to reopen serial port after that.

Another change in this PR is that the receive part of master resets the self.last_frame_end now too. AFAIK it is important when using common half duplex serial bus like RS-485 where all slaves see all frames from each other. Otherwise reply from one slave and next request form master could be too close and some slaves might not like that. One slave usually works fine without that but with multiple slaves it becomes important.

My test setup with 19200 baud shows that python part is so fast that some more time is still needed to be wait before sending a new request and this change fixes that too. With slower speeds this becomes even more useful.

Some of these changes would be nice to have in sync client also in the future. Especially the timing part could be more general for both clients.

@dhoomakethu dhoomakethu added this to the 2.5.0 milestone Oct 18, 2020
@dhoomakethu dhoomakethu merged commit 93306bc into pymodbus-dev:dev Nov 4, 2020
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants