Last modified: Wed Apr 24 17:37:19 CEST 2013
EPICS Version 4
HOME DEVELOPMENT DOWNLOAD DOCUMENTATION FEATURES WORKING GROUP SOURCEFORGE PROJECT FAQ

This is the homepage of EPICS Version 4, a software toolkit for writing the control system and online scientific services of large experimental facilities.

EPICS is a set of Open Source software tools, libraries and applications developed collaboratively and used worldwide to create distributed soft real-time control systems for scientific instruments such as a particle accelerators, telescopes and other large scientific experiments.

What is EPICS Version 4?

EPICS Version 4 (V4) brings support for managed distributed data acquisition, service oriented architecture, and complex data structures to EPICS. In an EPICS installation it is expected that control and module support would be done with EPICS V3 IOCs, while middle layer and SOA operations would be done with EPICS V4. V4 includes support for protocol interoperability with V3. In short, EPICS V4 includes EPICS V3.

EPICS V4 is composed of a number of core standards and APIs, reference implementations of those standards in C++ and Java, plus associated other components and tools. The intention is for the standards and APIs to go through a public review process, leading to published protocols and APIs that may be independently implemented.

The work adds support for "structured" data to EPICS records. That is, a PV's value need no longer be a simple type or a waveform, but potentially an arbitrarily complex structure. A "Remote Procedure Call" like processing pattern has been added, which supports passing arguments within the context of asynchronous record processing. In this way services may be defined. A new IOC design supports the protocol and new record architecture for high efficiency services and controls.

The EPICS V4 Working Group is a collaborative effort to define, publish, and provide reference implementations for, the EPICS V4 standards. The group is chartered to provide open protocols and standards for both controls and services interconnection through a public process.

EPICS Version 4 Components in a Nutshell

In EPICS V3 and before, an IOC (Input/Output Controller) is a network node that controls and/or monitors a collection of devices. An IOC contains a memory resident real time database. The real time database has a set of "smart" records, which are interconnected in a Data Flow pattern.

In EPICS V4, pvIOC is the implementation of an EPICS IOC. A pvIOC is similar to an EPICS Version 3 IOC (at least the 3.13 and 3.14 releases of EPICS base) but extends the data types to support structured data. These data objects, simple or structured, are defined through the pvData interface. So, records are processed by pvIOC, the PV data I/O is described through pvData, and the client - IOC interconnect is through a new protocol for structured data, pvAccess. APIs exist also for synchronous or asynchronous services for accessing a set of V3 IOCs and/or pvIOCs. Facilities for managing coordinated collections of acquisitions will be the focus of work in early 2012.

Overview of EPICS version 3 and EPICS version 4 provides a brief overview of EPICS version 3 and EPICS version 4 and interoperability between them. The core part of each is discussed. For version 3 the components that come with EPICS base are discussed. For version 4 pvData, pvAccess, and pvIOC are discussed.

There are also "extensions" of EPICS V4 being developed, see Tools, Accessories and other Associated Work below

V3/V4 Interoperation

Version 3 of EPICS uses a communications protocol named "Channel Access". Version 4 uses a new protocol called "pvAccess". Interoperability between the two protocols, their APIs, and record processing, is provided by the Version 4 module called CAV3. This module can be used server or client side.

For the use case class of V3 clients calling V4 IOCs, CAV3 used server side in a V4 IOC allows a V3 Channel Access client access to data classes that are possible under channel access (ie simple type and waveform only).

For the use case class of V4 clients using V3 IOC channels, pvAccess provides two mechanisms. Firstly, pvAccess user agents can be configured to use unmodified Version 3 IOCs through the "CAV3" provider of pvAccess in which case Channel Access is the wire protocol, called through the pvAccess API (however, this is new and has not yet been documented). Secondly, pvAccess user agents may configured to use modified V3 IOCs where the pvAccess wire protocol connects to a pvAccess server residing on a V3 IOC. The pvAccess server support (the second option above) is part of pvaSrv, see in particular the description of V3Channel, which is the embedded V3 IOC support that provides access to V3 record data for pvAccess network clients.

