Sie sind auf Seite 1von 5

Remote Wireless Low Cost RT Process Control using Windows

PLC by MATLAB/Simulink throw the REX Control System

*Ondrej Krejcar, **Petr Konarik

* VSB-Technical University of Ostrava, Faculty of Electrical Engineering and Computer Science,

Department of Measurement and Control Centre for Applied Cybernetics, 17. listopadu 15, 708
33, Ostrava-Poruba,

** VSB-Technical University of Ostrava, Faculty of Mechanical Engineering, Department of

Control System and Instrumentation, 17. listopadu 15, 708 33, Ostrava-Poruba,
system”, a system, which is perfectly controlled with
Abstract — Paper shows direct connection and demanding control algorithms and which enables
implementation way of designed control schemas of compensating of a whole range of nonlinearities and
prepared applications to an industrial WinPLC. Paper behaviour of mechanical parts and at the same time
deals with industrial realization of feedback control of
demanding applications on their control, control brings energetic efficiency and other operability options.
algorithms and visualization together with design, To solve this problem it is possible to use entirely
implementation and real time control from new multiplatform control system REX, which deals
MATLAB/Simulink Environment. Described is a way to with research and development of advanced algorithms,
produce a permanent solution in control applications that supporting and diagnostic tools and complete
are fully prepared, designed and implemented directly
from MATLAB/Simulink to the target control platform. As programming solutions for direct control of real time
a part, the mentioned solution is using a multiplatform dynamic systems and which enables connecting and
control system REX as a bridge between MATLAB and
target platforms. These methods allow minimizing costs of
development of control of applications, because it produces
target permanent realizations in comparison to classical
development methods that usually need expensive real time
measurement cards and produce only one purpose
development solution. As next benefit the application is
created for visualization the data from RT database during
the measurement and control process. This last benefit
produce an interesting data from real control process to
give a next reason to use of WinCon solution.
Index Terms — Real Time, WinPLC, MATLAB
Simulink, REX Control

The development of present applications focused on
real time control of a technological process must usually
go through whole range of development steps, each of compatibility with MATLAB/Simulink environment.
which demands human resources as well as software
and hardware implementation and testing requirements, Fig. 1. Architecture of a process control by classical way
and by the help of REX Controls
which is very often connected with high cost for
development and longer time. Architecture of a process control by classical way and
If we come from an assumption of requirements for by the help of REX Controls
present systems, it is obvious that they further aim at Another interesting advantage is in very low cost of
more sophisticated and more demanding solutions, described solution opposite to classical solutions with
namely regarding control quality, energetic RT Measurement Card (like dSPACE).
consumption, knowledge of system behaviour and the Third advantage is in possibility of remote or
entire process control as it is. standalone run of WinPAC. In that case is not necessary
An example can be hydraulic systems with clear to have an own control PC with RT card attached to
tendency and a requirement for so called “smart iron
controlled system, but only existing robust WinPAC Graphical designer RexDraw enables its own
system. drawing, proposal and also adapting already designed
block schema directly from *.mdl files in
TABLE I MATLAB/Simulink environment.
COST COMPARISON OF POSSIBLE CONTROL SOLUTIONS It uses its own large library blocks, namely various
types of regulation and controllers, which are problem
RT Card solution REX Control solution oriented especially on real process control, as well as the
Matlab toolbox for RT 180 EUR REX control SW 390 EUR fundamental library blocks, which are similar to the
dSPACE (no.1104) 9800 EUR WinPAC Wincon 1600 EUR
MATLAB/Simulink program, and which are
automatically recognized after reading the mdl file and
10000 EUR 2000 EUR
sent to RexDraw environment in form of a new block
schema, which is very similar to the Simulink one.
II. ARCHITECTURE DESCRIPTION Most of the fundamental blocks in Simulink have
their equivalent in REX Control block library.
Program MATLAB represents at the present time a
The REX Control libraries are also supported and
complex tool for technical calculations and its own
displayed directly in MATLAB/Simulink as another
design for an entire range of technical problems from
Simulink library toolbox, therefore the schema design
different areas, namely by MATLAB/Simulink and its
and tuning can be done in Simulink directly, even
problem oriented toolboxes, block sets and libraries in
before the RexDraw environment run.
which it is possible easily and quickly simulate system
behaviour and design their suitable control and control
algorithms [6]. 1 u y Gain
Problems however start if we want to transfer the Gain Add1

designed system solution on the target system. |u| u

Absolut Y Booleean Constant
Value CNB
MATLAB enables and supports direct feedback control Abs ABS_ 1
y Integer Constant
by RT control and data acquisition cards and also u1
Constant CNI
y Real Constant
supports several target platforms and microprocessors, Add ADD
into which it enables automatic code generation and u1
u2 Multiplication u1 y
ends with high performance embedded systems Product
MUL u2 E Divide
Divide DIV
dSPACE [5]. All of these system solutions usually
represent either intermediate stage before the target and u u y
Square sin
E Trigonometric
permanent solutions themselves and or it is necessary to Math Trigonometric FNX and Other
Function Function Functions
purchase other hardware and software tools, which are sqrt u
u1 y
u2 E exp, floor etc.
financially very costly. Math SQRT_ Math

