cancel
Showing results for 
Search instead for 
Did you mean: 

How to check Modbus RTU 'Slave'?

DK.7
Senior

I studying a Modbus RTU 'Slave' and in my opinion I did everything right according to this library https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS

I want to check, do I right Implemented a code by controlling a built-in LED.

But there is no knowledge how to check it out! Only guesses and no more!  

Do I need to create a variable that will be 'tied' to a register which turns on/off the LED and find out variable's address?!?

Something like this for example:

valotile uint8_t p = HAL_GPIO_ReadPin(LED_GPIO_Port, LED_pin);
printf("Adress of variable 'p' is: %p\r\n", &p); // 0x20004ff7

And then we know the address of the variable to write it into the simulator of Modbus master.

Is it correct?

0 REPLIES 0