You are on page 1of 18

ACKNOWLEDGEMENT

We would like to thank our external guide, Mr.Vasant Mahishi for giving us
an opportunity to work on this project. We express our utmost gratitude for his
scholarly guidance and extensive help at every step of our project.
We profusely thank our Director Dr. Pramod Kale and our University
co-ordinator Dr. A. D Shaligram for their inspiration in the making f the project.
We would also like to thank our internal project guide Mrs.Preeti Salunke,
Ms. Charuta Sumant and Mr. Zambre and for their constant support and
encouragement towards the completion of the project.

Lastly we would like to thank the ICIT staff for their timely help.
Priyanka Bagade
Debolina Chakraborty
Tejaswini Patil
CONTENTS PAGE NO.
1. INTRODUCTION
1.1 Relevance to Preset Industrial Scenario
1.1.1 Domain filed of project
1.1.2 Reasons to select this project
1.1.3 Aim and objectives
2. PROJECT PLANNING
2.1 Target specifications
2.2 Block diagram
2.3 Description
3. PROJECT DETAILS
3.1 Introduction to VB
3.2 What is RS 485
3.3 Query-Response Cycle
3.3.1 Modbus messages
3.3.2 Serial Transmission modes
3.3.3 Flowcharts
4. EXECUTION EFFORTS
4.1 Recourses utilized
4.2 Testing and Debugging
4.3 Results and Discussion
5. ADVANTAGES
6. APPLICATIONS
7. FUTURE SCOPE
8. REFERENCES

1. INTRODUCTION

1.1 RELEVANCE TO PRESENT INDUSTRIAL SCENARIO:


Presently Parameters of the Genset were measured directly from the
instruments.
To take the readings or measurements user has to monitor the measurement
instruments at the site to take parameters readings such as temperature, oil
pressure, engine speed etc.
But with this project those parameters can be measured directly on PC.

1.1.1 DOMAIN FIELD OF PROJECT:


In this project a graphical user interface is developed to take direct readings of
the parameters of genset with help of modbus protocol, RS 485, RS 232 and
Visual Basic (software) on PC.

1.1.2 REASONS TO SELECT THE PROJECT:


Project was to be designed in Visual Basic on which we had a little experience. It
was a good chance for us to acquire VB skills. We reduced the manual efforts in
the total execution with software usage.

1.1.3 AIM:
To monitor gensets using GUI development in Visual Basic 6.0

OBJECTIVE:

To create portable software for monitoring gensets and detect faults if any.

2 .PROJECT PLANNING

2.1 TARGET SPECIFICATIONS:


• SOFTWARE SPECIFICATIONS

• OPERATING SYSTEM: Windows XP

• GUI FORMAT:

1. Engine Parameters: Temperature, oil pressure, engine


speed.
2. Electrical Parameters: Battery voltage
3. Fault Screen: Log off faults with time.
4. Load Curve Display.

• HARDWARE SPECIFICATIONS

1. Engine Control Protocol (ECP)


2. Modbus Converter, Modbus 232
3. RS-485 Communication
2.2 BLOCK DIAGRAM:

Send

MODBUS GRAPHICAL
ECP CONVERTER USER
METER INTERFACE
(GUI)

RS-485
RS-232

2.3 DESCRIPTION:

1. GRAPHICAL USER INTERFACE (GUI):


Display screens:
1. User and password
2. Engine configuration
3. Send query
4. Engine Parameters

2. MODBUS CONVERTER:
MODBUS is a serial communication protocol published by Modicon.
Variety of industrial electronic devices can be interfaced. It is often used to
connect supervisory computer with a remote terminal unit (RTU) in supervisory
control and data acquisition (SCADA) systems.
3.1 RS 232 COMMUNICATION:
• RS232 ports on the PC are assigned to a single device.
• Serial communication is established with the COM1 port.
• Maximum cable length 50 ft
• Maximum data rate 10 Kbps-20 Kbps.
• This is an example of point to point communication (one port
communicates with one device).

3.2 RS 485 COMMUNICATION:


RS-485 is based on master slave architecture. All transactions are initiated by
master.
• Independent channels are established for two-way (full-duplex)
communications.
• Maximum data rate 100 Kbps-10 Mbps.
• Maximum 255 peripherals can be connected

4. ECP METER (Engine Control Parameters):

The ECP has capacity to respond to the queries from the host computer. Host
sends customer data request commands (CDR) to request engine at address to
respond.
The 4 character message is detected by all the ECP’s connected on the 2 wire
bus. The ECP which has been, assigned the address responds by transmitting
specific 30 byte message. The ECP first echoes address by sending back the
characters ENGn followed by the 4 bytes each from the internal display buffer in
the same order as they appear on the digital display. The ECP then transfers its
one status flag byte, followed by one checksum byte.
This unit provides engine control parameters like Water Temperature, Lube Oil
pressure, Battery Voltage, Engine Hours, RPM in our application.
3. PROJECT DETAILS

