Detailed Procedure to Create EPICS Databases using GDCT

10JUL98

P. Sichta

Revision 1.2 21OCT98 P. Sichta Added Scan Phase section.

Revision 1.1 19SEP98 P. Sichta

Revision 1.0 10SEP98 P. Sichta

 

 

 

Table of Contents

  1. Introduction
  2. References
  3. Aliases, Environmental Variables, and Permissions
  4. Creating Databases
  5. Scan Phase
  6. Duplicate PV Names
  7. Hints & Bugs

=================================================================

 

1.0 Introduction

This procedure provides a detailed description of how the use the Graphical Database Configuration Tool (GDCT) to create and manage EPICS databases for NSTX. GDCT is one of several tools used in the EPICS community for working with databases.

2. 0 References

    1. NSTX-WBS6-AD, Application Development Environment for CI&C.
    2. NSTX-WBS6-CA, General Procedure to Create Applications for EPICS
    3. GDCT Users Manual, J. Kowalski, EPICS www at ANL/APS

 

3. 0 Aliases, Environmental Variables, Paths, and Permissions

Aliases used :

Environmental Variables : None

Paths : The Unix user’s search path must include : /epics/system/epics/epicsExtensions/bin/solaris

Permissions : Anyone can run GDCT but only Unix accounts in the group ‘staff’ will have write permission in the online directories.

 

4. 0 Creating EPICS Databases

GDCT can be started from any directory :

/nstx : gdbase

 

/nstx/epicapps/ceApp/Db/dbd/ceApp.dbd

 

 

 

4.0 Scan Phase

EPICS records which are on a periodic scan interval, such as "2 second" use a record field "PHAS", which is the phase field. Within a scan-period group, all records with PHAS=0 will process before those records with PHAS=1. This model continues up to PHAS=255. Note that the default standard EPICS scan phase is PHAS=0. It is the resposibility of the application developer to enter an appropriately higher value (to specify a lesser priority).

The following conventions apply :

    1. Nominal CAMAC scan phase priority convention :
      1. PHAS=10 for high priority CAMAC I/O, such as real-time clock control.
      2. PHAS=20 for medium priority records.
      3. PHAS=30 for low priority CAMAC I/O. This should be used in most cases.

On the IOC, function scanppl lists all records in each periodic scan group.

On the IOC, function dbgrep "pattern" lists record names which match the specified pattern.

 

5.0 Duplicate PV Names

In EPICS, Process Variable names (PV) must be unique across IOC’s on the same network. The IOC will not generate an error if it encounters a duplicate name, and the databases will not operate as designed.

The use of the system’s digraph in the PV name is used to help avoid name duplication. To check for duplicate records in all files in a single ‘Db’ directory :

/nstx/epicapps/xxApp/Db : pvCheck

Duplicate instances of identical PV names will be displayed.

 

The script behind the alias pvCheck is :

 

 

6.0 Bugs & Hints

  1. Using GDCT’s "duplicate" function can sometimes assign the new record name which contains "unusual" characters. Don’t save & quit GDCT when there are record (PV) names having these "unusual" characters. The ASCII storage of these names are very long and contain control characters which GDCT cannot handle when opening the file.
  2. Recovery :These unusual character sequences can be manually corrected using a text editor. All instances must be corrected identically in both the .db file and the GDCT graphics file.

  3. A database does not require GDCT. GDCT is only an aid to graphically represent records and links. Very simple and repetitive databases can be made/maintained using a text editor on the .db file.
  4. PHASE is one attribute of a record. It specifies the order in which the record will execute relative to other records in the same scan period. The range is 0 – 255, zero is the default and will execute first. PHASE has no meaning for records whose scan mode is passive.

For non-passive scanned hardware I/O use Scan Phase 10 for high priority items, 20 for medium priority, and 30 for low priority. Other phases may be used following these guidelines.