: An Introduction and History

Andrew Johnson Controls Group, Accelerator Systems Division Argonne National Laboratory Outline

■ Introduction: What is EPICS? ■ History ■ The EPICS Community

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 2 What is EPICS?

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 3 Technology to Enable Discovery

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 4 What is EPICS?

1: A Community in Collaboration

2: A Control System Architecture 3: A Software Toolkit

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 5 1: EPICS Collaboration

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 6 1: EPICS Collaboration

■ International group of laboratories and companies that use and develop EPICS ● Many more than are represented by the logos on the previous slide ● 25+ countries have at least one lab/project using EPICS ● EPICS is used on all continents (including Antarctica) ■ EPICS Council, made up of organizations devoting 1 FTE or more to the collaboration ● Main role is to find and optimize use of resources, not set technical directions ■ Council selects hosts for our twice-yearly collaboration meetings ● Location rotates between labs in Europe, America, and Asia/Pacific ● Open to anyone to attend or speak, typically 100 – 150 attendees ● ~75 presentations over 3 days, plus 1-2 days for training and developer meetings ■ Mailing list ‘tech-talk’ for users, technical questions, bug reports etc. ● 900 subscribers, additional readers via RSS ● Additional ‘core-talk’ mailing list for core developer use ■ Additional collaboration occurs continually between users and developers ● Some labs share software development effort for new features and tools ● Others assist in finding bugs, porting to new OS’s, answering questions etc.

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 7 2: EPICS Control System Architecture

Client Application Network Protocol

IOC/Server Application

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 8 2: EPICS Control System Architecture

New EPICS 7 Logo

Client Application

IOC/Server Application Network Protocol

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 9 2: EPICS Control System Architecture

■ Loose coupling between distributed systems ■ Servers provide Clients access to named Process Variables (PVs) ● Each PV holds specific data (scalar or array) associated with the machine □ Status, read-back, set-point, parameter etc. ● Clients only need to know a PV’s name to access it ■ Example PV names and values from the APS Accelerator S35DCCT:currentCC 100.1.96 mA SRlifeTimeM 589.854 minutes ■ As well as a value, a PV has other attributes, e.g. ● Engineering units string ● Timestamp ● Alarm status and severity ● Operating range (Low .. High) ● Control limits (Low .. High)

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 10 3: EPICS Software Toolkit Client Programs CS-Studio Phoebus BOY BEAST MEDM EDM caQtDM epicsQt pyDM Python Perl Matlab Archiver Appliance CaPutLog

Network Protocols Channel Access pvAccess IOC IOC CAS IOC IOC Software qsrv IOC PV Database State Programs StreamDevice asynDriver synapps areaDetector mca Network Commercial Custom Chassis motor sscan caputRecorder Attached Instruments PLC softGlue modbus autosave Devices Technical Equipment Server Applications CA Gateway pvaPy pcaspy FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 11 3: EPICS Software Toolkit

■ ‘Installing EPICS’ does not create a control system ■ The EPICS Software Toolkit consists of hundreds of pieces of software ● Some are individual programs for performing specific tasks □ Creating and running Graphical User-Interfaces, archiving data, monitoring alarms etc. ● Others are code libraries that communicate with specific kinds of hardware □ IOC device and driver support for COTS equipment (PLCs, oscilloscopes etc.) ● Others allow common programming languages and tools to interface with EPICS □ /C++, Perl, Python, Java, Matlab/Octave, C#, LabView etc. ● Almost all EPICS code is Open Source (freely usable & modifiable) □ The EPICS Open License is BSD-like; the GNU GPL and LGPL are also used ■ An EPICS control system can be made by choosing and configuring existing software ● Writing code is often only necessary to fill gaps in the available tools

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 12 History

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 13 FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 14 From Star Wars to EPICS?

