Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Need Some help Regarding interfacing with MODBUS Protocol with PIC18F4550 Microcontol

Status
Not open for further replies.

abhishekdixit

Full Member level 2
Joined
Dec 30, 2011
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
India
Activity points
2,182
Hello,
i want to interface MODBUS protocol with PIC18F4550. i have studied documents about the MODBUS protocol form the Internet.but still i am unable to know hoe to interface it.
So if anybody has any documents and example about this protocol then please help me
Thank You
 

Are you trying to implement a MODBUS Master or Slave on the PIC?
 

Have you looked at any of the 32,000 or so matches on a Google search for "PIC18F4550 modbus", some of which are from this very web site?
Susan
 

If you need Modbus Master I asume there is a slave nearby that you need to connect to. In that case, modbus devices sometimes come with a lengthy manual describing the protocol. There should be something, since you need to know what's on every register to understand the information. You should also know what function codes are of interest.

One way to approach this, again, if you have a slave, is to download a generic modbus master software for PC and start reading the slave to understand the protocol. I like modbustool, as generic as that sound there is an actual software called that.

The protocol then is rather simple, you can just read or write a table. The table has 16 bit registers. The slave only answers to queries from the master. The master message is composed by slave address, function code, starting register to read, amount of registers to read and a 16 bit checksum. All this goes thought a serial port set as the slave dictates.

This is an example of a read message:
Code:
MASTER:
[64] [03] [00] [4C] [00] [04] [8C] [2B]
SLAVE:
[64] [03] [08] [00] [01] [00] [00] [00] [00] [00] [01] [AB] [1A]

This reads 4 registers starting from register 0x4C on the slave identified with the number 100 or 0x64.

This is an example of a write message
Code:
MASTER:
[64] [10] [00] [52] [00] [04] [08] [00] [01] [00] [00] [00] [00] [00] [01] [FB] [56]
SLAVE:
[64] [10] [00] [52] [00] [04] [69] [EE]

This writes 4 registers from the slave 100 or 0x64 starting from address 0x52.

You will find a lot of info online.
 

Hello guys,
I have searched on internet about the modbus. here i got the code, but first of all i want to understand the concept og modbus protocol. after that i want to go for code debugging. So please anybady has any link or some pdfs on which i get the information about the modbus protocol in both master ans slave mode.
Thank you
 

Hi,

I don´t know what you mean...
There is a lot of documentation online..

I did a (10 seconds) test with google
"Modobus protocol description"

The first hit brought me to "modbus.org"
And after accepting the license agreement you may downlod the specification.
This is not difficult.

The document is named: Modbus_Application_Protocol_V1_1b3.pdf

Do you need soemthing else?

(Even the examples of Daniel_Arg are easy to understand. For sure this is not the complete protocol, but it gives a brief introduction how it works)

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top