During System REX Controls use it is possible to Function2 Function1

design permanent target solutions, perform direct

measurements and real time control, its visualization
and tune applications according to needs, every time the Fig. 2. Some of the fundamental blocks taken from about
MATLAB program is connected. And after it is 170 library blocks of REX Control program in MATLAB
disconnected the automatically generated solution
remains on the end platform serving the entire
A part of this stage of block schema design is the
technological process.
definition of target platform, required inputs and outputs
A. Program REX Control and their properties, as well as the definition of
application run watch, served especially by libraries and
Program REX consists of several supporting parts
blocks INOUT, EXEC and others.
RexDraw, RexComp, RexCore, RexView and OPC
Furthermore, the libraries REX are divided into the
servers RexAutSv and RexOPCsv [1], where:
mathematical part with MATH blocks, the part ANAL,
• RexDraw – Graphic designer of REX algorithms
which consists of supporting blocks used for analog
and applications.
signal processing, the part GEN, supporting signal
• RexComp – Application compiler to binary format
generating of various types, the part REG, which is an
files .rex.
extensive library part focused on different types of
• RexCore – Real-time control system core,
industrial control, the part LOGIC, intermediating logic
• RexOPCsv – OPC Data Access server 2.0 of the
operations, the part ARC, implementing data archive
system REX.
and the part SPEC, devoted to specialized blocks.
• RexAutSv – External server of the REX system.
In this way prepared and ready schema is then
compiled with RexComp into *.rex file, which is for
example with intranet transferred into target equipment, peripheries and touch display for WinCon can be seen in
where is compiled by RexCore and linked to the target Figure 4.

B. Target Platforms
As the target platform it is possible to select a whole
range of supported platforms, or write your own
supported drivers. The presently supported standard
platforms are:
• PC and IPC (industrial PC) with OS Windows
95/98/ME/NT4/2000/XP, Phar Lap ETS and
VenturCom RTX, National Instruments and Advantech
boards, Ethernet based Terminator I/O
• WinPLC equipped with DL205 series modules
and Windows CE OS
• TECOMAT TC700 with Windows CE OS
The RT WinPLC - WinCon 8000 Compact Embedded
Controller was used as the universal target equipment in
our case, which represents a new generation of
programmable controllers, combining the classical PC Fig. 4. Possibilities of connection and extension of
and PLC and creating so called PAC - Programmable peripheries and communication
Automation Controller, whose advantages are obvious
from the first sight in Figure 3. III. MEASUREMENT AND CONTROL ON A REAL SYSTEM
The controlled system is dynamically demanding
Windows CE system of a hydraulic drive, Figure 6, which is
I/O Modules controlled by four-way flow servo valve, which
implements discharging and shifting piston, which is
during the stroke loaded with pressure and tension force
implementing disturbance on a system and which
requires design of more sophisticated control algorithms
Ruggedness and Reliability and control quality that are able to compensate effects
related to hydraulic drive control, as for example
Fig. 3. Advantage of the PAC usage (left) and WinPLC hydrodynamic forces acting inside of valves, system
(PAC) WinCon 8000 machinery used for real application nonlinearities, leakages, friction, cavitation effects, etc.
control (right)

The fundamental properties of target equipment PAC

used are:
• CPU Intel Strong ARM
• OS Windows CE .NET
• Interface for: VGA, Ethernet, USB, keyboard,
mouse and Compact Flash Card C err B
f resh
• LCD Touch screen support u0
• OPC server u2
y3 A
• protocol Modus/TCP, RTU u4
• Extended line of I/O expansion cards: DI, DO, u6
AI, AO, counters, drive controllers etc. u8
y 10
y 11
Used PAC WinCon W-8739 was equipped with plug u13
y 12
y 13
in analog and digital I/O modules [2], in concrete with u15
y 14
y 15
two analog input measurement modules I-8017H (8x RDC SLEEP

14-bits, 100kHz), an analog output module I-87024 (4 Fig. 5. Block schema of feedback control in
voltage and 4 current outputs -14bit) and digital I/O MATLAB/Simulink (left and top) and a case with inputs
module I-8054 (8 digital input and outputs). The reading and outputs generating options directly in MATLAB
possibilities of a network connection, connecting other (right)
Required Values Substraction P-regulator Range change OUTPUTS: WinCon was connected directly to Ethernet. Each
y u1 y [WCN__SA5I24V0] sample of a signal connected to RDC block was
CNB_1 u2 E
err transferred about every two miliseconds, which was
B f resh C
sufficient for our required sampling period 0.005s.
CNR_5 CNR_6 u2
[WCN__S2I17X0] u1
A u3
u2 y3
MUL_3 Range Changes u5
CNR_4 u7