3.1 INTRODUCTION TO VB:


• Programming for the Windows User Interface is extremely complicated.
• Other Graphical User Interfaces are complicated.
• Visual Basic provides a convenient method for building user interfaces.
• Visual Basic can interface with code written in C, for efficiency.

3.2 WHAT IS RS485?


RS485 or EIA (Electronic Industries Association) RS485 is a balanced line, half-
duplex transmission system allowing transmission distances of up to 1.2 km. The
following table summarizes the RS-485:
Standard:
3.3 QUERY-RESPONSE CYCLE:

3.3.1 MODBUS Messages


Communication on a MODBUS Network is initiated (started) by a “Master” with a
“query” to a “Slave”. The “Slave “ which is constantly monitoring the network for
“Queries” will recognize only the “Queries” addressed to it and will respond either
by performing an action (setting a value for example) or by returning a
“response”. Only the Master can initiate a query.
In the MODBUS protocol the master can address individual slaves, or, using a
special “Broadcast” address, can initiate a broadcast message to all slaves. The
SPR and Integra products do not support the broadcast address.
3.3.2 MODBUS Message Format
The MODBUS protocol defines the format for the master’s query and the slave’s
response.
The query contains the device (or broadcast) address, a function code defining
the requested action, any data to be sent, and an error-checking field.
The response contains fields confirming the action taken, any data to be
returned, and an error-checking field. If an error occurred in receipt of the
message, or if the slave is unable to perform the requested action, the slave will
construct an error message and send it as its response.

3.3.3 SERIAL TRANSMISSION MODES:


There are two MODBUS serial transmission modes, ASCII and RTU.

1. RTU Mode
In RTU (Remote Terminal Unit) mode, each 8-bit byte in a message contains two
4-bit hexadecimal characters. The main advantage of this mode is that its greater
character density allows better data throughput than ASCII for the same baud
rate, however each message must be transmitted in a continuous stream.

The format for each byte in RTU mode is:


1. Coding System: 8-bit binary, hexadecimal 0-9 , A-F
2. Two hexadecimal characters contained in each 8-bit field of the message.
3. Bits per Byte: 1 start bit,
4. 8 data bits, least significant bit sent first 1 parity bit for even/odd parity; no
parity bit for no parity; 1 stop bit if parity is used; 2 stop bits if no parity
5. Error Check Field: Cyclical Redundancy Check (CRC)
The SPR and Integra products support MODBUS RTU mode. Integra additionally
supports a common alternative format with 1 stop bit and no parity.
RS232, RS422 AND RS485 TRANSMISSION STANDARDS
The Electrical Industries Association, (EIA) introduced the Recommended
Standards, RS232, RS422 and RS485. These standards define the electrical
performance of a communications network. The table below is a summary of the
different physical link offered by the three standards.

Note: RS232C has been abbreviated to RS232. The RS232 standard allows a
single instrument to be connected to a PC, a Programmable Logic Controller, or
similar devices using a cable length of less than 15M.
The RS485 standard allows one or more instruments to be connected (multi-
dropped) using a two wire connection, with cable length of less than 1200M. 31
Instruments and one ‘master’ may be connected in this way. The balanced
differential signal transmission is less prone to interference and should be used
in preference to RS232 in noisy environments.
RS422/RS485 is recommended for plant installation. Although RS485 is
commonly referred to as a ‘two wire’ connection, a ground return/shield
connection is provided as a ‘common’ connection for Series 2000 Instruments,
and in general this should be used in installations to provide additional protection
against noise.
Strictly speaking, RS422 is a standard permitting ‘point to point’ connection of
two pieces of equipment using a full duplex, differential signal on two pairs of
wires. In principle, therefore, an RS422 link only allows a single instrument to be
connected to a PC. However, Series 2000 instruments provide an enhanced
version of RS422 that also meets the full electrical requirements of RS485
described above. This allows up to 31 instruments to be connected on the same
network, but only with a 5 wire electrical connection. The transmission and
reception of data use two pairs of twisted cable, with a separate cable
provided for common. The optional screen will provide additional noise immunity.

SERIAL COMMUNICATION:
Serial communication is a popular means of transmitting data between
a computer and a peripheral device such as a programmable instrument or even
another computer. Serial communication uses a transmitter to send data, one bit
at a time, over a single communication line to a receiver. You can use this
method when data transfer rates are low or you must transfer data over long
distances. Serial communication is popular because most computers have one or
more serial ports, so no extra hardware is needed other than a cable to connect
the instrument to the computer or two computers together.
Serial communication requires that you specify the following four
parameters: the baud rate of the transmission, the number of data bits encoding
a character, the sense of the optional parity bit, and the number of stop bits.
. The figure shows a typical character frame encoding the letter m.

