Home/Support/Support Forum/MODBUS implementation in STM32F103C8T6 with STM32 official core in Arduino IDE
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

MODBUS implementation in STM32F103C8T6 with STM32 official core in Arduino IDE

0 votes
Hello all,
Good Day!

I have came here several times, and and asked some question here is overview of what I have in my mind and my questions.

I am working on my Master Thesis. I would like to implement Modbus RTU protocol using RS485 UART serial communication between four STM32F103C8T6 with STM32 official core in Arduino IDE.

I have some questions!

1. Is there a full-fleged libary for Modbus RTU protocol using RS485 UART serial communication as mentioned in Modicon Modbus Protocol Reference Guide official document (https://www.modbus.org/docs/PI_MBUS_300.pdf)? Literally the whole implementation of Modbus RTU protocol using RS485 UART serial communication for both Master and Slave (Start->Address->Function Code->Data->CRC->Stop) .

*. From my understanding about MODBUS, it is possible to communicate between one Master microcontroller with several other slave microcontrollers. Also it is possible to Broadcast the message or request from master to to all slave microcontrllers


2. If so how can I broadcast the message from Master microcontroller to all the slave microcontrollers? I want to implement this in STM32f103C8T6 to send message to all my slave STM32F103C8T6 microcontrollers. And I want to get back the response from only one slave with the 10 sensor data values. Is this fesible through MODBUS? If yes, let me know how? If no, let me know why?

3. If it is fesible, will there be any collision? If yes, let me know why? If no, let me know how?

My hardware is fixed I can not change anything from my hardware part. I have started my Thesis in company in the software part in programming the STM32F103C8T6 with stm32 official core in Arduino IDE. So, I have four similar PCB board with STM32F103C8T6 have some temperature sensor's, LED's, motors's, PWM generator's. My goal is to make one microcontroller as Master and other three as Slave. And Master should be having HMI (Human Machine Interface.). All the slave microcontrollers will have the same funtionalities as Master except HMI.

My processes should look similar to this:
i. I should be able to give Inputs or set some limits or something like that from HMI to Master microcontroller.
ii. The limits or inputs or whatever must be set in the Master microcontroller and from Master microntroller all those inputs or limits must be set for Slave microcontrollers as well.
iii. Then the Master microntroller should be able to send the broadcast request or message to all the slave microcontrollers to get all the data's.
iv. Then the Master microcontroller must get all the sensor values or states of the LED's or Motor's or whatever from Master microcontroller itself.
v. Then, all this data's to be stored sepeartely in Master microntroller.
vi. (from iii.) When the Master microntroller has sent the broadcast request or message to all the slave microcontrollers. (same as iv. for slaves) Then all the slave microcontrollers must get all their sensor values or states of the LED's or Motor's or whatever from themself. (same as v. for slaves) And stored sepeartely in them itself.
vii. Then Master microcontroller should send request or message to each slave microcontroller, one after one to get the stored values or states of the LED's or Motor's or whatever from the Slave microcontroller to the Master microcontroller.
viii. Then there must be over all check in the Master microcontroller to check all data is available for HMI.
ix. If something is missing then the Master must get the missing data from itself or from slaves.
x. Then the Master to should send all the data to HMI from Master Microcontroller.

So, basically I will be controlling the whole thing with HMI having my Master microntroller connected to it and all other Slave microcontrollers connected to Master microcontroller.

4. Is it possible to do my whole above process in 500 milliseconds? If yes, let me know how? If no, let me know why?

5. How much time will take for the whole process in your opinion?

6. Is there any examples of implementing all these?

7. What are difficulties I might face?

8. For what I must be prepared?

Fow each how and why question please try to give atleast minimum description please.

Your answers will be really helpfull for my thesis. Let me know your suggestions, oppinions, and guidence. I would like to here from all of you. Thanks in Advance.

Greeting,
Mustaq.
asked Oct 1 in Modbus and Industrial Automation by mustaq_ahm New to the Community (0 points)

Please log in or register to answer this question.

...