y 10
y 11 All input and output variables of all the blocks can be
y 12
y 13
y 14
monitored and changed and set with RexView Program.
y 15
RDC_1 The important property of the REX problem solution is
the implementation of a standard OPC interface,
Fig. 6. Block schema in Figure 5 in RexDraw with
enabling connecting to all significant systems for
connected inputs and outputs for autonomous process control visualization and operator supervision of controlled
from WinCon and forwarding measurement variables to processes (SCADA and HMI).
Simulink (signals A and B) at the same time This OPC interface (called Automation) enables to
create an interconnection to another application for
For the design of control schemas the fundamental visualizing measured data. Such application can be
feedback circuit was tested first, whose schema in created in Microsoft Visual Studio 2008 in C# language.
Simulink can be seen in Figure 5 and it’s automatically This solution is free of cost and easy to create. For data
generated equivalent in REX environment in Figure 6. storage the RT database Microsoft SQL Server CE can
From the figures, it is obvious that blocks used in both be used.
cases are very similar and the design of control schema We create such solution based on Microsoft RT
using REX libraries and automatic loading of mdl files solutions. First test of complete measurement and
and their schemas is not too difficult. control network are sufficient. The measurements with
Matlab visualization are delayed by 20 % in mean value.
IV. WIRELESS NETWORK MEASURING AND RT WinCon solution with our own application for
COMMUNICATION visualization is always in time. As test bed we used
VRDB testbed [8] and [9].
Used PAC equipment enables connecting to higher
control levels with UDP/IP protocol. This protocol is
used as often as the well – known TCP/IP and functions
on all LAN and Internet as well.
One of the specialized blocks of REX library, the
RDC (Remote Data Copy) block is used for
communication between two blocks on different
computers, or two Simulinks on the same PC and/or
Simulink and REX system, Figure 5 and Figure 6. In
this case we used it for communication between REX
program in WinCon and Simulink on the second PC.
Set parameters are always the IP address of the
second equipment, a remote port – rport, a local port –
lport, the id and the sampling period, which must be the
same for both communicating blocks.
Block SLEEP is then used for synchronization of sent Fig. 7. Visualization of real fluid motor control. The graph
and received data with WInCon, since the of required and real values
communication would not work without it, and it
contain a parameter “SleepTime”, which needs to be set VII. CONCLUSION
the same as a parameter “tick” in block EXEC, which
determines the shortest sampling period, with which the This contribution brought a design and
target equipment WinCon will work and in which the implementation for permanent problem solution for a
data will be transferred. The smallest possible setting is control of dynamically demanding process with
0.001s. In our case and also from the security reasons multiplatform control system REX Control compatible
the sampling period 0.005s was used. with MATLAB/Simulink. Real time measurements and
The whole control process was tested and controlled control via network and Wifi connections were
from MATLAB/Simulink environment, which run on a performed directly from Simulink and compared to
notebook connected to a network through WiFi, while autonomous control at WinCon and furthermore with a
classical method using measurements implemented on
PC RT data acquisition cards AD614 and dSPACE

This research has been carried out under the financial
support of the research grants “Safety and security of
networked embedded system applications”, GACR, GA
102/08/1429, Grant Agency of Czech Republic, and
“Centre for Applied Cybernetics“, Ministry of
Education of the Czech Republic under Project

[1] Official pages of multiplatform control system REX
[online]. Available on
[2] Official pages of PAC WinCon8000 [online].Available
[3] Official pages for web and wireless applications \
INDUSOFT - tool for automation [online].Available on
[4] Official pages of ICP DAS [online]. Available on
[5] Official pages of dSPACE Systems [online]. Available on
[6] Official pages of MATLAB product [online]. Available
[7] Krejcar, O.: User Localization for Intelligent Crisis
Management. In AIAI 2006, 3rd IFIP Conference on
Artificial Intelligence Applications and Innovation, pp.
221-227, Athens, Greece, (2006).
[8] Krejcar, O., Cernohorsky, J.: Database Prebuffering as a
Way to Create a Mobile Control and Information System
with Better Response Time. In Lecture Notes in
Computer Science, Computational Science – ICCS 2008,
Volume 5101/2008, The International Conference on
Computational Science 2008, pp. 489-498, Cracow,
Poland, (2008).
[9] Slanina, Z.: Embedded linux scheduler monitoring, In
ETFA 2007: 12th IEEE International Conference on
Emerging Technologies and Factory Automation, Vols 1-
3, SEP 25-28, 2007 Univ Patras, Patras, Greece, pp. 760-
763, (2007)
[10] Krejcar, O.: Prebuffering as a way to exceed the data
transfer speed limits in mobile control systems, In
ICINCO 2008, 5th International Conference on
Informatics in Control, Automation and Robotics, May
11-15, 2008 Funchal, Portugal, pp. 111-114, (2008)