You are on page 1of 5

2016 International Conference on Internet of Things and Applications (IOTA)

Maharashtra Institute of Technology, Pune, India 22 Jan - 24 Jan, 2016

IOT Application for Real-time Monitor of PLC Data


using EPICS
Ramesh Joshi1, H M Jadav, Aniruddh Mali, and S V Kulkarni
Institute for Plasma Research
Gandhinagar, India
1
Email: rjoshi@ipr.res.in

Abstract— A recent huge interest in Machine to Machine or client software installed on the user’s device and even
communication is known as the Internet Of Things (IOT), to worse, they are not available on popular iOS devices such as
allow the possibility for autonomous devices to use Internet for the iPhone and iPad. Fortunately, HTML5 emerged in recent
exchanging the data. The Internet and the World Wide Web have years as a standard that has been quickly adopted by all
caused a revolution in communication between the people. They mainstream web browser vendors and further HTML6.
were born from the need to exchange scientific information HTML5 based web applications have maximum cross-browser
between instrumentation. Control System Studio (CSS) (Best and cross-device compatibilities with the use of semantic web.
Operator Yet Operator Interface) BOY OPI is not only an HTML5 includes a set of new APIs such as a canvas element,
application but also a framework that can be extended with WebSocket, Drag-and-Drop, WebGL, Web Worker, Web
widgets and data sources. The framework provided Storage, Audio, Video, and more. Among which, the canvas
implementations for all the common functionalities, such as XML
element and WebSocket are most important for control system
file reader and writer, PV connection handling, abstract widgets,
properties, OPI Runtime and OPI Editor. The framework can be
UI applications. There are several API’s have been developed
extended using the extension points provided by the framework. base on this concept. The canvas element allows for dynamic,
Monitoring systems CSS are extremely important in scriptable rendering of 2D shapes and bitmap images. This
Experimental Physics and Industrial Control Systems (EPICS). makes it easy to dynamically draw control system UIs in a
Most of them are based on client/server(C/S). This paper designs web browser. For each update, clients initiated a new
and implements a web based real time programmable logic connection. The server could not initiate an update and “push”
controllers (PLC) data monitoring system on EPICS data. This it to the client. A number of workarounds have been used to
system is based on browser and server (B/S). Using circumvent this problem, such as polling and long polling.
MODBUS/TCP communication data have been archived in Even using asynchronous communication using AJAX kind of
EPICS. Then all data is displayed in a real time chart in browser concept has been introduced.
(Internet Explorer or Firefox/Mozilla). The chart is refreshed
every regular interval and can be zoomed and adjusted. Also, it ICRH DAC system has been conceptualized for
provides data tips showing and full screen mode. Acquire of the experimental activities in tokamak [3]. Fig. 1 shows the ICRH
data would be handled by multi-data acquisition card which has system architecture for monitoring and control system using
been hardwired communication with PLC using 24 VDC to 5 PLC. Local CSS OPI is the communication medium between
VDC and vice versa electronics circuit. PLC and web browser client. PLC communicates with local
CSS OPI using MODBUS[4] and WebOPI communicate with
the same using http interface. DAC requires 32 analog inputs,
Keywords—EPICS; PLC; DAC; IOT; OPI; CSS; MODBUS
32 digital inputs, 16 digital output and 16 analog output
I. INTRODUCTION channels for monitoring and control of the system.
Counter/Times are used for system synchronization. PLC
The Internet of Things [1] is seen as the natural evolution (Delta AH500) can monitor and control the digital and analog
of Internet including not only the communication between channels coming from field I/O [5]. PLC supports MODBUS
human but also with any kind of object. This paper is an protocol which acts as a communication medium between
introduction to the Internet Of Things and control system PLC and Computer. MODBUS/TCP over Ethernet is used for
software design. An analysis of the convergence of this our application which is open standard application layer
domain and the Control System is presented at the end. protocol. Ethernet provides the physical medium for
Nowadays, people can do many things in web browsers, communication and TCP/IP gets the data packets to the
such as online meetings, trading, gaming, watching movies, destination node. EPICS[6] is used as an control system which
and more. The web browser is no longer a simple browser. It consist of EPICS process variable database and EPICS Input
became a convenient platform for various applications. Web Output Controller (IOC). CSS BOY OPI is eclipse based
applications have many advantages over desktop applications: graphical user interface development editor which can controls
1) Easy to access. All you need is a URL; 2) Easy to deploy and monitors the signals between master and slave devices
and maintain; 3) Accessible from anywhere at any time. Web using MODBUS. Pymodbus[7] library has been used in order
applications with desktop application characteristics are called to communicate between PLC and computer.
Rich Internet Application (RIA)[2]. Various technologies have
been invented for RIA, such as Flash, Java Applet and
Silverlight, but all these technologies require separate plugin