Interoperation of EPICS Versions 3 and 4 communications protocols, "Channel Access" and "pvAccess" respectively, is provided by the CAV3 and pvaSrv modules of V4.
EPICS V3/V4 interoperation diagram

A full description and EPICS V4 users guide to V3/V4 interoperability, is being prepared (see Charter deliverable 10). In the meantime, see the talk V3/V4 Interoperability, Marty Kraimer, EPICS Collaboration 2012 spring meeting, (SLAC), PPT.

Performance

Very preliminary performance graphs for pvAccess floating point acquisitions are given below, together with comparable Channel Access acquisition. The setup is C++ clients and servers, of the Beta 1.0.1 release (as on the downloads page), 2 MacBook Pros (~2GHz Intel Core Duo-s, 4GB memory) with a 1 GBit Ethernet point-to-point connection. The acquisition is a GET operation, on a double array value (DBR_DOUBLE and pvAccess equivalent), varying in both cases the value array size. Note that in addition to raw network encoding and deserializing performance, in a real world implementation pvAccess could achieve much higher apparent performance since it additionally has the capability to transfer only actually changed structure field values.

pvAccess and Channel Access comparative performance (Number of channel value get operations per second), where only one channel's value is got in each get operation, as a function of array size of the channel. The graph shows that roughly speaking, pvAccess does better than Channel Access with increasing channel value array size.
EPICS V4 pvAccess performance diagram
pvAccess and Channel Access comparative performance (Number of channel value get operations per second), where 1000 channels values' are got in each get operation, as a function of array size of the channel. The graph shows that roughly speaking, Channel Access does better than pvAccess with small messages, whereas pvAccess does better than CA for large array sizes.
EPICS V3/V4 interoperation diagram

Summary Status

This section is a very short summary of the status of EPICS V4 overall, and gives help on how an interested engineer might want to use it now.

Last updated Oct-2012:

EPICS V4 has been in beta since December 2011. The core standards of EPICS V4, and their implementations, are complete with respect to the January 2012 charter milestones.

The beta 1 is useable for testing the technology for distributed high level data services.

Beta 2 is now being developed and will be released shortly. Beta 2 improves the data model for describing complex data, improves the IOC side framework for interfacing V4 systems to EPICS V3 records, provides command line get, set and monitor commands, and a greatly simplified framework for high performance Remote Procedure Call (RPC) style servers.

Initial production level services based on EPICS V4 have been deployed at BNL, PSI, and Diamond. A summary of the installation architecture used by PSI for EPICS V4 based services implemented in Java, has been published as a pattern for new adopters.

Recent work added unsigned integer support, improving programmer ease of use, and the pvAccess and Normative Type specifications. The specification of pvAccess has just been expert reviewed and is now being published at Second Public Working Draft. The definitions of the interoperable data types, "Normative Types" is approaching First Public Working Draft.

In acute summary, support for managed distributed data acquisition is quite far along and can be used now. This includes acquisition from EPICS V3 PVs via EPICS V4 tools or components. The basis for services and "RPC in EPICS" is complete, and there are example services in Java and C++. Largely documentation is up to date with respect to implemented code.

The primary area in which EPICS V4 is not yet ready for use is that part which is the core value of the EPICS V3 IOC, record processing for controls. This is because we are adding to EPICS first, then will re-implement the exiting excellent functionality in EPICS version 3. See below for a complete breakdown.

The next year will concentrate on V3 - V4 interoperability and interface, and work to support high performance V3 IOC data acquisition through V4 services, such as accessing NDArray data through a V4 Normative Type and sequential monitors. Additionally, the V4 IOC will be designed. The charter to cover work over the next year is now being developed. Comments on what should be included are welcome.

Summary Usage Contexts of EPICS V4 Given Present Status

This section outlines how one might use EPICS V4 right now, given its present status

