Microprocessor and Development Tools - Embedded Control - Communications - Connectivity
   
Low-Cost Dev Kits
Application Kits
RabbitCores
Latest Downloads
Single-Board Computers
Rabbit Support Forums
Training/Events



Support > Ask Larry > March 20th, 2008

Ask Larry

Dear Larry,

I understand that there are several serial protocols out there, and I have heard about Modbus. Can you go over what Modbus is, and if it’s available for Rabbit products?

Jerry C.

Hi Jerry, I’ll be more than happy to cover the topic of Modbus. First off, Modbus is one of the many serial protocols available in the embedded industry that allows devices to communicate with one another. Historically, the Modbus specification was published in 1979 by Modicon, now a brand of Schneider Electric's Telemecanique. Modbus enables a master to communicate with multiple clients via a number of serial protocols: RS232, RS485, TCP/IP, etc.

The Modbus protocol consists of messages produced by the master and responses from the addressed client. The format of the messages is essentially identical for both the master and client and is called the Modbus Protocol Data Unit (PDU). The contents of the PDU are: Modbus Function Code followed by Data. The Function Code is a single byte. The number of bytes in the Data is primarily determined by the Function Code. The first bytes of the Data can also contain information which may determine the number of bytes in the Data field. The total length of a Modbus message must be no longer than 256 bytes.

In order for the master to be able to send messages to multiple clients there must be an addressing mechanism. For Modbus over a serial line, some more information is added to both ends of the PDU. This new message type is called the Application Data Unit (ADU). In the case of RS485 the additional information is an address field of one byte and a two byte CRC. This means that the maximum size of the Data field is 253 bytes. For Modbus over TCP/IP there are seven additional bytes leaving up to 249 bytes for data.

As for the Rabbit products, we offer a module that supports Modbus RTU (binary mode – we do not currently support Modbus ASCII) over a serial port as well as via TCP/IP. The library also supports having a Rabbit device as a Modbus/TCP to Modbus/Serial gateway. The module contains libraries that support a few of our board products: BL2600, LP3500 and OP7200. The documentation within these libraries should be sufficient for you to develop libraries which support any of our board products. If you do this, I strongly suggest that you use the I/O mapping in MODBUS_SLAVE_BL26xx.LIB as a guide. It is also possible to develop a library for any of our Rabbit Core Modules, but that would probably not be as useful since all you could do would be to program and read the I/O registers.

You can also use our Modbus libraries to communicate between a Rabbit and a non-Rabbit product. You will need to create a set of functions, probably in a library, that define the mapping of the non-Rabbit products’ I/O and the standard Modbus functions.

Well Jerry, I hope this was helpful for you. Good luck on your embedded development and to your future projects.

- Larry C.

Larry Cicchinelli is Rabbit’s Technical Support Manager. He has 30 years of embedded experience, and is considered one of the foremost authorities on Rabbit products. Larry and his staff offer comprehensive technical support to Rabbit customers.

Submit your questions for Larry via email at AskLarry@rabbit.com

Read more Ask Larry Answers




   Site Map | Privacy Policy | Contact Us | Feedback Copyright © Rabbit All Rights Reserved    A Digi International® Brand  
View Cart | Contact Us
View Cart
Products Solutions Support Company Channel partners Careers Ordering Information