Вы находитесь на странице: 1из 10

SOAP4PLC: Web Services for Programmable Logic Controllers

Markus Mathes, Christoph Stoidner, Steffen Heinzl, Bernd Freisleben


Department of Mathematics and Computer Science, University of Marburg
Hans-Meerwein-Str. 3, D-35032 Marburg, Germany
{mathes,stoidner,heinzl,freisleb}@informatik.uni-marburg.de

Abstract logic in a coarse-grained manner, which leads to simplified


engineering and reengineering of business processes.
The use of service-oriented architectures based on web The intermediate layer acts as a mediator between the
services in the manufacturing layer of industrial enter- business layer and the manufacturing layer. It performs
prises yields vertical integration and promises increased two major tasks: (1) Production orders in the business
interoperability and flexibility. Unfortunately, two main layer are translated into concrete control commands for the
obstacles complicate the use of web services in the man- manufacturing systems, e.g. throughput increase/decrease,
ufacturing layer. First, the hardware/software used in this or shutdown for the purpose of service or retooling. (2)
layer differs from the hardware/software used in other Manufacturing data from the shop floor, e.g. the system
layers. Second, the manufacturing layer is maintained by status of an assembly line, already produced units, or error
automation engineers who typically are not familiar with messages, are collected, filtered, merged, and delivered to
web services. the business layer. The interconnection between business
This paper presents the first SOAP engine for pro- and manufacturing layer is realized via a so-called man-
grammable logic controllers to advance the use of web ufacturing execution system (MES). The particular MES
services in the manufacturing layer. The engine offers a used, depends on the automation solution used at the
low memory footprint to respect the low computational manufacturing layer. In practice, the automation solution
power of programmable logic controllers and allows to also prescribes the MES.
export web services automatically without intervention of At the manufacturing layer, the core business of an
an automation engineer. industrial enterprise is located: the manufacturing process.
Modern assembly lines are composed of numerous, stan-
dardized units, e.g. industrial robots, grinding machines,
conveyor belts, or paint shops. These units are controlled
I. Introduction by programmable logic controllers (PLCs) and industrial
PCs (IPCs) and are interconnected via field buses. The
The software infrastructure of today’s industrial enter- software in this layer is often proprietary and bundled with
prises in the manufacturing domain, e.g. vehicle manu- the hardware used.
facturing and aircraft construction, is often organized in To summarize, the IT infrastructure of industrial en-
three vertical layers: business layer, intermediate layer, and terprises in the manufacturing domain is highly heteroge-
manufacturing layer. neous, ranging from the business layer with standardized,
The business layer of an enterprise contains software web service based ERP solutions to the manufacturing
functionality for planning purposes, e.g. accounting, ad- layer utilizing vendor-specific automation solutions. The
ministration, or human resources. Large-scale enterprises vertical adoption of service-orientation in all three layers is
by the majority and small and medium-sized businesses desirable, since it leads to a homogeneous communication
increasingly use enterprise resource planning (ERP) so- infrastructure based on a single communication paradigm
lutions at this layer. For interoperability reasons, current in the entire enterprise [1].
ERP solutions are based on web services that enable a This paper bridges the gap between the service-oriented
horizontal integration of the enterprise with its suppliers business layer and the non service-oriented manufactur-
and customers and a flexible adaptation to new market ing layer by means of the first SOAP engine for PLCs
conditions. Another benefit of adopting web services at called SOAP4PLC. SOAP4PLC supports the convergence
the business layer is the possibility to publish business of the business and manufacturing layer. The automation
engineer develops the PLC control software in a well- Higher Layers
known development environment. The corresponding web
services are generated and deployed automatically in the
background. SOAP4PLC is one of the core components
of the Time-Constrained Services (TiCS) framework [2].
TiCS is a development environment for time-constrained
web services and consists of three functional layers—tool-
support layer, real-time service layer, and hardware layer—
that contain several components to meet the demands of a
web service based automation infrastructure.
The paper is organized as follows. Section II illustrates Pro Pro
the concepts of current industrial automation solutions.
In Section III, a design approach for service-oriented
PLC applications is presented. Section IV discusses major
design considerations concerning a SOAP engine for PLCs
and explains how the interaction between a web service
and a PLC application is managed. Section V presents
a prototypical implementation of the SOAP4PLC engine.
Section VI discusses a use case that exemplifies the use Fig. 1. Hierarchical arrangement of the pro-
of SOAP4PLC. Related work is discussed in Section VII. duction process using IPCs and PLCs.
Section VIII concludes the paper and outlines areas for
future work.
power or main memory. A PLC has several input/output
II. Industrial Automation Using PLCs modules that are connected to sensors and actuators, re-
spectively. A sensor collects (often analogous) information
This section outlines the traditional implementation of from the shop floor, e.g. temperature, pressure, or humidity,
control applications using a PLC. More precisely, the whereas an actuator allows to manipulate the manufactur-
functionality of a PLC is presented and the interconnection ing process. Examples for actuators are electric motors,
of the business and the manufacturing layer is discussed. solenoids, or conveyor belts.
Unfortunately, there are no standards for the design and PLCs operate in a loop according to the input-
realization of industrial production processes. Automation processing-output (IPO) model where each step is pro-
engineers rely on best practice solutions developed over cessed in a predetermined time. The PLC reads input data
the years, as discussed below. from its sensors, computes the necessary reaction based
At present, the entire manufacturing process is sub- on a given rule base, and uses its actuators to react.
divided into several disjunctive manufacturing steps that Such an IPO loop is called a task. Since each step in
are called production cells. Each production cell contains an IPO loop can only take a predetermined time, a PLC
several manufacturing devices, e.g. industrial robots or inherently supports real-time processing. The rule base is
hoisting platforms, that are controlled by a PLC. Several set up by a domain expert, namely the automation engineer
cells are monitored by an IPC. The IPC offers an—often who maintains the manufacturing process, using different
proprietary—interface to query information from higher (low-level) programming languages, e.g. Function Block
layers. This approach leads to a hierarchical arrangement Diagram (FBD), Ladder Diagram (LD), Structured Text
of the entire production process, as shown in Figure 1. (ST), or Sequential Function Chart (SFC), as defined by
An IPC is comparable to a regular desktop PC in IEC 61131-3 [3]. A PLC control application is organized in
terms of computing power and main memory, but the case several modules called program organization units (POUs).
design is much more robust to resist the hostile physical A POU may consist of multiple expressions in one of the
conditions in the manufacturing layer, such as temperature, low-level programming languages and other POUs. Each
vibration, or dust and dirt. Often, standardized operating task is realized by one POU.
systems like Microsoft Windows or Linux are used to run The presented hierarchically organized production pro-
IPCs. cess has three main disadvantages: (1) Within a PLC
A PLC is specialized automation hardware that differs control application, control logic for different manufactur-
significantly from common desktop PCs. Even though ing devices is mixed. (2) The interface between the IPC
modern PLCs become more and more powerful, they are and higher layers is often proprietary. (3) Interconnection
not comparable to desktop PCs with regard to computing of manufacturing layer and higher layers requires expert
Enterprise Resource Enterprise Resource
Planning Planning