978-1-5090-0044-9/16/$31.00 ©2016 IEEE 68


The latest generation design of software frameworks for
control systems used by scientific facilities is also an outcome
of the Internet revolution. These frameworks interconnect all
devices on the primary network with the client applications. In
fact, the primary control systems of scientific facilities are
Fig.1: Monitoring and control using PLC primarily tailored for the Machine to Human communication
(monitoring sensors) representing mainly the data in a
SCADA, or for Human to Machine action (steering actuators).
But the development of virtual controllers with a primary
Machine to Machine communication is more and more
common. Actually, any application which only needs “soft
real time” can be developed in the primary control system. In
Fig.2: System architecture some control system frameworks, the controllers are fully
abstracted to represent only the functional object. For example
Fig.2 shows the overall communication system C++ follows the object oriented programming paradigm.
architecture between PLC to local interface which finally MODBUS communication has been used for PLC and PC
accessed using web browser. PLC monitor and control the communication over Ethernet. For EPICS the term “Device” is
digital and analog channels of the field I/O. WebOPI runs on equivalent of Things, encapsulating state, command, attribute
Tomcat or other supported application servers which receive value, unit, threshold. In conclusion, a Control system is an
data from EPICS channel access layer. Finally all data are IOT in a confined network using WebOPI and CSS.
available on web browser. PLC cannot acquire values at the A. IOT Applications
rate of 1ms,so to acquire values Multi Data Acquisition card is Today the Internet Of Things has become a reality in
used. Acquire of the data would be handled by multi-data several applications[8], among them :
acquisition card which has been hardwired communication
with PLC using 24 VDC to 5 VDC and vice versa electronics x Smart Cities: waste management, urban planning and
circuit. environment [9].
II. IOT AND CONTROL SYSTEMS x Health: Ageing population, continuous care,
emergency response [10].
“All of the Internet has been built by human processed
data : web pages, blog, social network. The problem is, people x Commercial: smart product management
have limited time, attention and accuracy—all of which means
they are not very good at capturing data about things in the x Agriculture: Smart farm is using wireless sensor on
real world” [1]. The primary reason of the existence of the cattle to know when one is sick or pregnant [11].
control system is to ensure the capture all of the important data x Energy and Environment: FRED [12] is a sensor
from a thousand of devices necessary to operate a big network to monitor the energy management of
scientific facility. countries and states all around the world. In the same
The field bus or secondary control system and the primary way, “Our Planetary Skin” [13] project is a sustainable
control system traditionally form the architecture of the whole water management platform.
control system. The controllers which are situated close to the B. EPICS and IOT
equipment represent the main elements of the field bus
allowing the control of passive devices. The operators and the x EPICS is designed to be used for integrating
controllers are interconnected through the primary network. heterogeneous systems.
Since the wave of industrial PLC, the distributive aspect of x EPICS based gateways can be easily
control systems has improved a lot. Nowadays, field busses programmed/configured to support various protocols
are more heterogeneous. On the other hand the flood of and connect to various Fieldbuses
Internet hardware has often pushed the primary network to be
based on the common TCP/IP stack. Ethernet has dramatically x EPICS, being based on the regular TCP/IP based stack,
decreased the price of each connection by letting the field bus can integrate very well with the ERP and MES systems
managing the hard real time task. Channel access provides and can also facilitate connectivity to cloud.
data available on application itself with broadcasting
mechanism. Control system includes different power supplies x EPICS has good soft real time characteristics
of each RF generator stages. Ethernet control is possible x EPICS being based on TCP/IP can run on Wired
because these devices include an embedded controller with a Ethernet or Wireless (Wi-Fi). So it is in line with the
PLC also with Ethernet capabilities. The communication trend of Ethernet based protocols.
protocol with the control system is often achieved through a
TCP/IP socket in a plain text protocol like SPI, or with a x EPICS provides the graphical programming facility
binary protocol issued from Internet like CORBA, eventually
x It also provides the facility to download configuration,
with the same protocol as the main control system like EPICS. such that program behavior can be changed at run time.

