Skip to content

EPICS module that provides a standard PV interface for trigger configuration and monitoring fo TimingCore

License

Notifications You must be signed in to change notification settings

slac-epics/tprTrigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

----------
tprTrigger
----------

The tprTrigger is an epics module which provides a standard PV interface 
for trigger configuration and monitoring fo TimingCore


How to build an ioc with tprTrigger
-----------------------------------

1. tprTrigger requires hpsTpr API
configure/CONFIG_STIE should have the followings for the hpsTpr API.

HPSTPR_PACKAGE_NAME=timing/hpsTpr
HPSTPR_VERSION=R1.0.2
HPSTPR_ARCH=$(LINUXRT_BUILDROOT_VERSION)-x86_64
HPSTPR=$(PACKAGE_AREA)/$(HPSTPR_PACKAGE_NAME)/$(HPSTPR_VERSION)/$(HPSTPR_ARCH)
HPSTPR_LIB     = $(HPSTPR)/lib
HPSTPR_INCLUDE = $(HPSTPR)/include

(The version number should be replaced with a proper version for your ioc.)

2. tprTrigger module
configure/RELEASE should have the followings for the tprTrigger module.

TPRTRIGGER_MODULE_VERSION=R1.2.5
TPRTRIGGER=$(EPICS_MODULES)/tprTrigger/$(TPRTRIGGER_MODULE_VERSION)

(The version number should be replaced with a proper version for your ioc.)


3. Other modules and API
the tprTrigger module assumes the following API and modules are included in the application.

asyn            R4.31-0.1.0
yamlLoader      R1.1.2
timingApi       R0.6

cpsw/framework  R3.6.6
yaml-cpp        yaml-cpp-0.5.3_boost-1.64.0
boost           1.64.0
hpsTpr          R1.0.2


4. How to build application binary

The Makefile in source directory should include the followings:

# DBD files for tprTrigger
<your_application>_DBD += tprTriggerAsynDriver.dbd

# API for tprTrigger
hpsTpr_DIR = $(HPSTPR_LIB)
<your_application>_LIBS += hpstpr

# Libary for tprTrigger
<your_application>_LIBS += tprTrigger

The Makefile in Db directory should have the followings to install database template 
into db directory.

# Install Database for tprTrigger module
DB_INSTALLS += $(TPRTRIGGER)/db/tprTrig.db
DB_INSTALLS += $(TPRTRIGGER)/db/tprDeviceNamePV.db



How to run the ioc with tprTrigger
----------------------------------

1. how to load database template for tprTrigger.

LCLS required macros
LOCA      - location (ex, LI24, IN20) 
IOC_UNIT  - IOC name (ex, RF01, RF02)
INST      - instance number for mutiple TPR in an ioc

Macros for tprTrig.db

PORT      - port name for asyn port driver, tprTrigger moudle has port name "trig".
DEV       - TPR prefix.  LCLS naming scheme requires TPR:$(LOCA):$(IOC_UNIT):$(INST)
example)
dbLoadRecords("db/tprTrig.db", "PORT=trig,DEV=TPR:$(LOCA):$(IOC_UNIT):$(INST)")

It will make TPR PVs (low level PVs) which have prefix "TPR:LI24:RF02:0:".
--------------

Macro for tprDeviceNamePV.db
The tprDeviceNamePV.db provides device name PVs (high level PVs)

DEV        -  TPR prefix.  LCLS naming scheme requires TPR:$(LOCA):$(IOC_UNIT):$(INST)
PORT       -  Asyn port (ex, trig)
NN         -  two digit number for trigger channel number (ex, 00, 01, 02 ... 10, 11)
DEV_PREFIX  - prefix for high level device name (ex, KLYS:LI28:21")

example)
dbLoadRecords("db/tprDeviceNamePV.db", "PORT=trig,DEV=TPR:LI24:RF02:0,NN=00,DEV_PREFIX=KLYS:LI28:21:")
dbLoadRecords("db/tprDeviceNamePV.db", "PORT=trig,DEV=TPR:LI24:RF02:0,NN=01,DEV_PREFIX=KLYS:LI28:21:")

Remark)
The DEV_PREFIX should have ":" at very last charactor.
ex)  BPMS:IN20:221:, YAG:IN20:221:
But, some of cases, we don't need to put the ":"
ex) BPMS:LI26:201:CALB