Business Business
Engineer Engineer Automation
Proprietary
Interface Engineer

Automation Web Service


Engineer Interface
PLC
PLC

Function Function

Input Processing Output Input Processing Output

Sensor Actuator Sensor Actuator

(a) (b)

Fig. 2. Separation of concerns in industrial automation.

knowledge both of the automation engineer and software and languages for the definition and deployment of web
developers from higher layers. services. Thus, the automation engineer operates in his/her
well-known development environment. Since the PLC of-
III. Service-Oriented PLC Applications fers a standardized service-oriented interface based on web
services if our SOAP4PLC engine is used, the business
engineers can also use their well-known tools to access
This section presents a design approach for developing
the manufacturing process. Consequently, our concept fills
service-oriented PLC applications based on web services.
the gap between business layer and manufacturing layer
Since this concept is new in the industrial automation
without introducing unfamiliar technologies, neither for the
domain, there are no well-established design patterns.
business nor for the automation engineer.
Furthermore, automation engineers are normally not famil-
This approach results in a separation of concerns. Up to
iar with service-oriented concepts. Therefore, the primary
now, the business and the manufacturing engineer have to
objective of the SOAP4PLC engine is to hide the web
collaborate to realize the proprietary interface between the
service details from automation engineers. This requires
business layer and the manufacturing layer, as shown in
a specific organization of the PLC application to permit
Figure 2(a). Using our approach, the concerns of the busi-
automatic identification of functional entities (e.g. PLC
ness and the manufacturing engineer are cleanly separated,
functions) by the SOAP4PLC engine.
as shown in Figure 2(b).
The use of web services and conventional tools for
the implementation of PLC functions do not affect each
other. The automation engineer designs and implements the IV. Design of a SOAP Engine for PLCs
PLC applications as usual to support high acceptability by
the engineering domain. Each functionality of a module The primary design objective of the engine is usability
that should be exported by the SOAP4PLC engine as a for automation engineers, i.e. the control logic imple-
web service has to be encapsulated in a PLC function. To mented by the automation engineer should be exported
export these functions, the PLC development environment automatically as web service. Therefore, the automation
supports a configuration interface. The SOAP4PLC engine engineer does not have to deal with unfamiliar technologies
manages all exported PLC functions and invokes a specific such as SOAP. To realize this objective, the following
function when the corresponding web service invocation functionality is required:
arrives. • The automation engineer must be empowered to de-
This concept allows to use the standard automation tools ploy/undeploy PLC functions as web services.
• WSDL descriptions of already deployed web services A. WS-Infobase
have to be generated automatically.
• The PLC has to listen for incoming SOAP request The WS-Infobase component implements the service
messages and has to interpret them. descriptor table, a database that holds the metadata of all
• An invocation message must result in a call to the deployed web services and the related PLC functions. All
corresponding PLC function. other components of the SOAP4PLC engine use the WS-
• After the call of a PLC function, a SOAP response Infobase to retrieve required metadata on a specific web
message has to be generated and sent. service. Each deployed web service is listed in the WS-
These functions are encapsulated in four core compo- Infobase with its unique name and a table of provided
nents of the SOAP4PLC engine: WS-Infobase, WSDL- operations. The unique name will be used to retrieve the
Generator, SOAP-Handler and SOAP2PLC-Bridge: web service from the WS-Infobase. The table of operations
• WS-Infobase: This component is the information contains a row for each deployed operation of the web
source for all other components that need some infor- service. A row includes the following information to
mation about the deployed web services. It provides describe the interface of an operation:
an interface to permit the export of a PLC function • name of operation: The name is used to determine
as a web service by the automation engineer. the operation of the web service.
• WSDL-Generator: This component dynamically • reference to the corresponding PLC function: The
generates WSDL descriptions for already deployed reference is used to address the PLC function and is
web services. realized as a function pointer, a handle, or a unique
• SOAP-Handler: This component implements the identifier depending on the used PLC programming
SOAP protocol, i.e. it processes incoming SOAP system.
request messages and generates outgoing SOAP re- • list of input parameters: The input parameter list
sponse messages. specifies the number of parameters and the datatype
• SOAP2PLC-Bridge: This component locates and of each parameter. The order of the parameters in the
calls the corresponding PLC function for an incoming list specifies their order for an operation call.
web service invocation. • datatype of the operation: The datatype of the
operation represents the datatype of its return value.
Since the interface definition specifies the interface of the
web service and the interface of the corresponding PLC
function, both interfaces have to be identical.
To the automation engineer, the WS-Infobase provides
Web Service Interface a user interface to deploy and undeploy web services.
More precisely, from the automation engineers point of
view, it provides a user interface to export PLC functions.
Using this interface, the automation engineer is empowered
to select some PLC functions for being exported as web
services. For each exported PLC function, a group name is
SOAP4PLC Engine defined. The group name specifies the web service these
PLC functions are assigned to. The user interface is the
only point of contact between the automation engineer
and the SOAP4PLC engine. The WS-Infobase is able to
generate all metadata required by the service descriptor
PLC Application table from the input of the automation engineer since the
PLC development environment knows all PLC functions,
their names and their interfaces. The name of the web
Fig. 3. Design of the SOAP4PLC engine. service used to deploy the PLC function is derived from the
PLC function’s group name. Thus, the deployment process
Figure 3 illustrates the internal structure of a web is performed automatically without any interaction of the
service enabled PLC. The SOAP4PLC engine acts as a automation engineer and is completely transparent. This is
mediator between the conventional PLC application and done at the startup of the PLC application in three steps
the web service interface. Figure 4 shows a sequence per web service: (1) All generated metadata will be stored
diagram for the execution of a PLC function using a web in the service descriptor table. (2) The SOAP-Handler is
service. extended to accept the URI of the newly deployed web
:SOAP2PLC-
:SOAP-Handler :WS-Infobase :PLC Function
Bridge
SOAP request
match webservice
by name

