HEY GUYS, i need some example code of modbus rtu with 8051 controller
So just use that as your example, then!
Again, the MODBUS protocol remains the same whether you are using a PIC or an 8051 or anything else.
The only bit that's going to be different is the bit that directly talks to the 8051 UART hardware - but that bit has nothing to do with MODBUS.