How to load devTprInfo.db and/or devEvrInfo.db:
These files provide PVs that allow edm screens and python programs to support IOCs w/ either EVR or TPR support.
If you load both, your python or edm can test both $(DEV):TprUsed and $(DEV):EvrUsed to see which one, if any, is used.
Macros for devTprInfo.db:
DEV		- This DEV is not the TPR device prefix, but instead the higher level device such as a camera.
TPR_USED- 0 = Unused, 1 = Used
TPR_PV	- This is the TPR device prefix
TPS_PV	- This is the TPR event prefix
TPR_TR	- TPR trigger number, defaults to 0
TPR_CH	- TPR channel number, defaults to TPR_TR

example st.cmd lines for TPR, but no EVR)
# Load both devEvrInfo.db and devTprInfo.db so python programs can test for both sets of PVs
dbLoadRecords( "db/devEvrInfo.db",  "DEV=$(CAM_PV),EVR_USED=0" )
dbLoadRecords( "db/devTprInfo.db",  "DEV=$(CAM_PV),TPR_PV=$(TPR_PV),TPE_PV=$(TPE_PV),TPR_CH=$(TPR_CH),TPR_TR=$(TPR_TR),TPR_SE=$(TPR_SE),TPR_USED=1" )

example using syntax for templated IOC build support)
# Load both devEvrInfo.db and devTprInfo.db so python programs can test for both sets of PVs
$$IF(EVR_PV)
dbLoadRecords( "db/devEvrInfo.db",  "DEV=$(CAM_PV),EVR=$(EVR_PV),TRIG_CH=$$IF(EVR_TRIG,$$EVR_TRIG,0),EVR_USED=1" )
$$ELSE(EVR_PV)
dbLoadRecords( "db/devEvrInfo.db",  "DEV=$(CAM_PV),EVR_USED=0" )
$$ENDIF(EVR_PV)
$$IF(TPR_PV)
dbLoadRecords( "db/devTprInfo.db",  "DEV=$(CAM_PV),TPR_PV=$(TPR_PV),TPE_PV=$(TPE_PV),TPR_CH=$(TPR_CH),TPR_TR=$(TPR_TR),TPR_SE=$(TPR_SE),TPR_USED=1" )
$$ELSE(TPR_PV)
dbLoadRecords( "db/devTprInfo.db",  "DEV=$(CAM_PV),TPR_USED=0" )
$$ENDIF(TPR_PV)

2. how to initialize the driver

The prTrigger assuems yamlLoader driver loaded up the register hierarchy as the followings:

cpswLoadYamlFile("000TopLevel.yaml", "NetIODev", "", "10.0.3.105")

(The yaml file path, root path name for register name, and FPGA IP address are application specific.)

After load up the hierarchy, we can configure tprTrigger driver with the followig command.

tprTriggerAsynDriverConfigure("trig", "mmio/AmcCarrierEmpty/AmcCarrierCore")



3. how to bring up engineering screen

Please, check up a script in the module: <TOP>/tprTriggerApp/edm/launch_edm



4. how to use multiple blades sytem

Load hierachy yaml file multiple times with describing named_root (very last argument, optional for mutilple blades system)

cd ${YAML_DIR0}
cpswLoadYamlFile("000TopLevel.yaml", "NetIODev", "", "10.0.3.102", "root_slot2")
cd ${YAML_DIR1}
cpswLoadYamlFile("000TopLevel.yaml", "NetIODev", "", "10.0.3.103", "root_slot3")
cd ${YAML_DIR2}
cpswLoadYamlFile("000TopLevel.yaml", "NetIODev", "", "10.0.3.104", "root_slot4")

Call driver configure multiple time with the named_root (very last argument, optional for multiple blades system)

tprTriggerAsynDriverConfigure("trig0", "mmio/AmcCarrierEmpty/AmcCarrierCore", "root_slot2")
tprTriggerAsynDriverConfigure("trig1", "mmio/AmcCarrierEmpty/AmcCarrierCore", "root_slot3")
tprTriggerAsynDriverConfigure("trig2", "mmio/AmcCarrierEmpty/AmcCarrierCore", "root_slot4")

About

EPICS module that provides a standard PV interface for trigger configuration and monitoring fo TimingCore

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 11