Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
11 views

Development of Virtual Machine For Programmable Logic Controller (PLC) by Using STEPS Programming Method

Uploaded by

Ali Abdul Mannan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Development of Virtual Machine For Programmable Logic Controller (PLC) by Using STEPS Programming Method

Uploaded by

Ali Abdul Mannan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Development of Virtual Machine for

Programmable Logic Controller (PLC) by


Using STEPS™ Programming Method
Norashikin M. Thamrin, Mohd. Mukhlis Ismail
Faculty of Electrical Engineering
Universiti Teknologi MARA
Shah Alam, Selangor, Malaysia
norashikin@salam.uitm.edu.my

Abstract—Programmable Logic Controller (PLC) is widely Referring to The Fig. 1, LD is one of low level
used in manufacturing industries for automation and language programming for PLC as well as Boolean
became one of the essential subjects in the language and it is still widely used in many PLC
university.Learning theory in class alone is not enough to applications. Hence this paper is focussing on ladder
acquire the knowledge of PLC. Therefore in this paper a diagram as programming language for the PLC
PLC Integrated Development Environment (IDE) tool suit is applications.
developed to assist students’ learning in the class. It consists
of ladder diagram editor, simulator and compiler. It also
provides an interactive learning in class as well as hand-on
activities for laboratories. This software package is
developed using Object Oriented Programming (OOP)
language Visual Basic 6 to create a virtual microcontroller
environment in simulation process.

Keywords-component: Programmable Logic Controller;


simulation; design; controller; ladder diagram;
microcontroller

I. INTRODUCTION
Programmable logic controllers (PLCs) have
progressed rapidly since their inception in the early 1970s,
and are now widely used in the manufacturing, process
and utility industries.[1]PLC is special-purpose industrial
computers designed for use in the control of wide variety
Fig. 1: Ladder diagram.
of manufacturing machine and system. PLC also can be
defined as a specialized electronic device based on one or Theoretical learning alone is not enough to acquire
more microprocessors that are used to control industrial PLC knowledge until they experience themselves. In
machinery. The term “industrial” on the definition implies UiTM specifically for Electrical Engineering majoring in
that PLCs are computer designed to operate in harsh System, PLC is taught in Industrial Instrumentation course.
physical and electrical noise environment present in Basically in this course, undergraduates are exposed with a
production plants.[2] fundamental of PLC by having a theoretical class. As a
result, almost 65% of them having a problem in mastering
The definition defined that PLCs are computers; hence PLC based on unofficial survey that conducted to
they must be programmed using a programming language. undergraduates.
There are five standard programming languages
standardize by IEC 62232-3 that are available for There are several software-based PLC simulators have
programming new applications including Ladder Diagrams been developed since 20th century. Amongst is PLC
(LD), Function Block Diagrams (FBD), Structured Text Simulator, tri PLC, SOLPICA [3], Estevez et al [4] and
(ST), Instruction List (IL) and Sequential Function Charts Whimori CDK [5]. The PLC Simulator and tri PLC is an
(SFC)[2],[6],[7]. In this paper, only ladder diagram will be online simulator which is available for student access.
covered. However, these online simulators are not provided with the
‘save’ function as they are free software and thus, the
designed project cannot be retrieved.
Analyse the
The [3], [4] and [5] are a complete PLC tool with a
variety range of features and designed based industrial Problems
needs. Therefore, the user interface is not user friendly for
students’ usage. Furthermore, there are too many settings
and parameters must be considered during designing the Design the
ladder diagram. Those settings are very technical and Program
require a broad knowledge about specific PLC.

This paper concerns on developing an IDE to emulate


the real PLC for educational purpose in technical institute, Code the
high learning institute and industrial organization. Without Program
having to setup the high cost PLC laboratory facilities, Bugs
students can design, run and simulate their system. detected
PLC IDE is portable and can be stored in any removal Test and Debug
media storages. PLC IDE can be run without installing the Program
software in computer. The software can be accessed offline
anywhere at any time.
Formalize the
It is understood that user interface plays important role Solution
in real application. A friendly user interface is one of the
advantages to any software developed. Hence, PLC IDE is
developed using simple graphical user interface (GUI)
with minimal settings of parameters. Maintain the
Program
PLC IDE consists of three components namely: (1)
Ladder Editor, (2) Ladder Simulator, and (3) Ladder
Fig. 2: Software Development Life Cycle (SDLC)
Compiler. Ladder Editor is the area where the LD is
designed by user. Components such as contact, virtual coil model.
and relay coil can be placed on the specific rung created.
Ladder simulator then simulates those ladders into an The detail of logic plans is developed in design stage
interactive input and output where the output results are in by implementing the flowchart and pseudo code
real-time mode. While the compiler convert LD to C code. algorithm. Then it is translated into application by using
Visual Basic 6 through BASIC language.

