Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/318419440

" Real Time Automated Control using PLC-VB Communication "

Article · June 2013

CITATIONS READS

0 3,991

3 authors, including:

Vinod Kumbhar Arjun Nichal


DKTE Society's Textile and Engineering Institute Ichalkaranji Adarsh Institute of Technology & Research Center Vita
1 PUBLICATION   0 CITATIONS    19 PUBLICATIONS   22 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Combined fractal + SPIHT compression technique View project

All content following this page was uploaded by Arjun Nichal on 14 July 2017.

The user has requested enhancement of the downloaded file.


Prof.Mrs.S.S.Bidwai, Prof.Mr.V.B. Kumbhar, Prof.Mr. A.R.Nichal / International Journal of
Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 3, Issue 3, May-Jun 2013, pp.658-661
“Real Time Automated Control using PLC-VB Communication”
Prof.Mrs.S.S.Bidwai1, Prof.Mr.V.B. Kumbhar2, Prof.Mr. A.R.Nichal3
1
ADCET Ashta Electonics and Telecommunication Dept, Ashta, Dist-Sangli. , India.
23
AITRC Electonics and Telecommunication Dept, Vita, Dist-Sangli. , India.

Abstract
This paper is to enable the Delta PLC control process or machines. They can store
(Programmable Logic Control) DVP14SS to instructions like sequencing counting, timing,
communicate with the Visual Basic 6.0. The arithmetic, data manipulation and communication
communication between DVP14SS and Visual [2]. A PLC is an example of a hard real time system
Basic 6.0 is via Modbus Serial Protocol. since output results must be produced in response to
Computers are used as a link between humans input conditions within a bounded time, otherwise
and PLC systems as they have more graphics and unintended operation will result.PLC reads the
visual capabilities. These are nothing but SCADA status of the external input devices, e.g. keypad,
systems widely used for determining plant set- sensor, switch and pulses, and execute by the
ups and displaying plant status on high quality microprocessor logic, sequential, timing, counting
screens. They also record/log the system data for and arithmetic operations according the status of the
long period .The SCADA software’s are the input signals as well as the pre-written program
software packages needs to be purchased from stored in the PLC [5]. The generated output signals
vendors and the cost depends on tag count. are sent to output devices as the switch of a relay,
Visual Basic 6.0 platform can be used develop the electromagnetic valve, motor drive, control of a
SCADA application effectively. Using VB 6.0 we machine or operation of a procedure for the purpose
integrate software and hardware across of machine automation or processing procedure.
spectrum of vendors easily. Here we show simple
approach to communicate Delta PLC with visual Visual Basic (VB) is developed by
Basic using MSComm control in visual basic. By Microsoft Corporation and is most widely used
means of Visual Basic cost effective solution is development environment in the world. Visual
possible as Visual Basic we do not need to Basic is tool provides platform to develop new
purchase licenses and is cheaper than SCADA optimum Windows/SCADA applications. Visual
packages. It also has the advantages like Basic can communicate with PLC with various ways.
flexibility. Visual Basic does not have code for communication
protocol inbuilt. User need to write code for
Keywords—MSComm control and PLC, plc, communication protocol or need to purchase
communication between PLC and VB 6.0, DVP14SS. ActiveX controls which are used to develop
applications. ActiveX control with Libraries can be
I. INTRODUCTION purchased to develop application. Here we are using
Communication has become a major part MSComm ActiveX control freely available in VB to
of any process control automation system. Today establish communication with delta PLC.
PLC communication is as much for data acquisition
as plant control. The objective of communication is II.Method of Interfacing
to collect or transfer large / small amount of data. Delta DVP14SS comes with serial port and
Over the course of time certain interfacing standards the communication protocol is serial Modbus
have been generated by industry in order to make protocol which is a open protocol. Visual Basic acts
communication between systems from two different as a Modbus Master device which issues request or
manufacturers more simple. These standards commands (Query) on serial bus which is received
typically defined the communications medium, by slave. PLC acts as a Modbus slave device and
transmission voltages, speed of communication, responds to the Master by sending massage called
(baud rate). The first such real standard was RS232. response. Modbus Query and Response contains
This was written by the Electronic Industries fields like device address, function code, data, and
Association (EIA). The main advantage of this error check [1]. Figure 1 shows the system block
being cost as RS232 interfaces are very simple and diagram.
thus cheap, plus of course the fact that most PCs,
which are used more and more in automation
systems today, have at least one RS232 (serial)
interface as a standard.
Programmable Logic Controllers (PLC’s)
are solid state devices using integrated circuits to

