EPICS exampleCPP

Release 4.4.0-SNAPSHOT - 2017.07.12


This project provides a set of examples of client and server code for pvAccess. It also has a test that is run via:

make runtests

This release of exampleCPP is one of the components of EPICS V4 Release 4.6.

For more information about EPICS generally, please refer to the home page of the Experimental Physics and Industrial Control System.

Table of Contents


This project provides a set of examples of client and server code for pvAccess. Each example can be built separately by building in the example subdirectory. The complete set of examples, except for ChannelArchiverService can also be built by building in exampleCPP itself.

The main purpose of these examples is to understand and create new code for EPICS V4. This document assumes that the reader also looks at the source code for the examples. The reader should also be familiar with developerGuide

Each example is a template

Each example can be used as a template for building other applications:

Building via exampleCPP

This works if a proper RELEASE.local is present one directory level above exampleCPP.

Just type:


An example of a proper RELEASE.local is:



Building an individual example

If a proper RELEASE.local is present one directory level above exampleCPP then in the example directory just type:


Each example has a README.md file. See it for how to build the example if a proper RELEASE.local does not exist or if the example has special requirements.

exampleCPP and exampleJava

Each example that appears in both exampleJava and exampleCPP are compatible, i. e. a client from one can communicate with a server from the other.

Brief summary of examples and links to documentation


Provides an EPICS IOC that has both EPICS V3 DBRecords, V4 PVRecords, and pvaSrv for accessing the DBRecords.

It can also create a standalone main that has a set of V4 PVRecords.



Provides a set of examples that use pvaClientCPP.


In order to run the examples, database must also be built and then the IOC database must be started as follows:

mrk> pwd
mrk> ../../bin/$EPICS_HOST_ARCH/exampleDatabase st.cmd


Implements a PVRecord that is an example of a PVRecord intended to ba accessed via channelPutGet. It is a simple HelloWorld example.



This implements HelloWorld that is accessed via channelRPC.



An example of a pvDatabase PVRecord which also supports multiple RPC services.

It illustrates synchronous and asynchronous RPC services, selecting services based on the supplied pvRequest and using EPICS V4 to talk to an existing object which has no knowledge of EPICS and call its methods, so creating distributed objects.

It represents a device which has a 2D position setpoint and readback as well as a state. Each field has a time stamp, as does the record itself. The device can be controlled through a client using RPC commands to move through a sequence of points as well as conventionally by putting to the setpoint. Commands are: configuring the set of points, starting a scan (blocking or non-blocking), pausing and resuming, rewinding and stopping/aborting.

A client ("control") for calling the services is supplied.



This implements a server that has records exampleGetLink, exampleMonitorLink, and examplePutLink. Each has a link to another record (default name is doubleArray). The other record can be in the same server or in another server including a V3 IOC DBRecord.

The example records can use provider local, pva, dbPv, or ca to connect to doubleArray.

exampleLink can be stated as a main program or as part of a V3 IOC.



This is an example of creating a PVRecord that uses a somewhat complicated top level PVStructure. It simulates a power supply.

The example also has an example pvaClient for accessing the PVRecord.



This is an example that shows performance for an array of longs.


arrayPerformanceMain implement a PVRecord that is a long array. It has a process method with code that causes the array to be updated at selectable rates and sizes.!

It also has pvaClient examples that can get, put, and monitor the long array record.


The ChannelArchiver Service is an EPICS V4 client and server which can be used to query the data archived by an EPICS Channel Archiver. It includes a bash script, gethist, which can parse a wide range of dates and times and process the corresponding data. However the service can be queried by any client issuing a pvAccess RPC request, such as eget. Requests and responses use EPICS V4 normative types. Requests are in the form of an NTURI normative type and the results are returned as an NTTable.



This is not an embeded top level but just a subdirectory of exampleCPP.

This is an example that tests pvDatabase and pvaClient. This example requires that database must also be built.

It is meant to be used to execute:

make runtests

The test starts the example database and then executes various client tests.