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

The Design and Implementation of Embedded Configuration Software Based on Embedded-Linux

This paper discusses the design and implementation of embedded configuration software based on the embedded Linux operating system, focusing on its architecture, graphic-element classes, and performance optimization strategies. It highlights the advantages of using embedded Linux for developing configuration software for industrial control systems, including real-time performance and resource management. The study also details the implementation of dynamic graphic-elements and data communication mechanisms, demonstrating the software's capability to meet user requirements despite the limitations of embedded platforms.

Uploaded by

PRASHANT DHEER
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

The Design and Implementation of Embedded Configuration Software Based on Embedded-Linux

This paper discusses the design and implementation of embedded configuration software based on the embedded Linux operating system, focusing on its architecture, graphic-element classes, and performance optimization strategies. It highlights the advantages of using embedded Linux for developing configuration software for industrial control systems, including real-time performance and resource management. The study also details the implementation of dynamic graphic-elements and data communication mechanisms, demonstrating the software's capability to meet user requirements despite the limitations of embedded platforms.

Uploaded by

PRASHANT DHEER
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2008 International Conference on Computer Science and Software Engineering

The Design and Implementation of Embedded


Configuration Software Based on Embedded-Linux

Min Jin1, Xiang Zhou2, Peng Duan1, Zefeng Tian 1 and Jihui Zhou1, 2
1
Software College, Hunan University, Changsha, P.R.China
Rj_jinmin@hnu.cn
2
Intelligent Engineer Institution, Sany Heavy Industry CO., LTD, Changsha, P.R.China
zhx@sany.com.cn

Abstract—With the ever-increasing application of embedded large number of peripheral devices by providing abundant
systems in the field of industrial control, the demand for driver programs; and finally, the capability of customization
embedded configuration software becomes inevitable. This paper for both code size and function, which meets the limitation of
presents a general method of developing embedded configuration resources on embedded devices. The rapid development and
software based on embedded Linux operation system. The popularization of embedded Linux operating system in the
software architecture consisting of host and target is given out. embedded device has provided a broad prospect for the
The relationship between graphic-element classes and its research and development configuration software platform
implementation are described. The animation implementation based on embedded Linux. In this paper, an embedded
technology of dynamic graphic-elements and data
configuration software based on embedded Linux is studied
communication mechanism based on signal and slot are
discussed in detail. Furthermore, aimed at the poor processing
and implemented.
power of embedded microprocessors and the limited storage
resources on embedded platforms, the paper proposes a multi- II. OVERALL DESIGN
level strategy for the performance optimization of embedded The architecture of embedded configuration software
configuration software. The experiment result shows that this
consists of host and target, which is shown in Fig. 1. The host
embedded configuration software can meet user’s requirements
on real-time performance and resource consumption, and thus
is usually based on PC and Linux platform and acts as the
has application prospect and popularization value. configuration environment, which provides interface
development tools such as visual graphics library and device
Keywords-embedded configuration software; embedded Linux; library. After users fulfill defining the scheme of acquisition
Q/T; graphic-element; signal/slot; performance optimization and supervision and developing the monitoring interfaces in
the configuration environment, a series of project
configuration files are generated and finally downloaded into
I. INTRODUCTION
the running environment. The target, based on the embedded
Configuration software is an important platform tool for hardware platform of ARM and the software platform of
SCADA (Supervisory Control and Data Acquisition), which embedded Linux, servers as the running environment, which
provides the user with a friendly developing interface and easy finishes the data acquisition and processing, the execution of
usage by the means of flexible block-building rather than monitoring and control scheme, and the display of interfaces
programming [1]. With the ever-increasing application of according to project configuration files.
embedded systems in the field of industrial control, the
technology of traditional configuration software is applied to Concretely speaking, the development of graphical
embedded control system. Currently, there are some influential configuration environment is based on QT/E for embedded
embedded configuration software, including embedded Linux [3], which is an embedded GUI developed by TrollTech
HMI/SCADA of InduSfot Web Studio, WinCC of Siemens corporation in Norway. QT/E is object-oriented and easily
Corporation, embedded configuration king of Asia Control portable. The advantage of encapsulation and inheritance in the
Technology Corporation, and MCGS of Kunlun Tongtai object-oriented method of QT/E can be taken to build graphics
Automation Software Technology Corporation. These library. Embedded ARM platform adopts Samsung2410
embedded configuration software are mostly based on microprocessor, 64M RAM and 32M Flash. Obviously, this
WindowsCE operating system [2]. kind of embedded platform has put forward strict resource
constraints to the configuration software running on it,
However, the appearance of embedded Linux has brought including slow calculation and processing speed of CPU, weak
new vigor to the development of the embedded products. It is function of floating-point operation or even lack of this
because embedded Linux has many characteristics suitable for function, and small memories etc. These resource constraints
embedded system development: first, open source and rich are the difficult points in developing embedded configuration
software resources; second, the robust and real-time kernel; software, which could be satisfied by adopting some effective
third, support for a variety of hardware architectures and a optimization methods [4].

