#==============================================================
#
#  Abs:  EPICS Startup Script for LI24 BCS (gallery)
#
#  Name: st.cmd
#
#  Side: This cpu is an mvme6100 running the 
#        RTEMS Operating System
#
#  Facility:  LCLS Beam Containment System
#
#  Auth: 12-Sep-2007, Arturo Alarcon  (ALARCON)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        08-Nov-2019, K. Luchini      (LUCHINI):
#         use env var to change dir
#        19-Sep-2019, K. Luchini      (LUCHINI):
#         remove bcs_li24_sbireset.db, now included
#         in bcs_li24.db
#        17-Sep-2019, K. Luchini      (LUCHINI):
#         load common scripts
#         load caPutLogInit
#         load local script init_ipac.cmd
#         add env variables IOC_NAME
#        05-Jun-2007, Arturo Alarcon  (ALARCON):
#         change 
#
#==============================================================
#
# Setup environment variables
setenv("LOCATION"  ,"LKF24-01")
setenv("IOC_NAME"  ,"IOC:LI24:BC01")

# Load generic piece of startup script.
cexpsh("../common/st.cmd.rtems")

# Load devices
dbLoadRecords("db/bcs_li24.db")

# Initalize hardware
chdir(getenv("IOC_BOOT"))
cexpsh("init_ipac.cmd")

# Setup autosave/restore
chdir(getenv("TOP"))
cexpsh("iocBoot/common/init_restore.cmd")

# Start EPICS
iocInit()

# Start caPut logging
caPutLogInit(getenv("EPICS_CA_PUT_LOG_ADDR"))

# Start autosave/restore
cexpsh("iocBoot/common/restore.cmd")

# End of file

