EPICS: generation of DBs and GUIs for HV

From CLONWiki
Revision as of 18:26, 13 February 2007 by Boiarino (talk | contribs)
Jump to navigation Jump to search

Following procedure generates *.db and *.adl/*.alh files for High Voltage applications.

 cd $APP/hvca/db/

Create *.dat file with following format:

 clonpc1:db> more caen.dat
 CAEN_1_00           02 1  1 01 01 03 00 -1200.0   1.5   1.3   121.5   486.0  2550.0 -2500.0
 CAEN_1_01           02 1  1 01 01 03 01 -1200.0   1.5   1.3   121.5   486.0  2550.0 -2500.0
 CAEN_1_02           02 1  1 01 01 03 02 -1200.0   1.5   1.3   121.5   486.0  2550.0 -2500.0
 CAEN_1_03           02 1  1 01 01 03 03 -1200.0   1.5   1.3   121.5   486.0  2550.0 -2500.0
 .....................................

Columns have following meaning (NEED CHECK !):

  1 - group name (channel name, will be used as part of EPICS channel access variable names)
  2 - group number
  3 - allow (?)
  4 - ioc number (BUG ??? that number goes to CAEN_02_02, following number ignored ???)
  5 - mainframe address (for Lecroy by jumpers, for CAEN by IP, test mainframes must be >100 ???)
  6 - slot/card number
  7 - submodule (?)
  8 - channel number
  9 - voltage (demand, V)
 10 - mvdz (measured voltage dead-zone, V)
 11 - mcdz (measuerd current dead-zone, uA?)
 12 - rump up speed, V/s
 13 - rump down speed, V/s
 14 - tc (trip current, uA?)
 15 - maximum voltage (max, V)

Second input file is *.grp, for example caen.grp:

 clonpc1:db> more caen.grp
 1  CAEN_7
 2  CAEN_3
 3  CAEN_7
 4  CAEN_8
 5  CAEN_10

First column is group number and second one is group name. It will be first two columns on medm screen.

Makefile must be manually adjusted for every new *.dat file. It is possible to combine several *.dat file in one - see inside Makefile.

To generate all necessary file type 'make <filename without extension>', for example if file name is 'caen.dat', type:

 make caen

Following output fill shows up:

 clonpc1:db> make caen
 ./dat2db.pl caen
 echo caen | /usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/bin/hv_adl
 Input name of hv data file (omit the extension '.dat') :  
 WORKING ON GROUP #1
    Initializing variables to default values.
    Creating file: caen_CAEN_7_1.adl
    Initializing variables to default values.
    Creating file: caen_CAEN_7_param_1.adl
    Initializing variables to default values.
    Creating file: caen.adl
 ./dat2req.pl caen
 chmod +x caen*.csh
 test -d ../medm/adl || mkdir ../medm/adl
 test -d ../req || mkdir ../req
 mv caen*.adl ../medm/adl
 mv caen*.snap ../req
 mv caen*.csh ../medm/adl
 mv caen*.alarms ../medm/adl
 test -d ../medm/alh || mkdir ../medm/alh
 mv caen*.alhConfig* ../medm/alh

Following files will be produced:

 caen_01.db
 ../medm/adl/caen.adl
 .................adl
 ../medm/alh/caen_CAEN_7.alhConfig
 ../medm/alh/caen_mf_01_01.alhConfig_mf

Now copy generated *.db files into final destination where it will be picked up by IOC startup script, for example:

 cp caen_01.db $BASEB/src/CAEN_HV/IocShell/

Create appropriate links to our medm files from standard place:

 cd $APP/medm
 make

Create appropriate links to our alh files from standard place:

 cd $APP/alh
 make