A byte is sent as a package including a start bit, data bits, sometimes a parity bit,
and stop bits.
Baud rate is a measure of how fast data are moving between
instruments that use serial communication. RS-232 uses only two voltage states,
called MARK and SPACE. In such a two-state coding scheme, the baud rate is
identical to the maximum number of bits of information, including control bits that
are transmitted per second.
MARK is a negative voltage, and SPACE is positive. The previous
illustration shows how the idealized signal looks on an oscilloscope.
The following is the truth table for RS-232:
Signal > +3 V = 0
Signal < –3 V = 1
The output signal level usually swings between +12 V and –12 V. The
dead area between +3 V and –3 V is designed to absorb line noise.
A start bit signals the beginning of each character frame. It is a
transition from negative (MARK) to positive (SPACE) voltage. Its duration in
seconds is the reciprocal of the baud rate. If the instrument is transmitting at
9600 baud, the duration of the start bit and each subsequent bit is about 0.104
ms. The entire character frame of eleven bits would be transmitted in about 1.146
ms. Data bits are transmitted upside down and backwards.
An optional parity bit follows the data bits in the character frame. The
parity bit, if present, also follows inverted logic, 1 for negative voltage and 0 for
positive voltage. This bit is included as a simple means of error handling. You
specify ahead of time whether the parity of the transmission is to be even or odd.
RS-232 STANDARD:
This standard has been adopted for use in serial communications between
computers and printers, modems, and other equipment. The serial ports on
standard IBM-compatible personal computers follow RS-232.
The serial ports on standard IBM PC

Line Line Name Line Type Function


#
1 Carrier Detect Handshak Determines if the port is connected to a
e working device.
2 Receive Data Data Receives information from the device.
3 Transmit Data Data Computer sends information to the device.
4 Data Terminal Handshak Computer tells the device that it is ready to
Ready e talk.
5 Signal Ground Common Pin is grounded.
6 Data Set Handshak Device tells the computer that it is ready to
Ready e communicate.
7 Request To Handshak Computer asks the device if it can send
Send e information.
8 Clear To Send Handshak Device tells the computer that it can send
e information.
9 Signal Other Computer acknowledges that a signal was
Indicator detected.
Figure shows what an RS-232 connector looks like. Contain 9 different pins each
of which has its own separate function.

Null Modem Pin Connection:

25 Pin9 Pin 9 Pin25 Pin


FG (Frame Ground) 1 - X- 1 FG
TD (Transmit Data) 2 3 - 2 3 RD
RD (Receive Data) 3 2 - 3 2 TD
RTS (Request To Send) 4 7 - 8 5 CTS
CTS (Clear To Send) 5 8 - 7 4 RTS
SG (Signal Ground) 7 5 - 5 7 SG
DSR (Data Set Ready) 6 6 - 4 20 DTR
DTR (Data Terminal Ready) 20 4 - 6 6 DSR
4. EXECUTION EFFORTS

4.1 RESOURCES UTILIZED:


• Software tools:
1. Visual Basic 6 Software
2. Keil Compiler for testing purpose.
3. 8051 Microcontroller for testing Serial Communication.
4. ECP Meter and Modbus Converter hardware.

4.2 TESTING AND DEBUGGING:


1. Serial Communication code testing on 8051 kit.
2. Testing buffer clearance using Null Modem.
3. Cyclic redundancy check code testing.
4. Serial Communication using ECP meter only.
5. Serial Communication with ECP over Modbus protocol using
Modbus converter hardware.

4.3 RESULTS AND DISCUSSION:


1. Created GUI for controller configuration, sending and
receiving parameters.
2. Transmission and reception of parameters.
3. Direct communication with ECP
4. Communication over Modbus protocol.
5. Discussion with project guides regarding testing,
communication, generation of CRC, reference of manuals for
Modbus protocol.

5. ADVANTAGES:
• Easy to use

• Portable

• Does not require human intervention.

• Easily upgradable.

6. APPLICATIONS:
• Used in shopping malls and at industrial sites.
• Can be used at different sites.
• Used for security purposes

7. FUTURE SCOPE:
• Fault can be detected if a failure occurs in any of the ECPs.
• Different machines can be connected such as ECPG and
PowerComms.
8. REFERNCES

• VB 6.0 Programming Black Book


• Modicon Modbus Protocol Reference Guide
• RS485 & Modbus Protocol Guide
• Serial communication in VB manual

8.1 INDIVIDUAL CONTRIBUTION


1. Priyanka Bagade (06BE501):
• Visual Basic 6.0 coding and creating GUI.
• Synopsis and weekly report submission.
• Testing serial communication on kit.
• Testing modules in company.
• Project presentation
• Project report

2. Debolina Chakraborty (06BE504):


• Synopsis submission
• Testing serial communication on kit

3. Tejaswini Patil (06BE534):


• Synopsis
• Project report

You might also like