result

match operation
by name

result

match interface
by datatypes

result

forward request

get function pointer

result

get interface
descritpion

result
invoke

result

Fig. 4. Sequence diagram of a PLC function call using a web service.

service. (3) A new instance of the WSDL-Generator is validated, i.e. the operation name, the argument datatypes
started to offer a WSDL description for the new web and the return datatype is determined and matched with
service. the metadata from the service descriptor table in the WS-
Infobase. Additionally, the argument values are parsed and
B. SOAP-Handler stored for later usage. Then, the SOAP2PLC-Bridge is
used to invoke the PLC function and to pass the argument
The SOAP-Handler component realizes the handling values.
of the SOAP protocol. When the WS-Infobase deploys a As soon as the PLC function terminates, the
web service, the SOAP-Handler is informed. At application SOAP2PLC-Bridge returns the result to the SOAP-
start, it initiates the underlying HTTP protocol handler to Handler. The result is embedded in a SOAP response
listen for the corresponding URI of the web service. After message that is delivered to the underlying HTTP protocol
that, the SOAP-Handler is able to handle requests for that handler to complete the web service request.
web service.
When a request arrives, the SOAP-Handler identifies the C. WSDL-Generator
target web service via the requested URI and tries to find
the corresponding operation interface definition using the The WSDL-Generator component provides a WSDL
WS-Infobase. If no matching entry is found, a SOAP fault description for each deployed web service. The WSDL
message is generated. Otherwise, the interface definition is description is generated automatically based on the meta-
data contained in the service descriptor table of the WS- V. Implementation
Infobase. When the WS-Infobase deploys a web service, a
new instance of the WSDL-Generator is created. The new This section presents a prototypical implementation
instance initiates the underlying HTTP protocol handler to of the SOAP4PLC engine. More precisely, the imple-
listen for the according URI of the web service. Since all mentation of the WS-Infobase, WSDL-Generator, SOAP-
required information for describing the entire interface of Handler, and SOAP2PLC-Bridge components are dis-
each web service are contained in the WS-Infobase, the cussed.
generation process can be done completely in background
without requiring any attention of the automation engineer. A. Experimental Soft- and Hardware
The URI that provides the WSDL description equals
the corresponding web service name extended by the The IPC@CHIP PLC from Beck IPC GmbH [4] is used
postfix “.wsdl”. For example, the WSDL description of the as our experimental hardware. All products based on the
web service “Paintshop” is provided by “Paintshop.wsdl”. IPC@CHIP technology contain a full-featured embedded
On an incoming client request, the handler generates the real-time operating system called @CHIP-RTOS. @CHIP-
WSDL description dynamically and delivers it to the RTOS supports all common features of modern operating
underlying HTTP protocol handler. systems, such as multitasking, support for several network
interfaces, TCP/IP protocol stack including IPsec and SSL,
and standard transfer protocols like HTTP, FTP, and SSH.
D. SOAP2PLC-Bridge
CoDeSys, an IEC 61131-3 compliant programming
system developed by 3S-Smart Software Solutions [5],
The SOAP4PLC engine requires to call a PLC function is used as our PLC development environment to access
from outside of the PLC application. It passes the argu- the PLC. The CoDeSys programming system consists of
ments, executes the PLC function and on return it reads two software components. The first one is CoDeSys itself.
the return value. Since the PLC function is implemented This is a Microsoft Windows application that realizes
using a PLC development environment, there are several the PLC development environment, consisting of editor,
issues to consider: compiler, debugger, etc. The second software component
is the runtime system called CoDeSys SP. CoDeSys SP
1) The PLC function is unknown at compile- and link- runs on the target system (the IPC@CHIP based PLC) and
time of the SOAP4PLC engine, i.e. the PLC function manages download, linking, execution, and debugging of
has to be linked dynamically. the PLC application.
2) The PLC function is not located within the context To permit SOAP-based interaction with the PLC, we
of the SOAP4PLC engine, but within the PLC ap- extended CoDeSys SP by the four components discussed
plication. Consequently, a context switch is required in Section IV. Figure 5 illustrates the integration of the
before and after the call of the PLC function. SOAP4PLC engine into the IPC@CHIP based PLC. The
3) The calling conventions of PLC functions differ from WS-Infobase and SOAP2PLC-Bridge plug-ins extend the
the calling conventions of ANSI C functions. Thus, CoDeSys runtime system, whereas the SOAP-Handler and
a PLC compliant stack frame has to be created first the WSDL-Generator extend the @CHIP-RTOS by SOAP
for passing arguments, calling the PLC function, and protocol capabilities.
accepting the return value. The implementation of the SOAP4PLC engine offers
4) The PLC application runs in a different task than a low memory footprint to respect the restricted compu-
the SOAP4PLC engine. Hence, the call of a PLC tational power of current PLCs. The entire main memory
function has to be synchronized to avoid race condi- required for engine code and static data is approximately 7
tions. Furthermore, the real-time requirements of the kBytes. The memory requirement for every exported PLC
PLC application are assured. This is important since function depends on the size of its interface description
the workload caused by the web service consumer (number of arguments). Typically, a PLC function requires
is unknown. approximately 40–100 Bytes of main memory.
All these functions are handled by the SOAP2PLC-
Bridge. The used hardware and operating system determine B. WS-Infobase
the structure and the implementation of the SOAP2PLC-
Bridge. Furthermore, the applied PLC programming sys- Our prototypical SOAP4PLC engine is implemented
tem affects the implementation, since the IEC 61131-3 inside the runtime system only. Thus, there is no graphical
standard does not define the low-level details (for example user interface, but a simple API. It provides the functions
memory layout and structure) of a PLC application. S4PaddArgument, S4PexportPlcFunction, and
done with the result of the previous call. Thus, the last call
returns the complete list and can be used as an input value
PLC Application for S4PexportPlcFunction.
The function S4PshutDown is called once at the shut-
down of the PLC application. The function clears the
service descriptor table and undeploys all web services, i.e.
all web services are deregistered from the SOAP-Handler
and all instances of the WSDL-Generator are terminated
and removed.
As mentioned before, the S4PexportPlc-
Function, S4PaddArgument, and S4PshutDown
HTTP Daemon functions are called at application start-up and shut-down,
respectively. The CoDeSys programming system provides
an event concept that offers several system events. One
of these system events—the start event—occurs when the
PLC is powered on or when the PLC application is stopped
and restarted again. The automation engineer is able to
register a PLC function for this event that implements
PLC function export using S4PexportPlcFunction
Fig. 5. Prototypical implementation of the and S4PaddArgument. Similarly, the unregister process
SOAP4PLC engine at an IPC@CHIP based is also realized using the CoDeSys system events. For
PLC. this purpose, the system stop event is used to call the
S4PshutDown function. This terminates the engine and
thus unregisters all functions. The engine is restarted
S4PshutDown to handle the export of PLC functions. again on the first S4PexportPlcFunction call
These functions are implemented as external functions, i.e. automatically.
these functions are accessible from the PLC application
but are not implemented in a PLC programming language. C. WSDL-Generator
Instead, the functions are part of the runtime system and
are implemented using the programming language C. The @CHIP-RTOS offers an HTTP server. The im-
The function S4PexportPlcFunction is called at plementation of the WSDL-Generator component uses
the start of the PLC application, once for each PLC func- this HTTP server to listen for HTTP requests and sends
tion to be exported. The function expects the group name, an HTTP response back to the client. The interaction
the PLC function name, a reference to the corresponding between the WSDL-Generator component and @CHIP-
PLC function, the interface description (argument list) and RTOS’ HTTP server is realized using the CGI interface
the return type as its arguments. They are stored in the of @CHIP-RTOS. This interface permits to register ex-
service descriptor table. The group name will be used as ternal handlers for incoming requests on specific URIs.
web service name. If the web service name is unknown The WSDL-Generator component takes advantage of this
(i.e. there was no registration call on that name before), feature. Every instance of the component announces its
two more steps are necessary: (1) The SOAP-Handler is own handler for the WSDL URI of the specific web
extended to accept the URI of the newly registered web service. On an incoming client request, the specific handler
service. (2) A new instance of the WSDL-Generator is is called. Then, the handler creates the WSDL description
started, offering a WSDL description for the new web dynamically and delivers it to the HTTP server. The HTTP
service. server sends it back to the requesting client.
The function S4PaddArgument creates an argument
list that is required by the function S4PexportPlc- D. SOAP-Handler
Function as described above. To create an argument list,
it is called once for each argument. It expects the argument Just like the WSDL-Generator component, the SOAP-
type of the new argument and the current argument list. It Handler uses the @CHIP-RTOS’ HTTP server as its un-
returns the current argument list extended with the new derlying HTTP protocol handler. Therefore, it registers an
argument as its result. To create a complete argument external handler for every deployed web service URI using
list, the function is called for the first argument with the @CHIP-RTOS CGI interface. As soon as a request for
S4P_EMPTY (an empty argument list). The next calls are a specific web service arrives, the @CHIP-RTOS’ HTTP
server triggers the external handler. The external handler allocation for arguments, local data, return value, and
implements the SOAP parser and interacts with the other return address. The allocation could be realized by the
required components, as described in Section IV. caller, the function itself or by both in an hybrid approach.
Furthermore, a calling convention defines the order of
E. SOAP2PLC-Bridge the arguments on the stack. Unfortunately, the calling
conventions of PLC functions differ from those of ANSI
The SOAP2PLC-Bridge handles low-level functionality C functions. Therefore, calling a PLC function requires to
that depends on the used processor architecture and op- create the stack frame according to the interface definition
erating system. Since the IEC 61131-3 standard does not of the PLC function and the argument values that were
define the low-level layer of a PLC application (memory passed on the web service’s invocation message. Then, the
layout and structure), the used PLC programming system function pointer is used to determine the memory address
also affects the implementation of this component. The where the PLC function is located and a call to that address
IPC@CHIP technology with the @CHIP-RTOS and the is executed. When the PLC function returns, the return
CoDeSys PLC programming system require to take dy- value can be read from the stack. Finally, the stack has to
namic linking, context switches, calling conventions, and be restored, i.e. allocated data has to be deleted.
synchronization into consideration, as discussed below. 4) Synchronization: Synchronization includes two
1) Dynamic Linking: On a request to invoke a PLC challenges:
function, the SOAP2PLC-Bridge expects the name of the First, the SOAP4PLC engine, more precisely the
PLC function. Matching this name with the WS-Infobase SOAP2PLC-Bridge, runs in a different task than the PLC
results in a reference (called POU index) to the requested application. All exported PLC functions are executed
PLC function. Since every POU within a CoDeSys PLC within the SOAP4PLC engine’s context. Consequently, the
application owns a unique POU index, it can be used to PLC functions have to be synchronized with the rest of
determine the pointer to the PLC function. The mapping the PLC application. Each access to global data has to
from POU index to function pointer is done using a C be checked and protected against race conditions. Since
function provided by the CoDeSys runtime system. Later, potential race conditions depend heavily on the PLC appli-
this function pointer is used to invoke the PLC function. cation structure, the automation engineer is responsible to
2) Context Switch: The process concept known from realize the synchronization manually. For this purpose, the
general-purpose operating systems like Windows or Lin- CoDeSys programming system on the IPC@CHIP based
ux/Unix is also applied in the @CHIP-RTOS. Every PLC provides a comfortable semaphore API.
process (or application) owns its dedicated context, e.g. Second, it must be ensured that the additional workload
stack, instruction counter, heap memory. The SOAP4PLC caused by web service invocations, which normally is
engine and the PLC application are running in separated unknown, does not delay the execution of the PLC control
processes, i.e. before the PLC function is called, the application. For this purpose, the time-slicing feature of
process context has to be switched to the PLC application. the IPC@CHIP based PLC is used. A time slice defines
This is important to permit the PLC function to access the maximum processor time that is assigned to the corre-
the PLC application’s environment such as global data. As sponding tasks. The time-slicing feature allows to define
soon as the PLC function has been completed, the process a time slice for the system and application tasks (e.g.
context of the SOAP4PLC engine has to be restored. ethernet, TCP/IP stack, HTTP protocol handling, execution
of SOAP4PLC engine) and a second one for the PLC
In an IPC@CHIP environment, a process context is
application tasks (all tasks created with the CoDeSys
specified by a 16-bit segment value. The current process
programming system) to ensure timely execution of the
context is declared using the data segment (DS) processor
PLC control application.
register. Before switching the context, the old value is
saved to the stack. Then, the PLC application’s process
context is written into the DS register. The context is VI. Use Case
determined using a C function provided by the CoDeSys
runtime system. When the PLC function is processed, the This section illustrates the use of the SOAP4PLC engine
SOAP4PLC engine’s context has to be restored. This is by means of a use case from the automobile manufacturing
done by reading it from the stack and writing it back to domain, more precisely the painting of a car.
the DS register. Painting a car takes the following steps: (1) car
3) Calling Conventions: A calling convention is an identification using a bar code or RFID, (2) selection
agreement between a function and a potential caller of of the corresponding paint color, (3) painting, (4) dry-
this function. It defines the structure of the stack frame of ing. Using our SOAP4PLC engine results in a web
the function call and the responsibility for the memory service named PaintShop that offers the operations
identify, selectColor, startPainting, and automation domain. It supports several DPWS stacks im-
startDrying. plemented in different programming languages. At present,
We assume that the overall PLC application was al- there is no stack available that allows the usage of DPWS
ready implemented by the automation engineer including in a typical development environment for industrial control
the PLC functions identify, selectColor, start- applications.
Painting and startDrying. To enable the call of the Kalogeras et al. [14] present a web service based
PLC functions via a web service, the PLC functions have system architecture for vertical integration in industrial
to be grouped and exported using the WS-Infobase func- enterprises. The authors do not discuss the specific real-
tion S4PexportPlcFunction. As soon as the PLC time requirements in the manufacturing layer and tool
application is started, the start-up function exports the PLC support for automation engineers. Thus, our proposal can
functions as a web service. Therefore, a web service named be used as a technical foundation for this architecture.
PaintShop is deployed to the SOAP4PLC engine that is Karnouskos et al. [15], [16] present the integration
accessible under the URI /PaintShop. The web service of SOA-ready embedded devices into the web service
offers an operation for each exported PLC function. Also, infrastructure of an enterprise. The presented architecture
a corresponding WSDL /PaintShop.wsdl description discusses the layers of an industrial enterprise in detail,
is available that is created dynamically by the SOAP4PLC but no implementation or evaluation is given.
engine according to the web service name and the method
interface description. VIII. Conclusions
Figure 6 shows a screenshot of the CoDeSys devel-
opment environment with example PLC code of the ex-
The use of service-oriented architectures based on web
ported PLC function selectColor and also the start-
services on programmable logic controllers has many
up code that exports the PLC function. The example is
advantages. In the industrial automation domain—where
implemented via a function block diagram according to
software is often proprietary—web service technologies
IEC 61131-3.
permit the interaction between the manufacturing layer and
the business layer without requiring detailed knowledge of
VII. Related Work the counterpart.
Unfortunately, the use of web services on PLCs has
The SIRENA project [1], [6], [7]—part of the ITEA several difficulties: (1) hard- and software of a PLC is
research program—is aimed at the development of a less powerful than hard- and software on workstations
service infrastructure for real-time embedded networked and servers; (2) automation engineers who maintain the
applications. SIRENA envisions a seamless use of service- PLCs often have less experience in the development and
oriented architectures within holonic industrial automation deployment of web services; (3) web services for the
and identifies resulting business advantages. Unfortunately, manufacturing layer are completely new in the industrial
SIRENA only offers an innovative architectural blueprint automation domain, so there are no well-established design
of service-oriented industrial automation, but no practical patterns.
implementation or tool support are presented. The SOAP4PLC engine presented in this paper solves
Gilart-Iglesias et al. [8], [9] present an approach called these problems. It extends an IEC 61131-3 compliant
Industrial Machine as a Service (IMaaS) that enables a programming system with an interface for exporting PLC
seamless service-oriented integration of machines in the functions. This interface does not presume any knowledge
IT infrastructure. Even though IMaaS is similar to our about web services of the automation engineer. For each
approach, no connection to well-established automation exported PLC function, a corresponding web service is
tools and programming languages (e.g. according to IEC deployed automatically. All necessary steps from deploy-
61131-3) are presented. ment over WSDL generation to verification and execution
Mircosoft has proposed the Devices Profile for Web of requests are performed automatically and are completely
Services (DPWS) [10], [11], [12]. This technology spec- transparent to the automation engineer.
ifies a minimal SOAP implementation to realize web Besides the SOAP4PLC engine, we presented a design
service communication on small and resource-constrained approach for developing service-oriented PLC applications
devices. Although DPWS is suitable to run on a PLC based on web services. The presented approach allows
(regarding computational power and memory footprint), the organization of PLC applications to permit automatic
there is no support for well-established automation tools identification of functional entities (e.g. PLC functions) by
and programming languages (such as IEC 61131-3). the SOAP4PLC engine.
The Web Services for Devices (WS4D) toolkit [13] There are several areas for future work: (1) The
carries Microsoft’s DPWS technology into the industrial synchronization between the SOAP4PLC engine and the
Fig. 6. Example of a web service accessible PLC application.

