SLAC ESD Software Engineering Group |
||||||
AIDA |
||||||
|
||||||
AIDA EPICS CA Data Provider Guide |
||||||
|
||||||
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
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: |
||||
Java |
|||||
Matlab |
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 |
|
* See DaObject and DaReference (and DaReference's parent _DaReference) in aida.lib.da for full API and method signatures.
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 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.
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.
This section describes the present status of the DpCa Data Provider, and ideas for future enhancements
st.dpCaServer should be fixed so that ENVS.csh is run before the hostname is examined.
Presently SLC Analog and Digital names are not added to the Aida nameserver db so SLC Analog and Digitals can not be retrieved by Aida. However, dpCa can acquire them. See Future below.
At present dpCa does not use CAJ although much of the code and script setup is in preparation for its use. I couldn't make caj work, but at the time of writing I can't remember why.
If and when CAJ is used, the way it gets its channel access address list will have to be addressed. At present, there is a java Properties file in ~cddev/.JCAproperties, but since that single file would be used for all dpCa servers (since it is just a file with a well know name), it can't be used to differentiate address lists served by different dpCa Servers. So, we need to change the way dpCa gets its properties. It may be enough to create just two dpCa servers, one on "AFS" and one on "NFS", in which case ~cddev will be a physically different directory.
The AIDA names database should include more of the special names that the dpCa can acquire through the SLC Channel Access Server (SLCCAS), in particular SLC Analogs and Digitals. At present such names as the SLC Analogs and Digitals are not in the AIDA db because they do not appear explicitly in any EPICS db template file. Only db template files are presently used to generate the names, SLCCOM:create_pv (see below) apparently does not list them.
Add acquisition timeout - such as if you're on the wrong subnet.
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
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.