Today is...
Sunday, December 16, 2018
Welcome to the Modbus Community, about
the world's leading automation protocol.
Sample Modbus Code with 8051
Looking for some example Modbus RTU code for 8051 controller

hello guys,

I have some sensor code, and I want to communicate this sensor with Modbus RTU. So I need some example code of modbus rtu with 8051 controller.

Hi,

There are doubtless many other people on this forum who are willing to help, but a little more information would be most helpful. :-)

For example, have you worked with Modbus comms before?

Is this sensor a serial Modbus device or does it use Modbus over Ethernet? (Or even Modbus Plus?)

Your sensor is most probably a Modbus slave device (it waits for a
valid Modbus request, then replies to the master device), but what is your master device?

What is this "8051" you're referring to? Is it the well known Intel microcontroller?

(I can help a bit with Modicon PLC code, but my knowledge of Intel assembly code is a little rusty these days. :-) )

Regards,
Roger V.

Hey thanks for reply,

Actually i have wind speed wind direction sensor in which siliconlab controller c8051f350 has been used. i have one terminal software in which i make a serial communication through RS485. i have made some protocol that are used for pulling a data from sensor by sending a request, and that type of code i have written in my sensor code. now i want to use addressed based Modbus rtu for pulling a data from sensor. i have to make a code with 8051 controller. and i don't know how to start...

By John Catch - InFLOW, INC. on 1 June, 2018 - 9:53 am

You might try contacting Micromint, LLC (www.micromint.com). They specialize in 8052 chips and have available code.