#==============================================================
#
#  Abs:  Klystron ACTA LLRF Carrier (gallery stations only)
#
#  Name: st-llrf-lcls.cmd (based on st.cmd.llrf)
#
#  Side: Upon entry to this script expect to be at the
#        iocBoot directory for the IOC. In addition the
#        following macros are expected:
#
#            IOC_NAME  - IOC devices name (i.e. SIOC:LI20:KY01)
#            BOARD_IP  - ATCA Carrier IP   
#            YAML_DIR  - Relative path to yaml files
#            YAML_FILE - Filename of yaml register structure 
#
#  Facility:  EED Klystron Controls
#
#  Auth: 21-Aug-2020, Kristi Luchini  (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        Halloween-2023, G. Brown      (gwbrown):
#         Branch from st.cmd.llrf to make lcls variant
#
#==============================================================
#
# Load record instances
dbLoadRecords("db/${IOC}.db")

# Initlialize hardware
< iocBoot/common/init_yaml.cmd.lcls
< iocBoot/common/init_tpr.cmd.lcls
< iocBoot/common/init_llrf.cmd
interlockRtmAsynDriverConfigure("intRtm0" , "mmio", "MyRoot0")

# Restore PVs 
< iocBoot/common/init_restore.cmd

# Increase callback and scanOnce quese sizes
# Note: Must be done after db has been loaded.
callbackSetQueueSize(5000)
scanOnceSetQueueSize(5000)

# Start EPICS
iocInit()

# Initialize caPutLog
caPutLogInit("${EPICS_CA_PUT_LOG_ADDR}")

# Start autosave 
< iocBoot/common/restore.cmd

# Initalize wavefore engine pvs
< iocBoot/common/init_wfEng.cmd

# End of script