EPICS V4 includes EPICS V3. It is expected that, for a significant period of time, an institutional user of EPICS Version 4 would use it in parallel with the EPICS version 3 distribution. In particular, EPICS Version 3 would continue to be the basis of controls. In its present state, EPICS Version 4 concentrates on so called "high level" software services. It provides a platform for fast Service Oriented Architecture and distributed message passing. Its programming model is optimized for efficient distributed synchronous or asynchronous processes communicating by essential a shared-memory system based on data introspection.

In a hybrid environment, EPICS V4 is at BETA for use for managed distributed data acquisitions. See the Gather service framework. This is a server side software framework that uses the new facilities of EPICS V4 to help a user define, save, and execute, a named coordinated acquisition of many V3 PVs. The Gather service framework is alpha stage software; it's complete, but not yet field tested. Contact Marty Kramer or Guobao Shen at BNL. See also pvManager, which is a client side tool for making acquisitions of a large number of PVs efficiently. pvManager is mature enough for use now, contact Gabriele Carassi at BNL. Also

Although record processing is presently part of EPICS V4, it is not mature enough to supplant EPICS V3 record processing and device support for controls. This is expected to be undertaken in the next year. Contact Bob Dalesio (BNL), Marty Kramer (BNL) or Matej Sekornaja (COSYLAB) for more details and estimates. However, note that EPICS V4 clients can interface to EPICS V3 IOC record processing via pvAccess through use of the pvAccess Server (PAS). See worked example in Getting Started with EPICS V4.

Present Deployments

EPICS V4 is also being used now developing beamline image data acquisition and storage, using the facilities of pvData for structured data. Contact Dave Hickin at DIAMOND. It will shortly also be deployed at PSI for back end SQL database access.

Software Specifications and Implementations

EPICS V4 is a body of core specifications, reference implementations, and some associated tools. The core specifications, we call "normative". The normative specifications will be open, collaboratively defined, and may be implemented and extended by any interested party. We provide reference implementations for adopters of EPICS V4, and to test the specifications' performance and effectiveness. Associated other documents are "non-normative" and no guarantees will be made about them.

Normative Implementations

This lists the "core" modules of EPICS V4, where to see the source code, reference documentation, and programmers documentation (Javadoc and DOxygen).

pvData
pvData defines how the data of an EPICS V4 record database, are typed, interfaced and exchanged. The types may be complex, and care is taken in memory management and interfacing to make data I/O from memory as high performance as possible. In EPICS V4, a pvIOC implements a memory resident database defined in terms of pvData. pvData describes both an API for creating and updating pvData objects in the IOC database, and also for accessing meta-data descriptions of the structure of the data so stored, the so called "introspection interface." The introspection interface is the key element that enables high speed communications of the values of such structured data over pvAccess. Complete implementations are available for both Java and for C++.
Specification: The pvData interface has not yet been specified independently of its implementations, though that is an expected deliverable of the EPICS V4 Working Group
Implementations:
pvAccess
The description of network support for pvData. A complete implementation is available for both Java and for C++, although documentation has not been written for the C++ implementation.
Specification: pvAccess Protocol Specification. Status is Second Public Working Draft
Implementations:
pvIOC
The description of an IOC (Input Output Controller) that supports pvData. The Java version has lots of functionality. The C++ version is in the early stages of development.
Specification: pvIOC has not yet been specified independently of its implementations, though that is an expected deliverable of the EPICS V4 Working Group
Implementations:

Extensions, Tools, and Associated Activities

A number of software projects are associated with EPICS V4. Some of the above are in scope of the EPICS Version 4 working group specifically, and others not. Those in scope are being managed as part of the deliverables of the group, though they are not considered normative, and should not be considered all at the same level of release as the normative specifications (Beta at the time of writing).

