MODBUS
EXACTLY WHAT IS MODBUS?
Modbus is a communication protocol developed by Modicon systems. In simple terms, it is a
method used for transmitting information over serial lines between electronic devices. The
device requesting the information is called the Modbus Master and the devices supplying
information are Modbus Slaves. In a standard Modbus network, there is one Master and up
to 247 Slaves, each with a unique Slave Address from 1 to 247. The Master can also write
information to the Slaves.
WHAT IS IT USED FOR?
Modbus is an open protocol, meaning that it's free for manufacturers to build into their
equipment without having to pay royalties. It has become a very common protocol used
widely by many manufacturers throughout many industries. Modbus is typically used to
transmit signals from instrumentation and control devices back to a main controller or data
gathering system.
HOW DOES IT WORK?
Modbus is transmitted over serial lines between devices. The simplest setup would be a
single serial cable connecting the serial ports on two devices, a Master and a Slave.
The data is sent as series of ones and zeroes called bits. Each bit is sent as a voltage.
Zeroes are sent as positive voltages and a ones as negative. The bits are sent very quickly.
A typical transmission speed is 9600 baud (bits per second).
Controller Area Network or CAN protocol is a method of communication between
various electronic devices like engine management systems, active suspension,
ABS, gear control, lighting control, air conditioning, airbags, central locking etc
embedded in an automobile. An idea initiated by Robert Bosch GmbH in 1983 to
improve the quality of automobiles thereby making them more reliable, safe and fuel
efficient. With the developments taking place in the electronics and semiconductor
industry the mechanical systems in an automobile were being replaced by more
robust electronics system which had an improved performance. New technologies,
products and inventions with added or improved functions started to shape a
complete new era for the automobile industry which promised more robust vehicles
with use of electronics. The increasing number of electronic devices used
communication signals with more complex interrelations between them. Thereby
making the life difficult for automobile engineers when they designed systems
wherein one electronic device needs to communicate with others to operate.
Realizing the problem of communication between different electronic modules
Robert Bosch came up with this new protocol called CAN which was first released in
1986. CAN provide a mechanism which is incorporated in the hardware and the
software by which different electronic modules can communicate with each other
using a common cable.
Need for CAN
A vehicle contains a network of electronic devices to share information/data with
each other. For example A spark ignition engine requires a spark to initiate the
combustion chamber at the correct time so it communicates with engine control unit
that adjusts the exact timing for ignition to provide better power and fuel efficiency..
Another example is of a transmission control unit that changes the ratio of gear
automatically with the changing speed. It uses information from engine control unit
and various sensors in the system. Every electronic device has an ECU/MCU
(electronic/microcontroller control unit) with its own set of rules to share/transfer
information. For two or more devices to interact they should have the necessary
hardware and software which allows them to communicate with each other. Before
CAN was introduced in the automobiles, each electronic device was connected to
other device using the wires (point to point wiring) which worked fine, when the
functions in the system were limited. The figure below is the pictorial view of the
point to point wiring connection.
Fig. 1: Image Showing Point to Point Wiring Connection In A CAN Protocol
One of the major problems for automotive engineers was linking the ECUs of the
different devices so that real time information can be exchanged. CAN protocol was
designed to address this problem. It laid down the rules through which the various
electronic devices can exchange information with each other over a common serial
bus. This in turn reduced the wiring connections to a great extend thereby reducing
the bulkiness and complexity of the system. The image below shows how the
different devices are connected using the CAN protocol.
Fig. 2:
Algorithmic Diagram Showing Connectivity Between Various Devices Using CAN Protocol
Also the standard technology of time, asynchronous transmitter/receiver did not
support multi domain communications. Domain is a group of electronic devices that
have almost similar requirements to work in the system. For example CD/DVD
PLAYER, GPS system, monitors and displays etc. form a single domain. Similarly air
conditioning and climate control, dashboards, wipers, lights doors etc. form another
domain. Hence the electronic devices implanted in a vehicle can be classified under
different domain. CAN facilitates multi-domain communication for the engineers.
NEED OF RS232
Simple analog communication over the telephone wires to the typical USB cables for
data exchange, we surely have come a long way in the field of
communication. RS232 was the first milestone reached in this journey. It was a
standard for electromechanical typewriters and modems for digital data exchange
introduced in 1962 by the Radio Sector of EIA. It made the data exchange more
reliable over analog channel. The standard defined voltage levels that made it
immune to noise disturbances and reduced the error in data exchange.
As the technology was growing many electronic devices were being developed
during this time like computers, printers, test instrument etc. There came a time
where manufacturers felt the need to exchange information between these electronic
devices. For example data exchange between a computer and a printer or two
computers. But there was no standard or method to accomplish this
task. RS232 was the only available standard at the time which was used for data
exchange. So, they thought of adopting this standard in electronic devices for digital
data exchange. But the standard was unable to fulfill the requirements as it was
developed specifically for modem and teletypewriter. To overcome this problem,
designers started implementing an RS232 interface compatible to their equipments.
Like a computer of HP will only be able to use HP peripheral devices. Because of
this the market was flooded with different manufactures with their own standards for
their devices. This led to the common problems like non-standard pin assignment of
circuits on connectors, and incorrect or missing control signals. The lack of
adherence to the standard produced a thriving industry of breakout boxes, patch
boxes, test equipments, books and other aids for the connection of dissimilar
equipments. So, to put an end to all theses disparities in equipments, syndicate of
manufacturers built a transmitter that supplied +5V and -5v and labeled them as “RS-
232” compatible and they are same till date. The standard has been revised many
times after the initial one and updated by Electronic industries association. The name
of standard was also changed from RS232 to EIA232. The Electronic Industries
Association published three modifications, the most recent being EIA232F
introduced in 1997.
What is RS232 - "RECOMMENDED STANDARD 232"
RS-232 is a standard communication protocol for linking computer and its
peripheral devices to allow serial data exchange. In simple terms RS232
defines the voltage for the path used for data exchange between the devices. It
specifies common voltage and signal level, common pin wire configuration
and minimum, amount of control signals. As mentioned above this standard
was designed with specification for electromechanically teletypewriter and
modem system and did not define elements such as character encoding, framing of
characters, error detection protocols etc that are essential features when data
transfer takes place between a computer and a printer. Without which it could not be
adopted to transfer data between a computer and a printer. To overcome this
problem a single integrated circuit called as UART known as universal asynchronous
receiver/transmitter is used in conjunction with RS232.