This research work is supported by Natural Science Fund of Hunan


Province under grants No. 07JJ6137 and Changsha Science and Technology
Program under grants No. KZB064002.

978-0-7695-3336-0/08 $25.00 © 2008 IEEE 98


DOI 10.1109/CSSE.2008.640
Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.
some identical operation functions like attribute adjustment.
These identical attributes and operations are abstracted into a
class, namely the base-class of simple graphic-element.
Implementing simple graphic-element should firstly
implement DPainter, the base-class for painting, which other
graphic-element could be derived from. It is because the
processing of different graphic-elements can be simplified by
taking the full advantage of the derivation property of the base-
class. DPainter is directly derived from QPainter provided by
QT/E. Then DPainter derives out the other simple graphic-
elements, such as drawLine which is the straight line class,
drawArc which is the arc class, drawText which is the text
class, drawImage which is image displayer class, and so on.
During the configuration process, it needs to adjust the size
and location of graphic-element objects. The method of
implementing this adjustment is taking class QVbox, which is
provided by QT/E, as the container of graphic objects and then
utilizing the member functions of QVbox to realize the
adjustment. During the adjustment process, absolutely logic
coordinate and relatively logic coordinate are adopted to
calculate the position of graphic objects. Absolutely logic
coordinate is defined as the coordinate relative to the top left
corner of the screen. On the other hand, because each object
exists in a container and the container may exist in an outer
container, namely parent container, the logic coordinate
relative to the origin of the parent container should be stored,
Figure 1. Architecture of embedded configuration software
which is called relatively logic coordinate. When adjusting,
each graphic object transfers its absolutely logic coordinate
into relatively logic coordinate through transfer function, and
III. DESIGN AND IMPLEMENTATION OF GRAPHIC-ELEMENT then the corresponding adjustment operation is performed. In
In configuration software, pictures constructing the process this way, the calculation errors brought about in moving and
graphs in the filed consist of graphic-elements. As is shown in zooming objects could be considerably reduced and the
Fig. 2., there are three types of graphic-elements: first, simple distortion problem during the adjustment of graphic objects
graphic-element, which is the basic unit of both graphic could be avoided.
interface and animation function; second, dynamic graphic-
element, which attributes dynamically change with the B. Dynamic Graphic-Element
variation of monitoring data; and last, component, which All dynamic functions of the graphic interface system are
mainly finishes the control command of user and data display. finished by dynamic graphic-elements, which shows the
running status of on-the-spot devices visually and visually in
graphic mode. Under the configuration environment, the user
links device data sources operated by graphic objects with the
attributes of dynamic graphic-elements. When running, the
system timely updates the attribute domain of graphic-element
objects in internal memory in the refresh cycle set in
configuration according to the animation link, clears the
window, and then paints all the graphic-elements according to
Figure 2. Classes of graphic-element
the current attribute values of each graphic-element on the
window. The main links of animation include dimensional
Due to various types and complicated shape of graphic-
change, rotary motion, color change, percentage filling,
elements, the object-oriented design method is adopted. All
display/hiding, flicker/flow, numerical input (including analog
graphic-elements are regarded as object and class. “Base-
input, digital input and character-string input), drag, and
class” derives out many “sub-classes” in order to generate
numerical output (including constant and variable) etc.
different combined graphic-elements with different shape. In
addition, graphic-element and its picture are stored in vector Dynamic graphic-element is implemented by using
graph so as to save storage resources and avoid the distortion QWidget, the painting tool class in QT/E, and relevant
problem when graphics is enlarged or reduced. message process mechanism of signal and slot (see section
IV). Class QWidget derives out different painting tool classes
A. Simple Graphic-Element and each painting tool class will reload its virtual functions.
All types of graphic-elements have some identical The following gives out an implementation example of
attributes, such as ID, size, logic coordinate, container etc., and dynamic graphic-element class clockNo.

