cancel
Showing results for 
Search instead for 
Did you mean: 

MOBUS TCP - is there any library to work with ?

AKrie.4
Associate

Hello eveyone,

I'm trying to communicate with MODBUS TCP between a STM32 Nucleo-F429ZI board and a PLC.

There is a LAN8742A transceiver on the board, do you know any modbus TCP library that is compliant with ?

Thanks in advance for you time

7 REPLIES 7
KDJEM.1
ST Employee

Hi @AKrie.4​ and welcome to the Community :),

If you refer to the reference manual RM0090 you can conclude that the Modbus communication is not supported in STM32F429 MCU device.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thank you

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

SKacp.1
Senior II

Hi,

Please see FreeModbus library https://www.embedded-experts.at/en/freemodbus/about/

You can download library from: https://github.com/cwalter-at/freemodbus

Best Regards,

Slawek

AKrie.4
Associate

Hi @KDJEM.1​ ,

of course it is not, but with transceiver

Do you even understand what an absolute nonsense you wrote there? Modbus is a software protocol, which runs on top of hardware connections. The Modbus/RTU format uses an UART connection and the Modbus/TCP format typically uses an Ethernet network, both of which are present on STM32 MCUs.

ntfreak
Associate II

previously I have used FreeModbus, but this project is not that actively maintained.

see https://github.com/debevv/nanoMODBUS. It is maintained and offers both server (multiple clients) and client connections.

I am looking at nanoMODBUS.  you mention it supports a server with multiple clients.  Can you tell me how you know this?  I am struggling to figure out how to implement a Modbus TCP server that supports multiple clients.  The Linux example seems to imply it will support multiple clients.  However, it looks like it is just trying to receive from one client at a time.  If a client drops off, it relies on a timeout to discover that.  Meanwhile, the other clients have to wait for the timeout to expire.  That won't work in my application.

Any guidance is appreciated.

jabba80
Associate

Doesn't the server represent the "slave" according to the "classic" Modbus (via UART)?

So technically there should only be one client (the "master") which polls multiple servers ("slaves")?

Just asking. I am pretty new to this.