■ The Accelerator Automation Application Toolkit Workshop was held at LANL in 1988 ● Brought together accelerator controls people from around the world (pre-ICALEPCS) ● LANL was building the Ground Test Accelerator [GTA], wanted advice ● GTA was part of Ronald Reagan’s Strategic Defense Initiative (Star Wars) ■ This workshop set development direction for the LANL controls group ● GTA Control System [GTACS] subsequently developed by Bob Dalesio, Jeff Hill et al. ■ In 1989 ANL started work on the control system for the Advanced Photon Source ● Marty Kraimer was sent to work at LANL with the GTACS team for 6 weeks that summer ● A formal collaboration was agreed in December when both Controls groups met at ANL, organized by Mike Thuot (LANL) and Marty Knott (APS) ■ Development continued afterwards on improved portability and extensibility ● The software was renamed EPICS and presented at ICALEPCS-’91 ■ LBL (Steve Lewis), SSC (Dave Gurd) and CEBAF (Chip Watson) joined in 1992 ■ Commercial licenses were negotiated with 3 companies to sell EPICS 3.8 ● Enhanced versions were sold for process control by Tate & Kinetic Systems ■ Licenses for collaborators were free, on signing a legal agreement with LANL

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 15 Growth and Open Source

■ The first EPICS website came online in August 1993 ● APS was a very early adopter of HTML and the WWW

■ Code development continued, adding features, robustness and portability ● Binary database files were replaced by ASCII in R3.11 ● New hardware support continued to be added ● EPICS community continued growing as new sites joined

■ With EPICS R3.14 in 2002 the IOC (server) was no longer limited to VxWorks ● Marty Kraimer, Jeff Hill & Janet Anderson made it portable ● Support for RTEMS was added by Eric Norum at SAL (now CLS)

■ In February 2004 EPICS was released under the EPICS Open License ● Open Source license, approved by DOE (not an OSI license, but BSD-like) ● Core software is freely redistributable, may be used by anyone for anything

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 16 EPICS Version 4

■ Many people offered visions of ‘EPICS 2010’ at a series of meetings in 2003-2004 ● Included representatives from many ICALEPCS labs, not all EPICS users ● Looked at what worked, what was missing, scope, modularity, I/O requirements etc. ● Resulted in many interest groups, but no new resources for development ■ Marty Kraimer left Argonne in February 2006 — “not retiring” ● He wanted to implement his vision for EPICS, but couldn’t while working at APS ● His JavaIOC was working by 2007, but had no network support □ Somewhat similar to the V3 IOC but written in Java, with support for structured data (pvData) ● DESY funded Matej Sekoranja (CosyLab) to write the pvAccess network layer ■ Bob Dalesio’s vision of EPICS in 2005 had included middleware services ● Clients to the IOC layer, but servers to the upper client layer (e.g. ‘Orbit’) ● Bob funded Marty and Matej in 2009 to implement pvData and pvAccess in C++ ■ The EPICS V4 Working Group was founded in 2011 with a formal charter ● A “collaborative effort … to bring EPICS V4 to its full potential.” ● Core software, server and client APIs, platform support and documentation ● Members from Argonne, BNL, Diamond, ESS, FRIB, ITER, ORNL, SLAC

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 17 EPICS 7 = EPICS Base V3 + EPICS V4

■ The EPICS community asked for a combined package to be produced ● EPICS V4 C++ releases were compatible with 3.14, 3.15 and 3.16 series ● Java releases now developed separately by a different team; network compatible ■ EPICS 7 C++ version comprises several modules: ● libCom, CA client and IOC database from Base 3.16 (pcas unbundled) ● pvData defines and introspects any kind of structured data ● pvAccess efficiently transports pvData over an IPv4 or IPv6 network □ Retains CA’s high performance and publish/subscribe nature □ Adds capabilities for remote procedure calls (command/response) ● normativeTypes defines type standards for structured data types to meet common needs □ e.g. Scalar, Array, Matrix, NameValue, Table, MultiChannel, NDArray, Histogram ● pvaClient provides a simple synchronous wrapper for pvAccess ● pvaSrv makes any V3 IOC into a pvAccess server ● pvaPy provides a Python API, can efficiently read & write pvData from/to NumPy

