2019-07-14 11:28 AM
Hi
I want to implement Modbus slave RTU/ASCII protocol on STM32F103VET6. I have read many forums about Modbus and examined several libraries, but unfortunately I couldn’t do it and I’m disappointed.
In this blog: https://blog.naver.com/eziya76/220970378890 (this is Korean, I translated it with google) there is a full explanation of running Modbus, but when I test with ‘Modbus poll’, the error ‘Time out’ occurs. The library is here: https://github.com/cwalter-at/freemodbus
Maybe I’m missing something or doing something wrong. I uploaded my project and schematic of my discovery board. I’m using Usart1 (PA9 , PA10 pins) for Modbus and connect it with Usb cable to PC.
After all, if you have a good manual or know a better library, please let me know.
I really appreciate if someone helps me. This is very important for me.
Thank you very much…
Solved! Go to Solution.
2019-07-14 01:07 PM
IMHO, the Modbus serial protocol cannot be expected to work well over USB CDC emulated serial connection on either side. All timing will be distorted.
-- pa
2019-07-14 01:07 PM
IMHO, the Modbus serial protocol cannot be expected to work well over USB CDC emulated serial connection on either side. All timing will be distorted.
-- pa
2019-07-15 03:15 AM
Thank you.
Yes, at first I guessed so, but in the blog, he used usb serial for modbus protocol. I don't know how that works.
So, if I run the library and use a RS485 IC like SP3485 (in the pdf above) will this work?
2019-07-15 06:00 PM
It could be other problem as well. Have you tested that the serial TX/RX work, with some terminal program?
-- pa
2019-07-17 07:35 PM
Ok, I'll check it.
My discovery board has a RS485 module (SP3485 IC). I want to use this instead of serial port. This IC has two states, driver enable and reciever enable. When should I enable driver mode and when I should enable reciever mode?
Thanks for your help...