After the translation process, program is tested with


the debugging tool which is embedded in the program
II. METHODOLOGY system. However, this debugging tool can be disabled
There are two major components in this project which when the program is correctly functioning. The code then
are software development and process design. Each can be reviewed and internal documentation is revised for
component is implemented using different methodology. future maintenance. This stage is also known as Beta
For software development, Software Development Life stage where the program is tested by a group of user to
Cycle (SDLC) is used while in simulation processes; identify the bugs that may occur.
STEPS™ Logic Ladder process is used.
B. STEPS™ Logic Ladder Simulation Process
A. Software Development Life Cycle (SDLC)
Step process is the way the simulation is executed.
SDLC consist of six steps namely: (1) Problem This method is called steps because every instruction is
analyse, (2) Program design, (3) Program coding, (4) execute step by step.[10] It is to develop the virtual
Testing and debuging, (5) Solution formalize and (6) microcontroller environment to imitate the real
Program maintainance.[7, 8]. The Fig. 2 shows SDLC microcontroller when performing simulation.
model. Microcontroller (µC) can be defined as a small computer
on a single integrated circuit containing a processor core,
In step(1), problemsare analyzed and solutions are memory, and programmable input/output peripherals.[11]
defined. It starts by planning the user interface. User
interface allows program to accepts instruction from a In simulation process, the processor core is imitated by
user and prepares the result. For this project, a Graphical Code Executor module while memory is imitated by Data
User Interface (GUI) is used. Next,outputs, processes and Memory and Register Structure module. Both modules are
inputs are identified the input, process and output for each developed by using ActiveX feature in Visual Basic 6.
functions or event triggered functions.[9] The Fig. 3 shows the simulation process flow.
III. RESULTS AND DISCUSSION

LD Scan Line
A. Ladder Diagram Editor
Simulation
Initialization Ladder Diagram Editor is the area where the entire
ladder diagram will be designed. The LD designed by
Translate to selecting the element such as contact, coil, timer or
Pseudo Code counter from the toolbar on the left screen. The selected
element then placed on the rung by clicking the location
where the element decided to be placed. The Fig. 4 shows
the Ladder Diagram Editor.
Update IO
Simulation Registers
Process

Execute Pseudo
Code Line by Line

Fig. 3: Simulation process flow.

The simulation process begins when the user press Fig. 4: Ladder Diagram Editor
RUN button. The software will start to scan the LD from
the first to the last rung. In each rung, the scanner scans Basically, the design area is developed using User
throughout the columns. Each column that connected with Control ActiveX (OCX) control object where the element
branch will be scanned throughout the branch before placed or clicked on the control object is varies according
continuing on the next column. to selected element. All properties of the elements such as
state, name, type and id can be updated during program
LD Compiler is the key to PLC simulation. This runtimes.
module interpret or translate the LD to pseudo code
understand by the code executor. Pseudo mean “false”
where what is read is not an actual word means. Hence, B. Table of Elements
pseudo code is not essential for human understanding. All elements that will be placed on the rung should be
The pseudo code is used to create the algorithm which ‘registered’ into Table of Elements first. All the elements
help programmer (author) to understand the process flow. are classified into five types which are Input, Output,
Timer, Counter and Relay. The Fig. 5(a) shows the table
After translation process is finished, the simulator will of elements.
update all the input and output (IO) register. This is very
important to initialize the state of inputs and outputs.

Then the pseudo code is executed by Code Executor.


