These database files are a centrally maintained location for reasonable defaults for values for each facility at SLAC. In other words, you should be able to load the same databases in LCLS, FACET, or LCLS II. The only difference is the SYS macro. Defaults for other facilities can be added.

The documentation for each db file can be found at the top of the corresponding substitutions file. \[Wouldn't it be nice to have a better place to keep it? It can't get into the db files because it's not a macro, and the template files used are also used in other ways, so the documentation wouldn't apply.\]

The databases are:

Bsa.db (load once for each BSA PV, or use as a template with 1 line per BSA PV)

EvrPmc.db (Load once for each EVR in the system, usually 1)

Pattern.db (Load once per IOC)

*-trig.db (flavors are PMC-trig.db, VME-trig.db, and VME-TTB-trig.db. Load for each piece of hardware, e.g. for a PMC on the VME processor board with rear transition board load PMC... and VME-TTB...)

An example of using these directly in st.cmd would look like this:


## Load record instances for Timing. 2 BSA PVs, a PMC EVR with rear Trigger Transition Board (TTB)
dbLoadRecords("db/EvrPmc.db","EVR=EVR:B34:EV05,CRD=0, SYS=SYS0")
dbLoadRecords("db/Pattern.db","IOC=IOC:B34:EV05, SYS=SYS0")
dbLoadRecords("db/Bsa.db","DEVICE=TRIG:B34:EV05, ATRB=COUNTER, SYS=SYS0")
dbLoadRecords("db/Bsa.db","DEVICE=TRIG:B34:EV05, ATRB=SINE, SYS=SYS0")
dbLoadRecords("db/PMC-trig.db", "LOCA=B34,UNIT=EV05,SYS=SYS0,IOC=IOC:B34:EV05")
dbLoadRecords("db/VME-TTB-trig.db", "LOCA=B34,UNIT=EV05,SYS=SYS0,IOC=IOC:B34:EV05")

give the first trigger, DEV0, a non-default name:

dbLoadRecords("db/VME-trig.db", "LOCA=UND1,UNIT=RM01,SYS=SYS0,IOC=IOC:UND1:RM01,DEV0=QADC:UND1:100:")

or in a substitutions file:

