EPICS: generation of DBs and GUIs for HV
NOTE: normally all environment variables are set, with one exception: cc_mf (counting house classc0) is using old EPICS; if you want to work with cc_mf execute $CLAS/epicsBold/.setup script; it will redefine environment; proceed as described below.
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 (looks like not in use ?) 4 - ioc number (that number goes to channel name, for example 'CAEN_<ioc number>_02'); that number must be unique for all CLAS IOCs (for example classc12 has ioc number 12 and that number should not be used for any other IOC 5 - mainframe address (for Lecroy by jumpers, for CAEN by IP, goes to channel name, for example 'CAEN_99_<mainframe address>); output DB files will be splitted based on this number, for example all lines in file 'caen.dat' with this number equal to 4 will be placed to the file 'caen_04.db'; this number have to be used as first parameter in 'sy1527Start()' calls 6 - slot/card number 7 - submodule: this is important code to specify what king of system we have; it must be equal to one of the predefined numbers, which is 2 for Lecroy HV and 3 for CAEN HV 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
For NEW EPICS ONLY 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/ cp caen102_02.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