69
x Application development framework is provided by Thus, even when various types of controllers were used as
EPICS control systems, all the client systems such as the OPI could be
developed on the basis of the CA protocol without hardware
x EPICS used channel Access and pVAccess(EPICS 4), dependencies. In general, a method that used the CA libraries
both of which are subscribe-publish kind of protocols or display manager supported by EPICS collaboration, such as
and both are suitable for device to device CAJ/JCA, CA-Python, MEDM/EDM, and CSS, was adopted
communication for the development of the GUI in the EPICS based system.
x EPICS real time database provides facility to program WebOPI makes interactive response realizable and thus
edge devices such that they can take autonomous compensates for the disadvantage that could not be eliminated
decisions in traditional HTML. Thus far, various types of Web services
in EPICS-based systems have been implemented. However,
x EPICS provides good visualization tools there were only implemented in Web-based systems, where a
quick response and monitoring are unnecessary such as in
x EPICS is ideal for event based systems and data centric
archive viewers and electric-log systems. Data can be archived
systems.
in terms of seconds or half a second in the case of PLC
x EPICS can be adopted for IEC 61499 or other communication using Web. This is because it is difficult for a
conformance Web-based OPI to realize a real-time response similar to native
applications such as EDM/MEDM/CSS, even if Ajax
x VPN can be integrated, encryption and authentication technology is utilized. Since it becomes bidirectional
needs be buiktinto. transmission between a server and clients has become possible,
x EPICS 4 supports pvAceess which has support for the aforementioned problem is solved by WebOPI. In practice,
SOA we confirmed sufficient interactive response in a 100 ms cycle
using WebOPI on the Web browser, and it had a performance
x EPICS being based on standard TCP/IP stack, can be similar to that of native EPICS applications such as EDM.
easily integrated into semantic based solutions, which
will be required for autonomous products. CSS BOY is a modern graphical operator interface editor
and runtime [14]. It allows users to build control system GUIs
x The required drivers, device interfaces required for using drag and drop from over 50 widgets. It is further
common IoT devices, protocols need to be developed. programmable via python, Jython or JavaScript. It provides
extension points for extra data sources, custom widgets, and
III. WEBOPI scripting libraries. By reusing the OPI files created from CSS
To bring control system user interface to the Web, the ideal BOY, WebOPI can immediately inherit the powerful runtime
way is to directly run existing desktop Operator Interfaces in functionality of CSS BOY and leverage the intuitive graphical
web browsers without extra effort. This is how exactly editing capabilities of the BOY OPI Editor. Furthermore,
WebOPI does. It seamlessly executes OPI files created by CSS WebOPI and CSS BOY are 90% single sourced using Eclipse
BOY in web browsers, without any modifications (see Fig.3). Remote Application Platform (RAP) technology [15]. This
However, it is not realistic to replace the GUI-based operator allows continuous synchronized evolution of CSS BOY and
interface (OPI) with a Web-based system using Ajax the WebOPI, which means newly added features of CSS BOY
technology because of interactive performance issue. It has are immediately available within WebOPI.
some widget differences in local and web interface which has
been shown in Fig. 3 that is comparison of desktop OPI version IV. WEBOPI ARCHITECTURE
and WebOPI. Therefore, as a next generation OPI over the web WebOPI is built on Eclipse RAP , which provides the
using EPICS Channel Access (CA), we developed a client capability of bringing Eclipse RCP to the web by reusing most
system based on WebOPI, which uses Web-based systems. of the existing RCP code. It achieves this by replacing the
Standard Widget Toolkit (SWT) layer of RCP with the
Remote Widget Toolkit (RWT) layer as shown in Fig.4. RWT
code resides on both the server and the client side.
Underneath, it uses HTTP as the communication protocol.

Fig. 4: RAP architecture.


Fig. 3: Comparison of same OPI running in CSS BOY and web
browser.
On the server side, its Java code provides the same
One of the advantages of an EPICS-based system is the interfaces as SWT, so existing SWT application code can also
unified communication between the front-end controller and run on RWT. On the client side, it utilizes the qooxdoo
client systems provided by the CA (Channel Access) protocol. JavaScript library for native widgets, and HTML5 canvas