cyclic execution of the PLC application has to be im- [8] V. Gilart-Iglesias, F. Macia-Perez, D. Marcos-Jorquera, and F. J.
proved. (2) The design approach for service-oriented PLC Mora-Gimeno, “Industrial Machines as a Service: Modelling In-
dustrial Machinery Processes,” in Proceedings of the IEEE Inter-
applications is going to be extended to allow comfort- national Conference on Industrial Informatics (INDIN). IEEE
able modularization and distribution of service-oriented Computer Society Press, 2007, pp. 737–742.
PLC applications. (3) Our prototypical implementation [9] V. Gilart-Iglesias, F. Macia-Perez, F. Mora-Gimeno, and J. Berna-
Martinez, “Normalization of Industrial Machinery with Embedded
of the SOAP4PLC engine only offers a simple API for Devices and SOA,” in Proceedings of the 11th IEEE Conference
the automation engineer. Future versions will extend the on Emerging Technologies and Factory Automation (ETFA). IEEE
CoDeSys development environment with a graphical user Computer Society Press, 2006, pp. 173–180.
[10] “Devices Profile for Web Service (DPWS) Specification,” February
interface that supports to mark an arbitrary PLC function 2006, http://specs.xmlsoap.org/ws/2006/02/devprof/.
for export as a web service. [11] F. Jammes, A. Mensch, and H. Smit, “Service-Oriented Device
Communications Using the Devices Profile for Web services,” in
Proceedings of the 21st International Conference on Advanced
References Information Networking and Applications (AINA). IEEE Computer
Society Press, 2007, pp. 947–955.
[12] E. Zeeb, A. Bobek, H. Bohn, and F. Golatowski, “Service-Oriented
[1] F. Jammes and H. Smit, “Service-Oriented Paradigms in Industrial Architectures for Embedded Systems Using Devices Profile for
Automation,” IEEE Transactions on Industrial Informatics, vol. 1, Web Services,” in Proceedings of the 21st International Conference
pp. 62–69, 2005. on Advanced Information Networking and Applications Workshops
[2] M. Mathes, S. Heinzl, and B. Freisleben, “Towards a Time- (AINAW), 2007, pp. 956–963.
Constrained Web Service Infrastructure for Industrial Automation,” [13] “Web Services for Devices (WS4D), Project Homepage,” http:
in Proceedings of the 13th IEEE International Conference on //ws4d.org/.
Emerging Technologies and Factory Automation (ETFA). IEEE [14] A. Kalogeras, J. Gialelis, C. Alexakos, M. Georgoudakis, and
Computer Society Press, 2008, pp. 846–853. S. Koubias, “Vertical Integration of Enterprise Industrial Systems
[3] “International Electrotechnical Commission (IEC), Programmable Utilizing Web Services,” in Proceedings of the IEEE International
Controllers – Part 3: Programming Languages (IEC 61131-3),” Workshop on Factory Communication Systems (WFCS). IEEE
January 2003, http://www.iec.ch/. Computer Society Press, 2004, pp. 187–192.
[4] “Beck IPC GmbH,” http://www.beck-ipc.com/. [15] S. Karnouskos, O. Baecker, L. M. S. de Souza, and P. Spiess, “Inte-
[5] “3S–Smart Software Solutions,” http://www.3s-software.com/. gration of SOA-Ready Networked Embedded Devices in Enterprise
[6] F. Jammes and H. Smit, “Service-Oriented Architectures for De- Systems via a Cross-Layered Web Service Infrastructure,” in Pro-
vices – the SIRENA View,” in Proceedings of the 3rd International ceedings of the 11th IEEE Conference on Emerging Technologies
Conference on Industrial Automation (INDIN), 2005, pp. 140–147. and Factory Automation (ETFA). IEEE Computer Society Press,
[7] H. Bohn, A. Bobek, and F. Golatowski, “SIRENA - Service In- 2007, pp. 293–300.
frastructure for Real-time Embedded Networked Devices: A service [16] S. Karnouskos, A. Colombo, F. Jammes, and M. Strand, “To-
oriented framework for different domains,” in Proceedings of the In- wards Service-oriented Smart Items in Industrial Environments,”
ternational Conference on Networking, International Conference on Microsystems Technology (MST), vol. 2, pp. 11–12, 2007.
Systems, and International Conference on Mobile Communications
and Learning Technologies (ICN/ICONS/MCL), 2006, pp. 43–47.

Вам также может понравиться