658 | P a g e
Prof.Mrs.S.S.Bidwai, Prof.Mr.V.B. Kumbhar, Prof.Mr. A.R.Nichal / International Journal of
Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 3, Issue 3, May-Jun 2013, pp.658-661
TABLE III RESPONSE FROM SLAVE
Example
Field Name
(Hex)
Slave Address 01

Command code 02

Bytes Count 05
Fig 1 Block Diagram Data ( Coils CD
Y033…Y024)
Table 1 shows the function codes Data ( Coils 6B
supported by the DVP14SS PLC. By using function Y043…Y034)
code Master device can request data such as, Read
Data ( Coils B2
coil status, Read input status, Read Holding Register,
Force Single coils, etc.Slave device will repeat this Y053…Y044)
function code in its reply to indicate that slave has Data ( Coils 0E
received the function code and acted upon it [3]. Y063…Y054)
Default protocol used by the delta plc is ASCII Data ( Coils 1B
mode, 9600baud rate, 7 bit data length, even parity Y070…Y064)
and 1 stop bit [4]. Error Check(LRC) E5
TABLE I
FUNCTION CODE FOR DELTA PLC The PLC receives the messages without a
communication error, but cannot handle it, an
Code Name Description
exception response willreturn to the master device.
01 Read Coil Status S, Y, M, T, C In the exception response, the most significant bit of
S, X, Y, M,T, the original command code is set to 1, and an
02 Read Input Status exception code explains the condition that caused
C
Read Holding the exception is returned. Table 4 shows message
03 T, C, D response with exception code. [3] [4]
Registers
05 Force Single Coil S, Y, M, T, C TABLE IIV EXCEPTION RESPONSE FROM SLAVE
06 Preset Single Register T, C, D Field Name Example (Hex)
15 Force Multiple Coils S, Y, M, T, C Heading 3A
Preset Multiple
16 T, C, D Slave Address 01
Register
17 Report Slave ID None Function 81
Exception Code 02
Table 2 shows the Query format to read Input Status
of contacts Y20 to Y47from slave device address 01 Error Check ( LRC ) 7C

TABLE II QUERY TO READ INPUT STATUS Y20 - Y47 Table 5 shows different exception codes available in
Field Name Example (Hex) DVP14SS PLC [3] [4].
Heading 3A
TABLE IIIV EXCEPTION CODES
Slave Address 01
Code Meaning
Command code 02
Illegal command code:
Starting Address Hi 05 The command code received in the
01
Starting Address Lo 14 command message is not available
for the PLC.
Number of Points Hi 00 Illegal device address:
Number of Points Lo 25 The device address received in the
02
Error Check ( LRC ) BF command message is not available
for the PLC.
Table 3 shows the response from slave device to Illegal device value:
Query shown above. The device value received in the
03
command message is not available
for the PLC.

659 | P a g e
Prof.Mrs.S.S.Bidwai, Prof.Mr.V.B. Kumbhar, Prof.Mr. A.R.Nichal / International Journal of
Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 3, Issue 3, May-Jun 2013, pp.658-661
Check Sum Error A. Knowing the Modbus Protocol for Delta PLC
Check if the check Sum is correct DVP14SS series MPU support Modbus
Illegal command messages ASCII/RTU communication format with speed of
07
The command message is too short. up to 115,200bps. and modification on data length
Command message length is out of (data bits, parity bits, stop bits).Modbus
range. communication format ,CRC calculation ,Modbus
addressing for various internal devices of PLC are
Visual Basic has ActiveX MSComm control the key factor in the interface. Communication
6.0 to send andreceive ASCII characters on parameters for COMcan be manipulated by writing
communication port. MSCommcontrol added ladder program. Here we use default protocol
through the project component menu as shown in fig settings hence we do not alter PLC program. [4]
2. B. Writing Visual Basic code for MSComm Control
MSComm control is a drag and drop tool and can Designing windows form in visual basic as
be accessed, handled with its properties and event shown in fig 4. Form contains controls like Timer,
handler. MSComm Control, Button, textbox etc.

