AN EPICS CHANNEL ACCESS IMPLEMENTATION ON SIEMENS PLCs

M. Boros, R. Fernandes, European Spallation Source, Lund, Sweden

G. Singler, B. Péceli, evopro Innovation Kft, Budapest, Hungary


Abstract

At the European Spallation Source (ESS), a neutron re- search facility in Sweden, most of the controls are based on PLCs and layered in the following (traditional) way: field equipment ↔ PLC ↔ EPICS IOC ↔ high-level applica- tions. In many situations, the EPICS IOC layer will not im- plement control logic per se and is only used for converting PLC tags into EPICS PVs to enable the usage of high-level applications such as CS-Studio, Archiver Appliance, and Alarm System.

To alleviate this (traditional) way of doing controls, we propose a simpler approach: implementation of the Chan- nel Access (CA) protocol in the PLC layer for the latest family of Siemens PLCs to remove the EPICS IOC layer. We call it S7EPICS. S7EPICS respects version 13 of the CA protocol specification, and supports multiple EPICS- based client connections at the same time – e.g. CS-Studio, Archiver Appliance – without a noticeable service degra- dation (i.e. delays).

In this paper we introduce this implementation, its archi- tecture and workflow, benchmarking results of tests per- formed, and future developments that could be pursued such as authentication & authorization mechanisms using, e.g., the Arrowhead Framework.

INTRODUCTION

Integrating a Siemens PLC with EPICS [1] high-level applications requires an EPICS Input/Output Controller, or IOC, properly configured with EPICS modules capable of communicating with the PLC using, e.g., s7plc-comms [2] or OPC UA [3]. Configuring an IOC, even for small pro- jects, demands EPICS programmer skills, time and other valuable resources – e.g. a machine prepared to run the IOC. In some (control) use-cases, it would be simpler and more effective if the PLC could “talk” the Channel Access (CA) protocol [4] itself so that it could be interfaced di- rectly with high-level applications.

In this paper, we describe an open source PLC code called S7EPICS [5], which allows a Siemens S71500 fam- ily PLC instance to declare and handle EPICS Process Var- iables (PVs) that EPICS aware applications may consume directly without an actual IOC running.

S7EPICS is a PLC code implemented as a TIA Portal library. When the library is imported into an existing TIA project and it is called in the main PLC cycle, the PLC be- comes a fully-fledged CA server capable of receiving and sending EPICS CA protocol messages through UDP (to discover producers – i.e. servers – of PVs) and TCP packets (to exchange PVs data between producers and consumer –

i.e. servers and clients).


image

miklos.boros@esss.se


DESCRIPTION

Typically, a common control system scenario encom- passes one or more field equipment that are con- trolled/measured by a PLC. The PLC, eventually equipped with I/O cards, is located in a control cabinet and field equipment are connected to either the PLC CPU or to one of its I/O cards. The business logic is implemented at the level of the PLC, working as a self-contained and inde- pendent (hard) control system. In addition, field equip- ment’s signals – interfaced by the PLC – are usually con- sumed by high-level applications to solve domain specific issues.

In case of the (soft) control system is based on EPICS (and consequently high-level applications too – e.g. CS- Studio for OPI screens designing, Archiver Appliance for signals archiving), the integrator has to create and config- ure an EPICS IOC that 1) communicates with the PLC CPU or its I/O cards and 2) “converts” the PLC tags into EPICS PVs in a bidirectional communication. The IOC does not implement any control logic though, and (only) has as a main function to map PLC variables into corre- sponding EPICS PVs. To implement this mapping, the ad- dresses and, sometimes, the offsets of all communication variables have to be specified in the EPICS IOC configu- ration, which is time consuming and prone to error. More- over, the IOC has to be maintained and executed on a (physical or virtual) machine, adding an extra layer of com- plexity to the control system as a whole. Fig. 1 illustrates the traditional PLC-EPICS integration involving an IOC layer between the PLC and EPICS high-level applications.


image

Figure 1: Traditional PLC-EPICS integration.


In contrast, when a PLC (of the Siemens S71500 family) is equipped with the S7EPICS library, it is capable of both answering PV name search requests and interchanging PV data with EPICS high-level applications, making the IOC layer redundant – assuming that the control logic is fully respected/implemented by the PLC. Fig. 2 illustrates the (simplified) integration between the PLC and EPICS high- level applications when using S7EPICS.


image

Figure 2: PLC-EPICS integration with S7EPICS.


Channel Access (CA)