pvManager
PVManager is a client side utility library, that helps to manage complex objects' retrieval and scanning. It allows client programs of EPICS V4 or EPICS V3, to decouple the rate of events on the network from the rate of refresh needed by the user interface itself. It provides a clean, simple, well designed high level programming interface for the problem of multi-threaded GUI acquisition and screen update of many EPICS record data, for instance, a table of Beam Position Monitor (BPM) data of many BPMs.
Homepage: http://pvmanager.sourceforge.net/
Literature: User guide. Reference documentation (javadoc).See also literature below
Status: 1.0 released on 22 Sept 2011. Production/Stable. Bundled in CSS Core as of 3.0.0 (31 May 2011). Used in some CSS applications and BOY Widgets (Waterfall, PVTable by Property, PVManager probe, ...).
Contact: Ralph Lange (HZB), Gabriele Carcassi (BNL).
Channel- Finder
ChannelFinder is a toolkit for building directory services suitable for EPICS channel metadata.
Homepage: http://sourceforge.net/projects/channelfinder
Literature: Home page of Web Service component, includes Design and service data update API descriptions. Client side java API.
Status: Usable beta
Contact: Gabriele Carcassi (BNL), Ralph Lange (HZB), Kunal Shroff (BNL)
python interfaces
Python wrappers for pvData, pvAccess and pvService are being worked on.
Status: Early beta
Contact: Guobao Shen (BNL)
pvService
pvService presently includes early stage development for an online accelerator model service, and a framework for managing data acquisitions from many devices server side (the Gather service framework).
Implementations:
  • Java reference implementation: pvServiceJava. Status: The Gather service framework is early beta. Services themselves are alpha. pvServiceJava Documentation
  • C++ reference implementation: pvServiceCPP. Status: Includes the C++ support for the "gather framework" early beta. Model service is alpha. pvServiceCPP Documentation. pvServicePy.html
Status: Alpha
Contact: Guobao Shen (BNL)

Software Development

See the EPICS V4 Development page for complete references to code and documentation. in particular, see Getting Started with EPICS V4 for how to acquire and use EPICS V4. It includes help on Java and C++ development, and references to examples, including interfacing to EPICS V3 data.

EPICS version 4 Beta 2 is available now from the SourceForge download site, as Java Jar files and a tar zip for C++.

All of the normative projects above are each in distinct mercurial repositories in the SourceForge project epics-pvdata. There are separate Mercurial repos for each of the C++ and Java implementations of each normative project. They can all be checked out via the unix shell command hg, or using a Mercurial client suitable for your platform.

Download from the Mercurial repositories can be done anonymously, or using a sourceForge account, see Getting Started with EPICS V4.

Initial examples to check out:

  1. HelloWorld. A very simple service. Both Java and C++ versions exist. For Java see the Server side HelloService.java, the client side HelloClient.java, and its HELLOWORLD_README.txt
    For C++ see the Server side HelloServiceMain.cpp, HelloService.h and HelloService.cpp, the client side HelloClient.cpp, and its HELLOWORLD_README.txt
  2. RDB service demonstrates returning structured data in EPICS V4 (Java). See the server side RdbService.java, the client side RdbClient.java, and its RDBSERVICE_README.txt
  3. Channel archiver service demonstrates returning structured data in EPICS V4 (C++). See CHANNEL_ARCHIVER_SERVICE__README.txt

Java

Java development help is given for Eclipse, or Maven. Help for both are given in Getting Started with EPICS V4. The relevant Mercurial modules are: pvDataJava, pvAccessJava, pvIOCJava, exampleJava.

C++ and Python

The C++ and Python code also uses the mercurial repository. The EPICS V3 build system is used rather than Eclipse. V3 libCom is used for threading and other support. Thus it requires that you have a recent release of EPICS base. These are the relevant sourceforge mercurial modules: pvDataCPP, pvAccessCPP, pvIOCCPP, pvaSrv, pvServiceCPP, exampleCPP. See Getting Started with EPICS V4


Greg White, SLAC/PSI greg at slac.stanford.edu, for EPICS V4 Working Group