Hello @fchai.1 and welcome to Community 😀 ,
I advise you to take a look at "STM32 Master MODBUS LL Library" example.
Also, this discussion can help you to implement the MOBUS TCP.
Hope my answer helped you!
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.