99

Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.
class clockNo :public QWidget { comparatively slow, and screen will badly flicker. In order to
Q_OBJECT solve this problem, the system adopts a buffer mechanism.
public: First, before graphics is displayed in the screen’s painting
clockNo (QWidget *parent=0, const char *name =0 ); region, a buffer consistent with this region is created in internal
int angle() const { return ang;}; memory and graphics is painted in this buffer. Then graphics
QSizePolicy sizePolicy() const; in the buffer is copied to the current painting region of the
public slots: //slot to receive signal screen only once. Finally, the buffer in internal memory is
void setAngle( int degress ); released. In this way, painting speed is promoted and flicker is
signals: avoided. QPixmap is accordingly created in class clockNo. It is
void angleChanged( int ); //signal a painting device based on pixel. All dynamic painting
protected: operations are finished by OPixmap. After function
void paintEvent( QPaintEvent * ); paintEvent() is executed, this device is called to perform
private: // painting screen painting.
int ang;
… B. Usage of Register Variable
} When a local variable is declared as a register variable by
using the key word of “register”, compiler put this local
IV. DESIGN AND IMPLEMENTATION OF DATA variable into a multi-purpose register instead of the stack.
COMMUNICATION Because the speed of access to register is higher than that to
stack, which follows the principle of FILO(First In Last Out),
The mechanism of signal/slot is adopted for data the appropriate usage of the register variable will speed up the
communication, as is shown in Fig. 3. Signal/slot is a kernel execution of the function. Furthermore, the more frequently
feature of QT/E [5]. Comparing with the common the function is called, the more prominently the execution of
communication mode of function callback, signal/slot the function is speed up by this method [6]. For example,
mechanism has some advantages. On one hand, signal and slot because class clockNo needs to perform counting operation on
are loosely connected to each other. In other words, a class, the data collected from data sources every time, variable
which sends out signals, has no need to know which slot will countNUM is operated frequently. In this case, the variable
receive these signals. The signal/slot mechanism of Qt/E countNUM is optimized to a register variable.
ensures that, if a signal is connected to a slot, the slot will be
called at the right time by using the parameter of signal. On the
C. Floating-Point Operation
other hand, signal/slot is completely type-safe, in which any
numerical value and any type of parameter can be used without Most embedded platforms don’t provide relevant hardware
the problem of core dump in callback. that supports floating-point operation. For example, the
microprocessor S3C2410 used in the system hasn’t Vector
Floating-Point (VFP) unit. In this case, the floating-point
library provided by the compiler could be used. This library
comprises a set of subroutine, which adopts integral operation
to simulate the instruction set of co-processor for floating-
point operation, and it is coded by highly optimized assembler.
Even thought, these functions of floating-point operation take
much longer execution time than corresponding integral
operation, and they are not reentrant [6]. Under the situation of
a small amount of floating-point operations, this embedded
configuration software adopts fixed-point operation to improve
the execution efficiency, for it is not necessary to completely
Figure 3. Signal/slot mechanism realize the whole standard of IEEE754 just for a few of
floating-point operations.
There are many pre-defined signals and slots in QT/E. Self-
defined signals and slots could also be added by the means of D. Division operation
inheritance. Many signals could be connected to one slot by
There are a plenty of division operations in the calculation
function connect(). Meanwhile one signal could be connected
and processing on a large number of acquisition data. In fact,
to many slots. The class clockNo described above receives
many embedded processor don’t provide relevant hardware
data changes through the slot setAngle and send its own
that supports division operation, such as the series of ARM
change to the other objects by the signal angleChanged.
microprocessor. In this case, compiler calls the C library-
function to implement the division operation. However,
V. PERFORMANCE OPTIMIZATION standard integer division in the C library-function shows slow
performance. Considering different operation environment and
A. Painting Buffer the range of operands, it usually needs 20 to 100 instruction
When there are much more objects in the painting region of execution cycles. Therefore, division operation should be
the screen, the process of re-painting this region is avoided as much as possible. In other words, other operations

