#!../../bin/rhel6-x86_64/bcsSoft
#==============================================================
#
#  Abs:  Startup Script for BSY 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("IOC_NAME", "SIOC:BSY0:BC01")
epicsEnvSet("LOCATION", "BSY")

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

# DSC Beckhoff #1
iocshLoad("$(TOP)/iocBoot/common/init_beckhoff_dsc.iocsh", "BKH_PORT=BKH1,BKH_IP=dsc-bsy0-bc01,BKH_P=DSC:BSY0:BC01,LOC=B106-08")

# DSC Beckhoff #2
iocshLoad("$(TOP)/iocBoot/common/init_beckhoff_dsc.iocsh", "BKH_PORT=BKH2,BKH_IP=dsc-bsy0-bc02,BKH_P=DSC:BSY0:BC02,LOC=B106-06")

# 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

