#==============================================================
#
#  Abs:  EPICS RTEMS Startup Script for LTU BCS (B911) 
#
#  Name: st.cmd
#
#  Side: This cpu is an mvme6100 running the 
#        RTEMS Operating System
#
#  Facility:  LCLS Beam Containment System
#
#  Auth: 12-Aug-2008, Arturo Alarcon  (ALARCON)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod: 
#        08-Nov-2019, K. Luchini      (LUCHINI):
#         use env var to change dir
#        16-Aug-2019, K. Luchini      (LUCHINI):
#         load common scripts
#         load caPutLogInit
#         load local script init_ipac.cmd
#         rename iocBoot/ioc-ltu1-bc01 to iocBoot/ioc-ltuh-bc01
#
#==============================================================
#

# Setup environment variables
setenv("LOCATION"  ,"B911-2021")
setenv("IOC_NAME"  ,"IOC:LTUH:BC01")

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

# Load devices
dbLoadRecords("db/bcs_ltu1_bc01.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



