8000 RX Buffer was being cleared with correct data in it. by bjornComate · Pull Request #94 · rossmann-engineering/EasyModbusTCP.NET · GitHub
[go: up one dir, main page]

Skip to content

Conversation

bjornComate
Copy link

The transmit buffer was send before the RX buffer was being cleared. When a slave device was answering faster then the lib was clearing the buffer. correct data was being removed, and the packet was lost.

@Padanian
Copy link
Padanian commented May 9, 2023

AFAIK, I don't think this is the right way to do it. Never had this issue before.
Check if slave is abiding to the correct timings. Sometimes, embedded devices are able to answer before the UART switches TX/RX lines.

@bjornComate
Copy link
Author
bjornComate commented May 9, 2023
754B

Slave is abiding timings. We've checked this with a saleae logic analyzer.
I can also see the data in the buffer that as being answered back (also checked this). before it's being deleted.
We're also using RS232. so no switching of RX/TX lines

Clearing your buffer before sending solves this. and I can't see a reason why you would want to first send and then clear the receive buffer, since modbus is half duplex, a slave will never answer before the master sends so there isn't going to be rogue data in the buffer if you clear it beforehand.

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

Successfully merging this pull request may close these issues.

2 participants

0