#==============================================================
#
#  Abs:  Klystron Station script for ACTA LLRF Carrier w/AMC
#
#  Name: 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:
#        dd-mmm-yyyy, First Lastname  (USERNAME):
#          comment
#
#==============================================================
#
# Load record instances
dbLoadRecords("db/${IOC}.db")
#dbLoadRecords("db/kly_llrf_alias.db","LOCA=${LOCA},STN=${STN}")

# Initlialize hardware
< iocBoot/common/init_yaml.cmd
< iocBoot/common/init_tpr.cmd
< iocBoot/common/init_llrf_gen1.cmd

# Restore PVs 
< iocBoot/common/init_restore.cmd

# Increase callback and scanOnce quese sizes
# Note: must do after db load but before iocInit
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






