New beginning to Modbus

A

Thread Starter

arvind vyas

Hi,

I am very new to modbus. I have downloaded a RTU slave code from the net and also got a Master simulator (simply modbus). now i am able to communicate between my 8051board (SLAVE) and PC Simulator (MASTER) on RS232 port. Writing & Reading the COIL & REGISTER is the only thing i have achieved till now. Please let me know what else i can do as an experiment to explore much about modbus.
 
R

Rishabh Mishra

You should try with analysis of different function codes as i think u have checked with single float and digital values. now check with multiple digital and analog read and write.

If you start with function codes one by one. Its lot of things you can learn and analyse.
 
L

Lynn August Linse

8051? Brings back memories (& a few cold-sweats!) :)

In truth, that is about it. Modbus is a 'memory copy' protocol which one uses to copy blocks of bits and words between 2 devices. What the data means is not Modbus's concern.

As mentioned, you could play with how words, floats, strings (etc) are encoded into 16-bit registers, but in teh end there is no right answer and you find that different vendors do it differently.

100% of vendors use the bit/word copy functions of Modbus. Only a few % use any of the other features (the FIFO, files, diagnostics, etc).
 
A
I have tried the function codes for Single & multiple write for coil & register. The slave code i have downloaded supports only the following function codes: 01, 03, 05, 06, 15, 16, and has no error checks for the timings (3.5 or 1.5 char time). It just checks parity and CRC. Can you please provide me the MODBUS RTU SLAVE CODE for 8051?
Thanks in Advance...
 
Top