EPICS easyPVA

EPICS V4 Working Group, Working Draft, 02-Mar-2015

This version:
easyPVA.html
Latest version:
none
Previous version:
none
Editors:
Marty Kraimer, BNL
Matej Sekoranja, Cosylab

Abstract

EasyPVA (Easy PVAccess) is a software library that provides to an EPICS client programmer, a friendly client side programming interface to the data of an EPICS based control system. It is intended for such uses as rapid development of ad hoc programs by controls engineers, or to provide scientists a way to directly develop analytical applications.

Specifically, easyPVA provides an easy interface for pvAccess, which is the software support for high speed controls network communications used in EPICS version 4. PvAccess provides a callback based interface, which can be hard to use. EasyPVA provides an interface that does not require callbacks even for monitors.

EasyChannel provides many "convenience" methods to directly get and put scalar and scalarArray data types. Additional methods provide access to the full features of pvAccess.

EasyMultiChannel provides access to data from multiple channels as long as each channel has a top level field named value. EasyMultiChannel provides two ways to access data from multiple channels: The first is as an NTMultiChannel. The second is as a double array. The double array can be used if the value field of every channel is a numeric scalar. There is code for NTMultiChannel that helps with access to more complicated data types.

EasyPVA will become part of pvAccess when it is ready.

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

Status of this Document and of the EasyPVA Software

Under development

Table of Contents


Introduction

EasyPVA is a synchronous API for accessing PVData via PVAccess. It provides an interface to many of the features provided by pvData and pvAccess.

The EasyPVA API has the following features:

  1. Makes common requests easy to program
  2. Provides full access to the pvAccess API for more demanding applications
  3. Allows efficient client side programs.

This document briefly describes the CPP version of EasyPVA. Doxygen documentation is available at doxygenDoc

Initialization

A client obtains the interface to EasyPVA via the call:

EasyPVAPtr easyPVA = EasyPVAFactorys->create();

The client can call this an arbitrary number of times. On the first call the PVAccess client factory is started. When the last EasyPVA is destroyed the PVAccess client factory is stopped.

EasyPVA Overview

EasyPVA creates interfaces to one of the following:

EasyChannel
This creates an interface for accessing a single channel.
There are two methods for creating an EasyChannel, with the difference being that the second specifiers the name of the provider. The other assumes that the provider is "pva" (pvAccess).
EasyMultiChannel
This creates an interface for accessing a set of channels.
There are multiple methods for creating an EasyMultiChannel. The provider can be supplied or use a default of "pva". A union for the UnionArray for accessing the value fields of each channel can be provided or a default of variant union will be used.

EasyChannel Overview

This interface creates Easy support for each PVAccess::Channel create method:

EasyField
This gets the introspection interface from a channel. The implementation provides full access to the features of Channel::getField.
EasyProcess
This is used to process a channel. The implementation provides full access to the features of ChannelProcess.
EasyGet
This is used to get values from a channel. The implementation allows full access to all the features of ChannelGet. By default it asks for the fields value, alarm, and timeStamp. If the channel has a value field then EasyGet provides convenience methods for a scalar value and for an array value.
EasyPut
This is used to get the current value of a channel and to put values to a channel. The implementation allows full access to all the features of ChannelPut. By default it asks for the field value, alarm, and timeStamp. If the channel has a value field then EasyPut provides convenience methods for a scalar value and for an array value.
EasyRPC
This is an interface to ChannelRPC. The implementation allows full access to all the features of ChannelRPC.
EasyPutGet
This is an interface to ChannelPutGet. Details TBD.
EasyMonitor
This is an interface to Monitor. The implementation allows full access to all the features of pvAccess Monitor.
EasyArray
This is an interface to ChannelArray. Details TBD.
EasyProcess
This is an interface to ChannelProcess. Details TBD.

EasyMultiChannel Overview

This interface creates Easy support for accessing a set of channels. The only requirement of the channels is that each must have a top level field named value.

EasyMultiGet
This is used to get values from a a set of channels. The result can either be an NTMultiChannel structure or a double[] array. The createGet method determines the result type.
EasyMultiPut
This is used to get and put values from/to a set of channels. The data supplied can either be an NTMultiChannel structure or a double[] array. The createPut method determines the type.
EasyMonitor
This is used to monitor values from a set of channels. Each event can either be an NTMultiChannel structure or a double[] array. The createMonitor method determines the data type.

example source code

Example Database

The examples require that an example pvAccess server is runnimg. This distribution has a file exampleDatabaseEasyPVA.zip. When unzipped this is used to create an example IOC database. The database has the record used by the examples are tests that come with easyPVAJava. It uses pvDatabaseCPP to build the database.

After unzipping the file:

cd configure
cp ExampleRELEASE.local RELEASE.local
edit RELEASE.local
cd ..
make
cd iocBoot/exampleDatabase
../../bin/<arch:>/exampleDatabase st.cmd

Examples

These are examples in directory example/src. An example of how to run them is:

mrk> pwd
/home/hg/easyPVACPP/example
mrk> bin/linux-x86_64/exampleEasyGet 

See the source code for each example.