70
elements for custom drawing. The client side code is is almost as important as the identification of each web page
responsible for the representation and event detection, while (URI). The term Web of Things is often used for the
the server side code is responsible for processing the possibility for machines to refer to each other. The Semantic
application logic. For example, when the user clicks a button Web[22] is one of the standard data formats proposed by the
in their web browser, the client code sends the click event to W3C to help machines access Internet knowledge.
the server. Then the server side will process the event and
reply back to the client with a result. Event has been V. TEST RESULTS AND VALIDATION
communicated using AJAX from client side. If there are ICRH DAC user interface screen has been shown in fig. 5
updates that the server should “push” to the client, it uses the for 2 kW and 20 kW stage high power supplies. In each stage
HTTP long polling mechanism as mentioned before. While of power supply there are four different parts include digital
RAP provides a convenient single-source programming status, analog monitoring in graph as well as values, digital
model, implementers need to be aware of key differences control and analog voltage setting from top to bottom. Lower
between desktop and web applications. For example, each part of the screen shows the PV values and timestamp. Log
desktop application has a single user, while web applications messages are displayed in log message part. This log messages
allow multiple concurrent users. This requires the server to are archived in text file format for past records as logbook for
manage one UI thread life cycle per user. The server needs to experimental use. Fig. 6 shows the WebOPI interface for the
verify if the user is still online, and properly dispose related locally developed CSS BOY OPI.
resources once the user closes the web session. This is
achieved by regularly checking for the long polling signal
from each client. This and other small differences between
SWT and RWT are handled via suitable Eclipse fragment or
extension mechanisms, while the bulk of the BOY code is
shared between the RCP and the RAP implementation.
The Internet of Things means literally to connect
everything. The issue to provide a huge amount of unique
identity(UID) of each object has been resolved recently by the
progressive move to IPv6 the protocol, given the possibility to
connect 3.4×10^38 devices but only for TCP/IP based
communication. Despite this, IOT doesn’t yet define a
standard protocol of transportation. Even the usual TCP/IP
competes with the lowest protocols as they have the advantage
to be less energy consuming. In the Application layer [16] no
standard has been taken but most of them are based on an
event system (MQTT[17], XMPP[18]...). The enormous
market potential doesn’t help, resulting often in industrial
companies pushing for their own technical ‘standard’ solution. Fig. 5: CSS BOY OPI for ICRH DAC
However, some consortiums such as M2M[19] (Eclipse
Foundation) or IOT-A[20] (EU) try to federate the standard
and the tools.
Smart Things means that more intelligence will be
embedded inside the device and one important key allowing
the IOT is the possibility to connect itself to the network.
Embedding the communication protocol inside the device
implies that the Control System has to rely more on the
primary network, letting the secondary to be more specialized
for issues that need dedicated hardware (e.g. fast processing
and timing of electronic signals). Gradually the specific COTS
used for scientific applications have started to include
protocols to communicate directly with the Control System.
These “CS plug and play” devices enhance their integration to
the CS by defining their standard interface in a bottom-up
way. The Open Hardware[21] movement can lead to open the
protocols with the same impact of Open Source on the current
Web. Fig. 6: WebOPI for ICRH DAC
Apart of the unanimous concept of Sensors and Actuators,
the IOT stakeholders propose often a very specific solution for One can call any OPI in web browser with specified path
their domains of application. In the control system area, some from Local computer. Http protocol provides interface with the
services are essential, such as the Archiving or the Alarm tomcat server on application layer. The interface between CA
system. The need to identify information itself from an object gateway has been provided for EPICS process variables and

