SLAC ESD Software Engineering Group

Stanford Linear Accelerator Center

AIDA

SLAC Detailed

SLAC Computing


Software Home

AIDA EPICS CA Data Provider Guide

Software Detailed

AIDA


This page provides documentation for users and programmers of AIDA's EPICS Channel Access Data Provider (dpCa).

See Also: Basic Users Guide to Aida, README.txt of DpCa, JCA Home Page


Users Guide

This section describes what an AIDA user should know about accessing EPICS Channel Access data through AIDA. For general information on using Aida, see Basic Users Guide to Aida, and the Aida javadoc, in particular the classes DaObject and DaReference (and DaReference's parent _DaReference) in aida.lib.da which form Aida's programming interface. One can also use Matlab.

Table 1: Summary of AIDA Data Provider for EPICS CA Data

SUMMARY

Acquires the VAL channel value of the named Process Variable.

Status and limitations

Basically complete. Only record names which appear in some template file are known to Aida's Directory, and only those can be acquired. For instance, only those SLC Analogs and Digitals which CA can acquire, that have been specifically added to an EPICS template file, or added directly to Aida's Directory db, are known to Aida.

Plan

Add some mechanism to teach Aida's Directory database the names of EPICS channels not in an EPICS template file.


EXAMPLES

Schematic

Simple Java example:
Float v = (Float)da.get("HR81:STN:VOLT//VAL", DaValue.Type.FLOAT);

Java

$CD_SOFT/ref/package/aida/test/java/DpCaTests.java

Matlab

Channel Access magnet control example matlab session


INSTANCES

Types

Description

VAL of EPICS Channel

Syntax

<PVname>//VAL

Example

HR81:STN:VOLT//VAL

Instance Attributes

Attribute

Description

VAL

The VAL field of the given Process Variable (pv)

Methods

Method Name*

Returns

setDaValue (pv, DaValue)

No return value. Sets pv to the specified value.

getDaValue(pv)

Returns time, status, severity, VAL as native type

get(pv,DaValue.Types.FLOAT)

VAL as a float value

get(pv,DaValue.Types.DOUBLE)

VAL as a double value

get(pv,DaValue.Types.BYTE)

VAL as a byte value

get(pv,DaValue.Types.SHORT)

VAL as a short value

get(pv,DaValue.Types.INT)

VAL as an integer value

get(pv,DaValue.Types.LONG)

VAL as a long value

get(pv,DaValue.Types.BOOLEAN)

VAL as a boolean value

get(pv,DaValue.Types.CHAR)

VAL as a character value

get(pv,DaValue.Types.STRING)

VAL as a string value

geta(pv,DaValue.Types.FLOATA)

VAL as an array of float values

geta(pv,DaValue.Types.DOUBLEA)

VAL as an array of double values

geta(pv,DaValue.Types.BYTEA)

VAL as an array of byte values

geta(pv,DaValue.Types.SHORTA)

VAL as an array of short values

geta(pv,DaValue.Types.INTA)

VAL as an array of integer values

geta(pv,DaValue.Types.LONGA)

VAL as an array of long values

geta(pv,DaValue.Types.BOOLEANA)

VAL as an array of boolean values

geta(pv,DaValue.Types.CHARA)

VAL as an array of character values

Arguments

Name

Req/Opt

Choices

Meanings

DATEFORMAT

Opt

DATEFORM0 (default)

"dd-mmm-yyyy hh:mm:ss"

MMDDYYYY

"mm/dd/yyyy hh:mm:ss"

MMDDYYYY_FRAC

"mm/dd/yyyy hh:mm:ss.ff"

EPICS

EPICS timestamp: number of seconds since 0:00 January 1, 1990.

* See DaObject and DaReference (and DaReference's parent _DaReference) in aida.lib.da for full API and method signatures.


Programmers Guide

This section provides help for programmers of the Aida Channel Access Data Provider (dpCa). dpCa is implemented in Java in package edu.stanford.slac.aida.dp.dpCa. EPICS Channel Access is done through "Java Channel Access" (JCA), presently configured to use THREAD_SAFE "context" (not to use Channel Access for Java). See also the dpCa README.txt file with the source code.

Aida Network Access

Aida PROD network connects to 1 DpCa, which is on mccas0, started by:

aidamanager $AIDA_CA_NAME restart PEPII

Aida DEV network connects to 1 DpCa, which is on slcs2, started by:

aidamanager $AIDA_CA_NAME restart DEV

Aida clients connected to the Aida PROD network (AIDA_MODE = PROD), which is the Matlab setup default (see java.opts), will get "production" CA data, that is, from MCC, gtw00 (for PEPII), and slcs2 (for BaBar). AIDA clients connected to the Aida DEV network, will get unableToGetDataException for SLC db PVs, since the one ~cddev/.JCALibrary.JCALibrary.properties file is shared by both mccas0's and slcs2's JCA API.


Troubleshooting

If dpCa fails to start because of failure to contact the NameServer (with message unable to dispatch - servant or POA not found), restart the NameServer and DaServer.

Note that SLC Analog and Digital channel names have not been added to AIDA NameServer db, so although dpCa can acquire them, AIDA's NameServer doesn't know about them.

If a problem occurs while trying to start DpCaLclsServer (prod) or DpCaServer (pepii) on mccas0, logon to mccas0 as cddev and kill all caRepeater processes. Then start DpCaLclsServer and DpCaServer again using aidamanager.

A possible cause of not being able to get values from an Aida Channel Access server for a group of PVs is that the gateway serving these PVs is not granting access to the machine on which the Aida Channel Access server runs. For instance, one problem was that the AIDAPROD Aida non-LCLS Channel Access server running on mccas0 was not able to obtain data from IP address 134.79.51.43 (opi00gtw04). The CMLOG log message resulting from an attempt to get a value using this server for PV TRS1:AS2:LOST:PAVE (provided by the opi00gtw04 server) was: "dpCa 2 Get failed - caused by gov.aps.jca.jni.JNIException".

It could be seen that a "caget TRS1:AS2:LOST:PAVE" failed from mccas0 even when the IP address 134.79.51.43 was supplied for EPICS_CA_ADDR_LIST. The solution was to have Judy Rock change gwILC.acf for gateway opi00gtw04 to add mccas0 to the list of machines it serves and then restart gateway opi00gtw04.


Status and Future

This section describes the present status of the DpCa Data Provider, and ideas for future enhancements

Status

Future


Aida Directory Service for EPICS support

At the time of writing, the Aida EPICS Service has AIDA_SERVICE.ID number 6 in the Aida directory service databases. See the Aida Directory document (Word), and the directory service schema.

Example EPICS PVs acquirable through Aida:

HR81:STN:VOLT//VAL - a single float value, from PEPII.
LI28:CSTR:1:STAT//VAL - a single LONG int, from MCC
LI28:CSTR:1:CRV3//VAL - an array of FLOAT, from MCC
PR00:ASTS:CH117//VAL - a single FLOAT, from MCC

Aida Names Update

The Oracle EPICS PV database (SLACPROD/pvudb) is updated nightly by a process initiated on VMS! Aida's names databases (SLACPROD/aidadev and aidaprod) are updated with the changes at the end of that process.

Update call sequence (filenames are their source code locations).

On VMS: SLCCOM:create_pv.com, uses cmdsrv to call...
-> On Unix: $CD_SOFT/ref/app/pvudb_load/load_pvs
--> $CD_SOFT/ref/app/pvudb_load/pvlist_to_pvudb
---> $CD_SOFT/ref/app/pvudb_load/pvlist_to_pvudb.sql
----> $CD_SOFT/ref/app/pvudb_load/load_rec_types.sql
----> $CD_SOFT/ref/app/pvudb_load/load_pvu_recs.pl
--> $CD_SOFT/ref/package/aida/common/script/aidaCaNames_update aidadev
---> aida_caService_namesUpdate.sql
--> $CD_SOFT/ref/package/aida/common/script/aidaCaNames_update aidaprod
---> aida_caService_namesUpdate.sql

[SLAC ESD Software Engineering Group][ SLAC Home Page]

Author:  Greg White 14-mar-2005
Modified by: Greg White 17-Mar-2005, Put in real method names.
Modified by: Bob Hall 12-Apr-2010, Added troubleshooting information.