file Bsa.db
{
  pattern {DEVICE,            ATRB,    SYS   }
          { BLM:UND1:1345,    QDCRAW,    SYS0  }
          { BLM:UND1:1435,    QDCRAW,    SYS0  }

EvrPmc

#==============================================================================
# Abs:  LCLS EVR records for bpm EVRs
#
# Name: EVR.substitutions
#
# Macros:
#     
#   evr.db - instantiates an EVR record.
#    Associated display is evrDiags.edl.
#    DEV    Name of EVR - EVR:<loca>:<unit>
#    CARD    EVR card number starting at 0 (matches card number in ErConfigure).
#
#    evrEventCtrl.db - instantiates a record for an EVR event.
#    Associated display is evrTriggerDiags.edl.
#    DEV    Name of EVR - EVR:<loca>:<unit>
#    CARD    EVR card number starting at 0 (matches card number in ErConfigure).
#
#  Optional:
#   SYS     SYS code for the system where this EVR is deployed:
#       SYS0 for LCLS
#       SYS1 for FACET
#       SYS2 for LCLS II
#    IDn    Defining SYS will select the most commonly used event code numbers for the
#       specific system. To override these defaults, define IDn where n is 1-14.
#       Event code number.  To find all available event codes:
#        lclshome -> Event -> Events... (in the EVG IOC bo14).
#        This display brings up all the event that are beam-dependent.
#            For events that are beam-independent (constant or standby), select
#        "Time Slot 1 to 6 Event Codes".  Find the event that you want to trigger one or
#        more devices connected to the EVR.  Use number in the Event Code column.
#        Also check sharepoint spreadsheet:
#        Controls -> Timing -> timingEventCodes
#        NOTE: There is a dependency on event code assignments and triggers.
#             When changing event code assignments below, also change the appropriate
#            <ioc>trig.substitutions file!
#        NOTE: If you don't need to use all 14 event codes, populate the spare records
#        with other event codes from the "Time Slot 1 to 6 Event Codes" display.
#

Pattern

#==============================================================================
#
# Abs:  LCLS pattern records for BPM IOCs
#
# Name: Pattern.substitutions
#
# Macros: evrPatternAll.db - instantiates 120hz pattern records.
#      Associated display is evrPatternDiags.edl.
#    IOC    Name of the IOC, IOC:<loca>:<unit>
#   SYS     SYS code for the system where this EVR is deployed:
#       SYS0 for LCLS
#       SYS1 for FACET
#       SYS2 for LCLS II
#
#   Optional:
#    LINK4    Set to "" if the IOC is not slc-aware. 
#        Otherwise, set to "IOC:<loca>:<unit>:FANOUTSLC". 
#
#    LINK5,    Set to any record you want processed at 120hz after the timing
#    LINK6    pattern is received.  If not applicable, set to "".
#
#    TREF    Reference delay in nsec from the fiducial for this IOC.  Normally 
#        restored on reboot.  Nominal value is 1.03E6 nsec.  TREF is used
#        with the TDES value for each device to calculate the actual delay
#        updated in the EVR hardware:
#        EVR delay = TREF + TDES - event code delay from the fiducial
#
#    TS1ST    For 120hz operation, 2 of the 6 time slots (1,2,3,4,5,6, 
#    and    360hz apart) are used to update the pattern and timestamp for  
#    TS2ND    this IOC (pattern is used for beam sync acq).  The other 4 time   
#        slots are used for other projects.  Check with operations to find
#        the time slots used for your project/run and fill them in.  For 
#        instance, for BC1 LCLS 2007 operation, time slots 1 and 4 were
#        used so TS1ST was set to 1 and TS2ND was set to 4.  For IOCs that
#        cannot acquire and process data at 120hz (data ready in 8.3 msec), 
#               set TS1ST to 0 to ignore the 1st timeslot and the pattern and
#        timestamp will only update on time slot 4 at 60hz.
#
#      evrEventAll.db - instantiates records for each event code.
#      Associated display is evrEventDiags.edl.
#    DEVICE    Name of the IOC, IOC:<loca>:<unit>
#

 

*-trig

#=============================================================================
#
# Abs:  Trigger records for PMC-EVR front panel
#
# Name: PMC-trig.substitutions
#
# Associated Display: evnt_trig_VME.edl, or evnt_trig_PMC_noTTB.edl with no rear transition board
#
# Rem:  Instantiate one line for every trigger channel including ones not used.
# There should be 3 lines for a PMC EVR without a transition module for the 3 front panel triggers.
#
# Macros:
#   SYS     SYS code for the system where this EVR is deployed:
#       SYS0 for LCLS
#       SYS1 for FACET
#       SYS2 for LCLS II
#    LOCA    Location of the EVR that triggers the device.  It is the second part of the
#        EVR:<loca>:<unit>:CTRL record instantiated with EvrPmc.db.
#    UNIT    Unit number of the EVR instantiated in EvrPmc.db. Format is xxyy,
#       where xx = subsystem and yy is 01, 02, etc.
#
#   Optional:
#    DEV    Leave undefined for general purpose triggers.
#       If this is undefined, trigger PV names will start with "TRIG:<loca>:<unit>:".
#       Define this to give trigger PVs the names "$(DEV):0" through "$(DEV):2",
#       that is, replace "TRIG:<loca>:<unit>:" with "$(DEV):".
#   DEVn where n is 0-2. Use these to individually set channel PV names. Give the
#       name of the device being triggered up to and including the 3rd colon. 
#        Add a qualifying name after the 3rd colon, if necessary, to keep the name unique.
#        If the trigger channel is not used, use "TRIG:<loca>:<unit>:"
#        where <loca> is the location of your IOC and <unit> is xxyy, where xx = subsystem
#        and yy is 01, 02, etc.
#    IOC    Name of IOC that contains the EVR, not including the 3rd colon.
#

Bsa

# ==========================================================================
# Associated Display: evnt_bsa_dev_edefs
#
# Set the following macros in this subsitutuion file to use the
# above template.
#
#        $(DEVICE)       device information, prefix of PV name
#                        such as, WIRE:B34:776
#        $(ATRB)         attibute name for the BSA PV: such as, POSN
#
# Optional:
#        $(EGU)          Engineering Unit
#        $(HOPR)         High operation range
#        $(LOPR)         Low operation range
#        $(PREC)         Precision
#        $(ADEL)         Archive Deadband
#        $(FLNK)         forward link to hook a processing chain after the BSA processing
#                        if you don't want to use it;
#                        please put double quote into subsitution file
#                        to make an empty allocation for the forward link.

  • No labels