71
WebOPI deployed war files on Tomcat web server. First, we processed by low consumption devices. The contribution of
considered the following in order to protect the IPR networks the control system domain to IOT is uncertain. The lack of
from outside intrusion. In the case of accessing the IPR federation caused by few requirements to have machine to
network from the WAN, we can ensure the security of WebOPI machine communication between different facilities reduces
access by using VPN and authentication with SSL. the possibility of contribution to IOT. Maybe some initiative
Additionally, system operators have to completely understand from the large facilities like CERN with the Open Hardware
the user attempting to access the networks and access route Licence[24] can contribute to an evolution of the embedded
(Internet providers) before WebOPI control is allowed. For intelligence.
caPut, which provides instructions to each device or
component during system operation, system operators need to Overall, with the above considerations, EPICS could be a
know the action and behaviour perfectly. Using Pyepics major middleware used in new industrial automation and IoT
package CA gateway interface is implemented with ICRH systems. The following additional features make EPICS a very
DAC software. On the other hand, it would not matter if they competitive option for IoT.
did not understand some simple instructions in detail such as x EPICS is vendor neutral
caGet and caMonitor, which are used to monitor or obtain the
numerical values for the system parameters with alarm, x EPICS eco-system provides several such tools, which
handling. Thus, when using caPut, a policy is needed for are not provided by other middleware solutions
between the system operators in the control room and a x EPICS real time database is suitable for real time
maintainer exerting control remotely over the Web. The processing at the boundary/edge and EPICS support
following are proposed for this policy. central programming and configuration are very
1. The authenticate users and passwords using SSL on the suitable for emerging IoT requirements.
Web. After the authentication, it is possible to monitor or
control the system parameters. REFERENCES
[1] http://www.internet-of-things-
2. The system operators check the user ID and the domain or research.eu/pdf/IERC_Cluster_Book_2012_WEB.pdf
IP address of the Internet provider for the users. [2] Piero Fraternali, Gustavo Rossi, Fernando Sánchez-Figueroa, "Rich
Internet Applications", IEEE Internet Computing, vol.14, no. 3, pp. 9-
3. The user sends a request to the system operators when 12, May/June 2010, doi:10.1109/MIC.2010.76
sending caPut instruction to the EPICS process variable [3] Delta AH-500 PLC module reference:
responsible for the authentication. http://www.ferret.com.au/ODIN/PDF/Showcases/105517.pdf
4. In response to the request from the user, the system [4] http://www.aps.anl.gov/epics/
operators make decision about whether the component in [5] Pymodbus Python Package, https://pypi.python.org/pypi/pymodbus.
the EPICS record may be controlled using WebOPI. A [6] Pyepics Python Package, cars9.uchicago.edu/software/python/pyepics3/
response is returned to the user about whether it is possible [7] Ramesh Joshi et al. Conceptual design of EPICS based implementation
to operate the component in the EPICS record. for ICRH DAC system, Conference preceding of SocProS 2013, IIT
Roorkee
5. After receiving this response, the maintainer can not only [8] http://www.alexandra.dk/uk/services/publications/documents/iot_comic
monitor, but also operate the component via WebOPI. _book.pdf
[9] http://en.wikipedia.org/wiki/Smart_city#Examples_of_use
If the system operators make a decision to interrupt the [10] http://sydney.edu.au/health-
operation, the WebOPI operation is discontinued as soon as sciences/research/healthinformatics/projects/internet-of-things.pdf
possible by the system operator. [11] http://www.theguardian.com/local-
governmentnetwork/2011/aug/18/internet-of-things-local government
VI. CONCLUSION [12] http://en.openei.org/apps/FRED/web/#layer
This paper introduced two technologies that facilitate the [13] http://www.ourplanetaryskin.org
goal of bringing control system UIs to the web for IOT [14] X. Chen, K. Kasemir, “BOY, a modern graphical operator interface
application. They have different characteristics, tailored for editor and runtime”. Proceedings of 2011 Particle Accelerator
different use cases. The WebOPI makes it extremely easy to Conference, New York, NY, USA.
build rich control system web UIs, but its efficiency limits the [15] http://eclipse.org/rap/
number of simultaneous users. A future tool that generates [16] http://tools.ietf.org/html/rfc1122#section-1.1.3
WebPDA UIs using drag and drop as in the CSS BOY display [17] http://mqtt.org/
editor would combine the best of both approaches. To the end [18] http://xmpp.org/
user, either technology provides access to control system data [19] http://m2m.eclipse.org/
via a simple web URL on almost any web-connected device. [20] http://www.iot-a.eu/public
[21] http://en.wikipedia.org/wiki/Open-source_hardware
It is not obvious that IOT will be a reality in 10 years
[22] http://semanticweb.org/wiki/Main_Page
following the constraints of energy and security. But now,
this subject has engaged a lot of research and development[24] [23] http://stephendnicholas.com/archives/1217
which will profit the control system domain in a similar way [24] http://www.ohwr.org/projects/cernohl/wiki
that internet has brought the benefits of TCP/IP and CORBA.
HTTP implementation may be too heavy [23] to be efficiently

72

You might also like