alejoseb / Modbus-STM32-HAL-FreeRTOS

Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
GNU Lesser General Public License v2.1
518 stars 182 forks source link

help #92

Closed HasanMahdavi777 closed 8 months ago

HasanMahdavi777 commented 8 months ago

Hello I want to do a modbus master with freertos on the stm32f107vc board, but I don't understand your code, how to tell the program to read a register from another slave, with which function model Thank you for helping me further

alejoseb commented 8 months ago

Hi, Please check the examples. For instance check here for an example of something quite similar to what you need. Notice that you first need to integrate the library to your code and initialize the library, check the main.c file for an example of the required configuration.

HasanMahdavi777 commented 8 months ago

I looked at the examples I want to read from a slave How should I set the slave id and register function and address in the program? I did not see it in the examples

How do I set the slave id and the function and register in the main function?

alejoseb commented 8 months ago

Did you really read my previous message? it is pointing to what you need, you need to prepare telegrams and push them to the Modbus queue.

HasanMahdavi777 commented 8 months ago

yes i read I am a newbie Thank you, can you write the part of the code that you say I should adjust and cover the telegrams?

alejoseb commented 8 months ago

I cannot provide step-by-step instructions sorry. read line