Skip to main content
Visitor II
December 8, 2023
Question

Help with modbus TCP/IP

  • December 8, 2023
  • 7 replies
  • 7170 views

Hello i'm currently working with the STM32F446RE and i need to implement the modbus tcp/ip protocol, im aware of the freemodbus library but i cant implement this to the stm32cubeide it is always telling me something is missing (like the port.h). It doesnt matter how many things i add to the libraries it always tell me something's missing and i dont know how to solve this.

I tried to implement step by step the modbus functions but i couldnt develop the write coils function so i tried searching for solutions and the freemodbus seemed like one but i have this issue.

Also im using the w5500. I hope someone can help me with this issue. Thank you.

    This topic has been closed for replies.

    7 replies

    Super User
    December 9, 2023
    Graduate
    December 9, 2023

    Hello CesarFA606

    Welcome to the forum.

    Are you able to make the W5500 operate over the network, i.e. can you ping your device.

    Sometimes it is better to start with a less dificult step and then proceed step by step.

    What kind of tools are you using on the PC side?

     

    Visitor II
    December 11, 2023

    Hi, i can use the W5500 normally, establish connection, write/read data. I was able to make the part of the code that only needs Ethernet to work correctly, the detail is when I want to implement modbus, that is when the problems come when I want to integrate the freemodbus libraries.

    To test the ethernet part i used SocketTest and looking for solutions i came across the Modbus Poll/Slave software but but I couldn't even start using it due to the problem of implementing the libraries.

    Honestly i don't know why i cant add the libraries to the IDE.

    Graduate
    January 1, 2024

    Hello CesarFA606

    I hope you solved your problem by now.

    If not, send me PM and I will share my own lib to do Modbus.

    Happy New year.

    Graduate II
    December 10, 2023

    What Pavel basically said - to develop software, one must be capable of... (Surprise, surprise!) understanding the code!

    Super User
    December 10, 2023

    I didn't say that)) The OP asks for help, I've just pointed him to couple of places where one can get help. Of course someone on this forum may offer him help via private message.

     

    Graduate II
    December 10, 2023

    Of course either one must learn it or pay to someone else. Still someone has to know the code and there is no way around it.

    Super User
    December 12, 2023

    Wait, wait. What is your problem? To implement a library or add a (ready, pre-compiled) library or add 3rd party source to the project? Have you found the place in the CubeIDE user manual which explains how to add a library to a project?

    Visitor II
    January 9, 2024

    hi

    i have a stm32f407vgt6  with embedded ethernet and chip dp83848cvv 

    i can configure lwip and set ip and ping

     

    but i  want to start modbus tcp/ip that control gpio output

     

    but i don,t know what to do

     

    please help me

     

    Super User
    January 9, 2024