2013 The Design and Implementation of Virtual Machine System in Embedded SoftPLC System
2013 The Design and Implementation of Virtual Machine System in Embedded SoftPLC System
Abstract-Embedded SoftPLC is a new high technology in It provides powerful and flexible means of
industrial control area, which gets over the defects of connection to network. Information can be shared
traditional PLC and has come to general attention in this area. easily among systems.
Virtual machine system is the kernel of embedded SoftPLC Industry of embedded system develops rapidly,
system. This article narrates carefully the design and customer can get product with high Q/P
implementation of virtual machine system with the example of (quality/price).
an embedded SoftPLC system product--ESDDC. The virtual
machine designed in this paper will put forward a new plan of The instruction system of Embedded SoftPLC
SoftPLC programming , and at the same time it also provides a system can be easily extended.
new thinking of software design for software developers.
The volume of Embedded SoftPLC system is much
Keywords: Virtual Machine, Embedded SoftPLC, ESDDC less than traditional PLC, so it can be easily
integrated into other equipments.
I. INTRODUCTION Presently, many Embedded SoftPLC products have been
Due to the advantages of high reliability, strong anti- put into industry automation area successfully in foreign
interference ability, specialty and modularization. the countries[2]. While in China embedded SoftPLC technology
programmable logic controller(PLC) has been widely used in still has a long way to go.
Industrial control field and other industries, such as home B. Framework of Embedded SoftPLC System
appliance industry. While because of the higher prices , poor
versatility and compatibility and weak ability of information The framework of embedded SoftPLC system is
sharing, development of PL.On the other hand the demand introduced with ESDDC--an embedded SoftPLC system,
for PLC in industrial control field and a variety of embedded which is mainly used in building control automation area. It
devices is growing rapidly. is constituted of two parts: development system(or
IDE:integrated development environment) and Running
In recent years, with the rapid development of computer system (or virtual machine). Fig.1 shows the framework of
science and embedded technology and the establishment of ESDDC.
international standard--IEC61131 on PLC, Embedded
SoftPLC emerged as a new high technology.
776
Authorized licensed use limited to: Tsinghua University. Downloaded on January 18,2025 at 15:21:55 UTC from IEEE Xplore. Restrictions apply.
c) Task Interruption. equipments, global variables and POU local variables of
Task with higher PRI is entitled to interrupt the running project.
task with lower PRI. In a general way, occasions which task
is interrupted are described as following: The I/O communication module is used to communicate
with I/O equipments being supervised. It keeps on gathering
Periodical task is completed. data from I/O equipments and put it into input-variable
mapping section that is allocated to store input data. At the
Task received stop request. same time, it keeps on inspecting the commands for writing
Task received interrupt request. to I/O equipments so as to write data to I/O equipments
correctly and timely[8]. When data is read and written,
Timer task with high PRI is ready for running. synchronization should be paid attention to.
Scheduling module maintains a running state flag, which
3) System Management Module.
is checked up by every running instruction so as to know if
The missions of this module are described as following:
the current task should be interrupted. Here is an algorithm
showing how time task with higher PRI interrupts task with To manage system states and I/O mapping
lower PRI: information and retained variable.
To provide IDE with information about editions of
bool on_time_mgr (dword dwTick)
virtual machine system and application program and
information of errors occasionally occurred.
{
To allocate memory for running data of task and
program instances according to object file.
if SystemState != STATE_RUNNING then
To give debug function support to IDE, such as
return 0;
constrained variable management, break point management
and monitored variable management etc.
Get the TaskLists;
B.Instruction Set
for (int i = 0;i<TaskCount;i++) There are 54 object instructions in the virtual machine
system. An instruction is constituted of operation code and
{ operand. The length of operation code is one byte. In the
operation code byte, the fore 5 bits denote son coding while
CurrentTask=TaskLists[i]; the other 3 bits imply instruction type. The total 54 object
instructions are divided into seven groups according to
if(CurrentTask.TaskType == instruction type:
TASKTYPE_TIME)
Transference instruction (15, instruction type is 0);
{ Boolean calculation instruction (4, instruction type
is 1)
if (PRI of running
task<CurrentTask.PRI && Mathematical operation instruction (8, instruction
CurrentTask.WaitingTime> type is 2)
Interval of time task &&
CurrentTask.TaskState is Comparison operation instruction (14, instruction
TASKTYPE_SLEEP or TASKTYPE type is 3)
_WAITING) Bit operation instruction (4, instruction type is 4)
then interrupt the running task˗ Jump instruction (8, instruction type is 5)
Debugging instruction (1, instruction type is 6)
}
Object instruction may have variable operands from 0 to
} 2. But the length of an operand is four bytes so as to simplify
the structure of instruction. The data type of operand may be
} address of variable, address of code and constant.
777
Authorized licensed use limited to: Tsinghua University. Downloaded on January 18,2025 at 15:21:55 UTC from IEEE Xplore. Restrictions apply.
is equipped with uCLinux, so Red Hat Linux 9.0 was chosen REFERENCES
to be the host platform OS for the sake of compatibility. The [1] Fu Yinghong, Li Xiaofan, Xiang Jinjie.: The SoftPLC Technology,
arm-elf tools chain of GNU is selected as cross compile tools: Products and its Discussion of Application Control Solution. Control
arm-elf-gcc is compiler, arm-elf-ld is linker, arm-elf-gdb is & Automation. 12 (2003) 11-13
debugging tool. In order to accelerate the development [2] HUANG Yanyan, LIN Yue, YU Haibin.: Research and
process, Special JTAG emulator for ARM is used to debug Implementation of SoftPLC Technology. Computer Engineering. 1
the virtual machine system software. (2004) 165-167
[3] ZHU Wen-kai, WANG Wei-hua, DING Han, XIONG You-lun.:
Open Architecture of SoftPLC Based on Embedded PC. Machinery &
IV. CONCLUSIONS AND FUTURE WORK Electronics. 3 (2002) 3-7
The ESDDC system is put into use in building control [4] PENG Yu.: The Latest Development of PC-based Control. World
area successfully. The virtual machine system works very Instrument & Automation. 3 (2001)14-22
well. Owing to good design and implementation, the virtual [5] PENG Yu.: The Status and Development of IEC-61131 Industrial
Control Programming Language. International Mechanics
machine system can be easily transplanted to other hardware Technology. 1(2004) 42-49
platform. Embedded SoftPLC technology possesses [6] Huang Yanyan, Lin Yue, YuHaibin.Research and implementation of
tremendous potential and value. It is predictable that the SoftPLC technology.ComputerEngineering, 2004, 30( 1): 165-
embedded SoftPLC system will emerge like bamboo shoots 167.
after a spring rain in automatic control area in later years in [7] Jiang Lianhai.Realization of SoftPLC inembedded controlsystem
China. development platform . Wuhan: HuazhongUniversity of Science and
Technology, 2005.
Soft PLC technology has great potential and value, more [8] Ren Zhibin. The research and implementation of Embedded SoftPLC
and more people has paid more attention to it in the next System .Haerbing Engerneering University.2005
few years it can be predicted that soft PLC products would
like bamboo shoots after a spring rain emerged,and made
great progress in the field of industrial control and embedded
system.
V. ACKNOWLEDGMENT
This paper is supported by the general project of
scientific research of Department of education of Liaoning
Province: Research on the key technology of application of
dynamic service network for supply chain. Its granted
number is L2011240. At the same time, three authors of this
paper thanks to Dalian Neusoft Information University. It
gives us financial and data support for the research.
778
Authorized licensed use limited to: Tsinghua University. Downloaded on January 18,2025 at 15:21:55 UTC from IEEE Xplore. Restrictions apply.