1
Development of three dimensional virtual PLC
e
xp
eriment model based on Unity3D
Hui Wang, Jianfeng Lu, Wenhe Li and Zhihui Jiang
CIMS Research Center of Tongji University
Shanghai, China
lujianfeng@tongji.edu.cn
Abstract—PLC experiment is an important course of
technical education and training in all kinds of schools. The PLC
physical model and the actual control model are indispensable in
the traditional PLC experiment. It is not conductive to the
students’ self-study because the cost of maintenance and update
of this experiment is higher and the experimental place is fixed.
In order to solve these problems, this paper designs a pure
software virtual PLC experiment scheme using SIEMENS virtual
PLC which provides control signals and a three-dimensional
virtual experiment model based on Unity3D.The new experiment
scheme can intuitively show the experiment authenticity and
overcome the disadvantages of SIEMENS virtual PLC which can
only show the status of the control signals but cannot show the
running states of peripheral equipment. At the end of this paper,
an example, a three-dimensional virtual traffic light experimental
model based on Unity3D for SIEMENS virtual PLC, is given to
illustrate the feasibility of the scheme.
Keywords—PLC; Unity3D; three dimension; virtual experiment
I. INTRODUCTION
PL
C, which has many advantages, such as high reliability,
strong anti-interference ability, easy programming and
debugging, easy to expand and so on, is widely used in many
fields of industrial control, and PLC application technology
has become a very important professional course in general
higher education [1]. As the PLC application technology is a
practical and comprehensive professional courses,
experimental teaching is particularly important. At present,
there are two kinds of PLC experimental platform used in
school teaching: one uses real controlled objects and PLC
hardware, this kind of platform adopt real components, so that
the costs of maintenance and update is very high. The other one
uses a virtual controlled object. This kind of experimental
platform has been paid more and more attention because real
controlled objects and field equipment are not required,
development cycle is greatly shortened and the cost of
hardware is highly reduced [2-3].
However, both the above two kinds of PLC experimental
platform have their own shortcomings. The former has higher
investment, maintenance and update costs. The latter can’t be
carried out without real PLC hardware, it can’t show the
running state of peripheral device either. In view of these
problems, this paper presents a pure software PLC virtual
experiment scheme: combine PLCSIM (SIEMENS S7-300/400
series PLC simulation software) and Unity3D to explore the
method of building a set of fast and economical virtual
experiment through virtual software.
II. DESIGN SCHEME OF THREE DIMENSIONAL VIRTUAL PLC
EXPERIMENTAL MODEL
The designed scheme consists of two parts: virtual PLC and
Unity3D experimental model. The virtual PLC part including
SIEMENS PLC programming software STEP7, PLC
simulation software PLCSIM. STEP7 is a programming
software for SIEMENS S7-300 / S7-400 series PLC, The
optional tool PLCSIM of which is a PLC simulation software
that can simulate the operation of S7-300 / S7-400 series CPU
on PG / PC. In the SIMATIC Manager, you can, like the
hardware operation of the real PLC, download, test and
diagnosis the analog CPU, it is very suitable for early stage’s
project debugging in absence of hardware equipment [4].
Using PLCSIM has the following advantages: (1) S7 program
testing on PG / PC is independent of the hardware ; (2)
Eliminate errors in program development at early stage; (3)
Reduce development costs, accelerate the development process,
improve program’s quality; (4) Applicable to LAD, FBD, STL,
S7-GRAPH, S7-HiGraph, S7-SCL, CFC, S7-PDIAG, WinCC
and so on[5].
The experimental object model controlled by virtual PLC is
developed by Unity3D. Unity3D is a very popular game
development software, it’s a cross-platform professional game
engine developed by Unity Technologies. Users can easily
achieve various game creativity and perform three-dimensional
interactive development, creating marvelous 2D and 3D games
[6]. Users only need to invest energy to develop the target
product once, then they can apply the same configuration in
other platforms such as IOS, Windows, Android and so on,
which provided a great convenience for information exchange
of different terminals [7]. Due to the powerful function of
Unity3D, virtual reality in various areas can be simulated.
Therefore, this design use STEP7 to program and PLCSIM
to simulate. The data generated by PLC simulation software is
send to OPC Server through the NETTOPLCSIM software, use
C# language to develop OPC communication converter to read
data from OPC Server, then OPC communication converter
sends the data to the related script of Unity3D experimental
model, the Unity3D script can use the data to control the virtual
experiment model. The structure of the scheme is shown in
figure 1.