#!../../bin/rhel6-x86_64/bcsSoft
#==============================================================
#
#  Abs:  Startup Script for Dump Beam Containment
#
#  Name: st.cmd
#
#  Facility:  LCLS-II  Beam Containment System
#
#  Auth: 13-Jun-2019, M. Dunning       (DUNNING)
#  Rev:  dd-mmm-yyyy, Reviewer's Name  (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        18-Sep-2019, K. Luchini       (LUCHINI):
#         remove TOP from path as we are already
#         chg author to Mike Dunning
#         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", "B940-24")
epicsEnvSet("IOC_NAME", "SIOC:DMP0:BC01")

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

# DSC Beckhoff 
iocshLoad("$(TOP)/iocBoot/common/init_beckhoff_dsc.iocsh", "BKH_PORT=BKH1,BKH_IP=dsc-dmp0-bc01,BKH_P=DSC:DMP0:BC01,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