100

Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.
could be used to take the place of division operation so as to Table II presents the resource consumption of project files
optimize the software performance [6]. For example, the and class library etc. after the user configuration in the
operation of division by 2N is optimized to the right shift of N experiment is compiled, which indicates that the embedded
bit. For another example, the division operation is usually configuration software can meet the constraint of limited
utilized in the operation of the double-ring buffer. Assume storage resource in the embedded system.
there is a double-ring buffer with a size of buff_size, and its
access position at the present is pointed by pLoc, which value Speed Residual fuel
is increased by QtIncrement bytes. The traditional mode of
access to this buffer is shown as follows.
pLoc= (pLoc + QtIncrement) % buff size; Engine speed
In order to avoid the decline of operation performance
caused by the division operation, the codes presented above
can be optimized to the following codes.

pLoc += QtIncrement;
if (pLoc >= buff_size)
{ pLoc -= buff_size;
} Figure 4. User configuration interface for test

E. Selection of C++ Characteristics TABLE I. REFRESH RATE OF USER CONFIGURATION INTERFACE


C++ has made much more improvement on the support to Numbers of connected
modern software engineering and Object Oriented 1 2 3
data resource
Programming (OOP) etc. than C. However, its performance
Refresh rate (sec) 0.01721 0.01792 0.01971
on code size, execution speed, program complexity and so on
is still poorer than C. For example, some C++ characteristics,
such as multi-inheritance, virtual base-class, template, TABLE II. CONSUMPTION OF STORAGE RESOURCE
exception handling and operating type identification, have side Size of Size of Size of Usage of
effect on the code size and program efficiency. Therefore, this configuration class Embedded- Internal Remarks
embedded configuration software doesn’t adopt these C++ project files library Linux Memory
mechanism like multi-inheritance, virtual base-class, and ARM platform,
133.6 KB 5.4 M 15 M 2M
exception handling etc. QT/E library
Note: Linux top instruction is used to test the resource consumption [7].
VI. EXPERIMENT AND ANALYSIS
VII. CONCLUSION AND FUTURE WORK
In the experiment, we use this embedded configuration
software to develop a graphical user interface with two Currently, this embedded configuration software is being
dynamic graphic-elements of lcdNum, two dynamic graphic- improved through the application in practical projects. The
elements of ClockNO, and one component of Button, which is research on embedded configuration software is actually the
shown in Fig. 4. The software collects data through data one on the developing platform of application program for
acquisition module, and then sends the data to relevant embedded system industry, which will effectively improve the
graphic-elements in the graphical user interface for display developing efficiency of embedded supervision and control
through communication module. In order to test the refresh software and thus promote the considerable development of
rate of real-time data display in this configuration user embedded system in the field of industrial control.
interface, the test program continuously changes each data
source 10000 times per second. The experiment result shows REFERENCES
that painting GUI takes a little bit long time for the first [1] G. Kruse, and J. Bramham, “You Choose Product Configuration
running. Due to the adoption of buffer mechanism in which a Software”, Manufacturing Engineer, Vol. 82, No. 4, 2003, pp. 34-37.
buffer consistent with the screen’s painting region is created in [2] B. Ma, “Development of Configuration Software for Automation”,
internal memory, it is only need to update the buffer during the Automation Panorama, Vol. 3, 2008, pp. 84-85.
consequent process and thus refresh rate becomes faster. [3] B. Dave, “The Qt Designer IDE”, Dr. Dobb's Journal, Vol. 29, No. 9,
Furthermore, the average refresh cycle tends to be shorter with 2004, pp. 57-60.
the passage of time. [4] A.N. Sloss, D. Symes, and C.Wright, ARM System Developer's Guide:
Designing and Optimizing System Software, Elsevier, Singapore, 2004.
Table I records the average refresh rate when connecting [5] S.Q. Ren, Q. Lu, P. Qian, and J.W. Yang, “An Implementation Of an
to different number of data source. As is shown in Table 1, the Application Based On QT/Embedded On Embedded Linux”, Computer
increment of the data source hasn’t bring great influence on the Applications and Software, Vol.23, No. 2, 2006, pp. 105-107.
interface refresh cycle. What’s more, as for configuration [6] M. Jin, X. Zhou, and L. Jin, Embedded System: Components,
software, the average refresh rate of 0.018s can totally satisfy Principles, Design and Programming, Posts & Telecom Press, China,
the requirement of real-time performance from the user. 2007.
[7] Y. Du, and C. Liu, “Testing Method for Embedded Real-time System
Software Control & Automation”, Vol. 23, No. 4-2, 2007, pp. 86-88.

101

Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.

You might also like