Fig 4 Form
OnComm () event in MSComm control is used to
receive response from slave PLC.

Dim strRx As String


Select Case MSComm1.CommEvent
Case comEvReceive
Case comEvEOF
strRx = MSComm1.Input

Similarly MSComm.output property is used to


send ASCII characters through serial port.
Fig 2 MSComm Control For Index = 0 To Len(txtWrite.Text) – 1
Fig 3shows the various properties of MSComm sendArr(Index) = Asc(Mid(txtWrite.Text, Index
control. + 1, 1))
Next
sendArr(Index) = &HD
sendArr(Index + 1) = &HA
strRx = ""
MSComm1.Output = sendArr
Do While True
If MSComm1.InBufferCount > 0 Then
strRx = strRx + MSComm1.Input
If Len(strRx) > 2 Then
If Asc(Mid(strRx, Len(strRx) - 1, 1)) = &HD
And Asc(Mid(strRx, Len(strRx), 1)) = &HA Then
Text1.Text = Mid(strRx, 1,
Len(strRx) - 2)
Fig 3 MSComm Control Property
Exit Do
End If
III. IMPLEMENTATION End If
Following steps are implemented to obtain
desired objective.

660 | P a g e
Prof.Mrs.S.S.Bidwai, Prof.Mr.V.B. Kumbhar, Prof.Mr. A.R.Nichal / International Journal of
Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 3, Issue 3, May-Jun 2013, pp.658-661
IV. RESULTS Defined Volume Selection,” IJETAE.,
Volume 2, Issue 8, August 2012.
Fig 5 shows GUI developed using VB and results
of serial communication between DVP14SS PLC
and PC. Prof.Mrs.S.S.Bidwai. received his
M.E. degree in Electronics and
Fig 5 Result telecommunication from Shivaji
University at RIT Islampur in 2010
and currently working as Assit
Professor in ADCET Ashta. Her
area of interest is VLSI .

Prof.Mr.V.B.Kumbhar received
his B.E. degree in Electronics from
Shivaji University at PVPIT
Budhgaom in 2005 and is pursuing
M.E in electronics from Shivaji
University. His area of interest is Industrial power
electronics and Industrial Automation.
V.CONCLUSION
The main idea was to interface Visual
Basic 6.0 and Delta PLC DVP14SS for Prof.Mr.A.R.Nichal received his
moreeffective and efficient process control. This B.E. degree in Electronics and
project ofinterfacing establishes communication telecommunication from Shivaji
between two powerful technologies used in University at Ashta in 2010 and
industries. Visual Basic provides a platform where received M.Tech in electronics
new solutions or highly customized SCADA's can from Walchand College of engineering, Sangli. His
be created with a richer experience than those that area of interest is Digital Image Processing and
may be provided by standard SCADA offerings. By embedded system.
using Visual Basic it offers many advantages over
SCADA packages as it comes free and not
expensive. Also SCADA packages cost depend on
the tag count and runtime licenses needs to be
purchased. Thus for OEM Visual Basic offers the
optimum solution.
Thus the PLC has been interfaced with Visual
Basic 6.0 and several real time processes have been
controlled.

REFERENCES
[1] “Modbus communication Manual,” MTL
8000 process control for process I/O ,The
MTL Instruments Group PLC, England
[2] NaregalkarAkshay.,Real Time Automated
Control of Industrial Pocesses with PLC –
LABVIEW Communication,.Ibrahimpatnam,
Hyderabad, India, Issue-1, Volume-1 ,035-
038
[3] “DVP PLC communication Protocol,”
Delta Electronics
Inc,www.delta.com.tw/industrialautomatio
n.
[4] “DVP PLC Application Manual,” Delta
Electronics
Inc,www.delta.com.tw/industrialautomatio
n.
[5] T.Kalaiselvi, R.Praveena ,Aakanksha.R,,
Dhanya.S, “PLC Based Automatic Bottle
Filling and Capping System With User

661 | P a g e

View publication stats

You might also like