Code Executor is the main engine in simulation process.
This module will execute all the instructions line by line
as microcontroller does. All the logic statement is referred
to the IO register for the output result. The IO Register
once again updated for next cycle. This processes
continuously repeated until the HALT or STOP button is
pressed.
(a) (b)
To reduce CPU usage, the process cycle is not
continuously performs. It only run when there is changes
in IO registers. It also cause the system to be more stable Fig. 5: (a) Table of elements and (b) Add new element
and avoiding software from stop responding. from Element’s Properties dialog box.
Only the registered elements can be used in the LD. On simulation process, the expected result is achieved.
To register the new element, user needs to click on the It is proved that the simulation is run accordingly and
selected port and enter the name of element as shown in smoothly without any lag. Simulation result is compared
the Fig. 5(a). User also can register the new element by with other online simulator available on the internet in
clicking the “+” symbol on elements properties dialog box terms of average central processing unit (CPU) usage,
as in the Fig. 5(b). memory used and execution time. The Table 1 shows the
performance comparison between PLC IDE and other
simulators.
C. Offline Simulator
Simulator is the way user interact with the system Table 1: Other online simulators performance compared
designed. There are inputs and outputs peripheral divided to PLC IDE.
into two sides. On the left side, the input peripheral while
the right side is the output peripheral. By clicking the CPU Memory Execution
toggle buttons on input side, it will update the input Program Platform
(%) (KB) Time (ms)
register and execute the pseudo code before update the PLC
output register on output side. The Fig. 6 shows the Java 27 160,816 0.74
Simulator
Simulator in the PLC IDE. Java 52 24,600 0.86
Tri-PLC
PLC IDE Windows 2 10,852 0.12

It is observed that the average CPU usage is relatively


high during simulation in PLC Simulator and Tri-PLC
compared to PLC IDE. In term of memory usage and
execution time, the PLC IDE is the lowest and fastest
among them.

IV. CONCLUSION
In conclusion, the fundamental of PLC is very useful to
the electrical engineering students before they embark into
the industrial world. Interactive learning is one of the
effective methods of teaching where student involved in
hand-on activities besides learning theory alone. Author
believed that this software is very useful to help student to
get better comprehension about PLC. It is believed that
Fig. 6: Offline Simulator the objectives of this project are achieved.

D. Simulation Results
V. FUTURE WORK
In order to verify that the system developed is fully
functioned, simulation test are performed. A test file is This project is developed with simple and basic
designed to perform AND, NAND, OR and timing based functions of PLC. It is recommended that few features
operation. The design contains eight contacts and three such as arithmetic operation that enable user to include
coils (one virtual coil and two relay coils). The Fig. 7 mathematic function in their design to be added in future.
shows the ladder diagram designed. Furthermore, the simulation process can be improved by
reducing the usage of memory and processors which lead
to system crash or process lagging. A hardware or training
kit should be developed as well as the communication
protocol with the PLC IDE to provide the students with
the online simulation and real application.

REFERENCES
[1] J. J. Blakley and D. A. Irvine, "Teaching Programmable Logic
Controllers Using Multimedia-based Courseware."
[2] J. A. Rehg and G. J. Sartori, Programmable Logic
Controllers: Pearson Prentice Hall, 2007.
[3] V. Pinto et al,PLC Controlled Industrial Process on-line
Simulator, IEEE International Symposium on Industrial
Electronics 2007, ISIE 2007, 4-7 June 2007, pg 2954 - 2957.
[4] E. Estevez et al, Graphical Modelling of PLC-based Industrial
Fig. 7: Basic ladder diagram with timer design. Control Applications, Proceesing of the 2007 American
Control Conference, New York, 11-13 July 2007, pg 220 -
225.
[5] S. Shin et al, Whimori CDK: A Control Program Development
Kit, International Conference on Computing, Engineering and
Information, ICC'09, 2-4 April 2009, pg 115 - 118.
[6] J. George L. Batten, Programmable Controllers: Hardware,
Software and Applications, 2nd Edition ed.: MacGraw-Hill,
1994.
[7] T. I. E. Committee, "IEC 61131-3, Programmable Controllers,
Programming Languages," ed, 1993.
[8] G. Brue and R. G. Launsby, Design For Six Sigma: McGraw-
Hill Company, 2003.
[9] (2011, 19 March 2011). Systems Development Life Cycle.
Available:
http://en.wikipedia.org/wiki/Systems_Development_Life_Cyc
le
[10] H. M. Deitel, et al., Visual Basic 6. How to Program: Prentice
Hall, Inc., 1999.
[11] B. ı. Zoubek, et al., "Towards Automatic Verification of
Ladder Logic Programs," 2003.
[12] S. F. Barret and D. J. Pack, Microcontrollers Fundamentals
For Engineers and Scientists, 1st ed.: Morgan & Claypool
Publisher, 2006.

You might also like