MODBUS - How do I wait till timeout or rx data is received? #471
Unanswered
Sharavanth
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to implement MODBUS RTU protocol and use stm32f103c8t6 as the master.
For this, the master should send a command to the slave unit and wait till a response is received or timeout(500ms).
This version works. But, if there are other subsequent calls to
poll
fn, then there is a chance of data mismatch between request and response.I cannot understand why the recursive call version does not work. The data is not being read from RX buffer in this mode.
Any help is appreciated.
PS.
To run the code, the following hardware is needed. STM32 bluepill, MAX485 TTL module and RS485 to USB converter.
Beta Was this translation helpful? Give feedback.
All reactions