■ Phoebus and recent CS-Studio versions support the pvAccess protocol as well as CA ■ Mark Rivers’ areaDetector software can use pvAccess to transport image data

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 18 The EPICS Community

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 19 Collaboration without a model

■ Like its architecture, the EPICS collaboration is loosely coupled

EPICS consists of many individuals, working diligently to support our community. Our primary reward is the comradery of our peers, and an awareness of the science that benefits from our efforts.

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 20 Community Organization

■ Main organizational resource is the tech-talk mailing list – Well used, several messages every day – Questions, requests, jobs etc. ■ Technical leadership is fairly informal, "C++ Core Developers group" – Co-chairs Andrew Johnson (APS at ANL) and Steven Hartman (SNS at ORNL) – Video Conferences every 2-3 weeks, 3-4 face-to-face meetings each year – Core-talk mailing list for technical discussions, bug reports – Accept and approve code changes for bug fixes or new features ■ Additional development groups exist and have their own leadership – EPICS 7 Java and Control System Studio (Kunal Shroff NSLS-2 at BNL) – AreaDetector (Mark Rivers, Uchicago) ■ EPICS Council meets (monthly?) via Video Conference – Members have management responsibility for staff, contribute ≥1 FTE to EPICS

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 21 Mailing Lists ■ 2 public mailing lists ● tech-talk is the main user list Mailing List Messages ● core-talk is for core developers 6000 ● pvdata-devel was used for V4

development, now dormant pvdata-devel ■ Open to anyone to join 5000 core-talk tech-talk ● tech-talk has 900 subscribers ■ Questions asked at all levels 4000 ● Members are usually very

helpful 3000 ■ Posts from non-members are moderated to discourage spam 2000 ● High signal/noise ratio ■ GNU Mailman handles all subscriptions, moderation, daily 1000 digest ■ Searchable archives back to 1994 0 8 0 2 4 0 6 8 4 6 6 8 2 4 9 9 9 0 0 0 0 1 1 1 1 1 0 9 0 0 0 0 0 9 9 0 0 0 0 0 ■ RSS Feeds of messages 1 1 1 2 2 2 2 2 2 2 2 2 2

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 22 EPICS Websites

■ Original APS website now at https://epics.anl.gov/epics/ – Maintained by Andrew Johnson – Created in 2000 to provide a central directory of EPICS content ● Many links to other sites under Extensions, Modules, and Distributions ● Some of this content out of date

■ New website https://epics-controls.org/ – Maintained by the community, content taken from APS site and Wiki – Contact Ralph Lange and Timo Korhonen – Hosted by the Fritz Haber Institute (Berlin) using WordPress – Accounts available for contributors, but not needed to read ● Please only sign up if you want to work on site content

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 23 Collaboration Meetings 2018-2019

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 24 Version Control & Continuous Integration

■ Early EPICS Base used SCCS for version control ■ Code was imported into CVS in October 1990; all SCCS commit history was lost ■ CVS history was converted to Bazaar in December 2009 ■ Bazaar history was converted to Git in September 2017 ■ Launchpad.net used for branch hosting, code-reviews & bug-tracking ■ A mirror of the release branches is also available from GitHub – We accept code contributions through either GitHub or Launchpad ■ The EPICS V4 modules started out using Mercurial on SourceForge – Converted to Git on GitHub in June 2015 ■ Several CI servers used to test newly committed code – Jenkins-CI at APS, checks -x86 and Linux-ARM, Windows, Darwin, VxWorks, RTEMS, – Travis-CI checks Linux-x86-64 with GCC and clang versions, Darwin – Appveyor checks Windows with many versions of MSVC++, MinGW – Just added Codacy for C++ static code analysis

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 25 Questions?

FNAL PI Workshop • Andrew Johnson • 2020-02-18 • EPICS Introduction and History 27