#!../../bin/rhel6-x86_64/bcsSoft
#==============================================================
#
#  Abs:  Startup Script for LCLS Undulator Beam Containment
#
#  Name: st.cmd
#
#  Facility:  LCLS Beam Containment System
#
#  Auth: 06-Mar-2019, Mike Dunning     (MDUNNING)
#  Rev:  dd-mmm-yyyy, Reviewer's Name  (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        18-Sep-2019, K. Luchini       (LUCHINI):
#          remove TOP from path as we are already
#          at TOP of application at this point.
#        07-Mar-2019, K. Luchini       (LUCHINI):
#         chg init_restore.cmd to init_restore.cmd.soft
#         chg restore.cmd to restore.cmd.soft
#
#==============================================================

# Set environment variables
epicsEnvSet("LOCATION", "B921-70")
epicsEnvSet("IOC_NAME", "SIOC:UND0:BC01")

# Load common startup script
# Note: same file works for linuxRT
< ../common/st.cmd.soft

# DSC Beckhoffs
iocshLoad("$(TOP)/iocBoot/common/init_beckhoff_dsc.iocsh", "BKH_PORT=BKH1,BKH_IP=dsc-und0-bc01,BKH_P=DSC:UND0:BC01,LOC=$(LOCATION)")
iocshLoad("$(TOP)/iocBoot/common/init_beckhoff_dsc.iocsh", "BKH_PORT=BKH2,BKH_IP=dsc-und0-bc02,BKH_P=DSC:UND0:BC02,LOC=$(LOCATION)")


# Restore PVs
# Note: must be in TOP of app
< iocBoot/common/init_restore.cmd.soft

# Start EPICS
iocInit()

# Start monitoring pvs
< iocBoot/common/restore.cmd.soft

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

# End of script