The Channel Access (CA) is a communication protocol that all EPICS aware applications need to implement in or- der to communicate with IOCs or CA servers. A Process Variable (PV) is the addressable unit of data accessible through the CA protocol. Each PV has a unique name which is served by a single CA server. A CA server main- tains two sockets:


This listing resembles the main challenges of state-of- the-art IoT Automation [9], which urges to make use of In- ternet technology in order to come up with solutions ena- bling the next generation of production automation sys- tems. The Arrowhead framework [10] [11] is one of the largest projects in the field. It proposes a service-oriented control architecture (in contrast to the traditional, hierar- chical approach) for industrial facilities with strict require- ments on quality and security. Automation systems are or- ganized into so called “local clouds”, which create secure boundaries protecting the local automation operations from any hazardous external activity. The local cloud must im- plement mandatory core services (service registry, author- ization, orchestration) in order to become self-contained and interoperable towards other Arrowhead networks. Lo- cal clouds may interact with each other if local servicing becomes inefficient or impossible. This follows the sys- tem-of-systems design principle [12].


image

Figure 4: Local Cloud with Arrowhead.


The Arrowhead framework does not break down legacy protocols such as the EPICS CA, but move them into a state-of-the-art, loosely-coupled, service-oriented environ- ment. Consequently, there is a significant potential in inte- grating EPICS-based automation operations at ESS with the Arrowhead framework, bringing benefits such as ac- cess management, security and flexibility.

FUTURE DEVELOPMENT

One of most important future development would be to implement the array support for S7EPICS, which includes handling long CA headers. The S7EPICS code already de- tects array requests and long CA headers, but a proper reply is not yet implemented.

Even if an EPICS IOC implements access security, cur- rently, S7EPICS (and the traditional CA protocol) does not implement system authentication & authorization. One way to properly manage this matter could be through the adoption of the Arrowhead framework.

CONCLUSION

S7EPICS is an open source PLC code, implemented as a TIA Portal library, which enables EPICS high-level appli- cations to connect directly to a Siemens S71500 family PLC without an actual EPICS IOC mediating the two com- ponents. Consequently, S7EPICS simplifies the control system as a whole and, eventually, helps reducing its costs and time to production.

The library may be instrumental for a (research) group that does not possess (much) EPICS competences and/or has substantial PLC development expertise, and when the business (control) logic is entirely implemented in the PLC.

To validate the S7EPICS library many tests were per- formed. These have successfully demonstrated that the li- brary is compatible with generic CA clients (e.g. caput, caget, CS-Studio) and is capable of successfully handling (several) thousands of PVs without putting an unmanagea- ble load on the PLC. Finally, this paper also proposes a software architecture based on the Arrowhead framework to find a solution for next generation challenges.


REFERENCES


[1]

EPICS, "Experimental Physics and Industrial Control System," 2019. [Online]. Available: https://epics-controls.org/.

[2]

E. E. Modules, "s7plc_comms EPICS module," European Spallation Source. [Online].

[3]

S. O. UA, "Siemens OPC UA," Siemens , [Online]. Available: https://new.siemens.com/global/en/products/automa tion/industrial-communication/opc-ua.html.

[4]

E. community, "Channel Access Protocol Specification," 2014. [Online]. Available: https://epics.anl.gov/base/R3-16/0- docs/CAproto/index.html.

[5]

M. Boros, "S7EPICS BitBucket repository," 06 10 2019. [Online]. Available: https://bmykeb@bitbucket.org/bmykeb/s7epics.git.

[6]

WireShark, "WireShark," [Online]. Available: https://www.wireshark.org/.

[7]

G. Ulm et al., "PLC FACTORY: Automating Routine Tasks in Large-Scale PLC Software Development," Proc. ICALEPCS’17, Barcelona, Spain, October 2017, paper TUPHA046, 2017.

[8]

R. Fernandes†, "Controls Configuration Database at ESS," 2017. [Online]. Available: http://accelconf.web.cern.ch/accelconf/icalepcs201 7/papers/tupha156.pdf.

[9]

J. Delsing, "Local Cloud Internet of Things Automation: Technology and Business Model Features of Distributed Internet of Things Automation Solutions," IEEE Industrial Electronics Magazine, pp. 8-21, 2017.

[10]

J. Delsing, IoT Automation: Arrowhead Framework, CRC Press, 2017.

[11]

Arrowhead consortium, "Arrowhead Framework," 2019. [Online]. Available: https://www.arrowhead.eu/arrowheadframework. [Accessed 15 August 2019].

[12]

C. Keating, "System of Systems Engineering," pp. Engineering Management Review, IEEE. 15. 62 - 62. 10.1109/EMR.2008.4778760, 2003.