#!../../bin/rhel6-x86_64/bcsSoft
#==============================================================
#
#  Abs:  Startup Script for L3B Beam Containment
#
#  Name: st.cmd
#
#  Facility:  LCLS-II  Beam Containment System
#
#  Auth: 13-Jun-2019, M. Dunning       (MDUNNING)
#  Rev:  dd-mmm-yyyy, Reviewer's Name  (USERNAME)
#--------------------------------------------------------------
#  Mod:
#       19-Sep-2019, K. Luchini        (LUCHINI):
#         chg header Abs
#         chg author to Mike Dunning
#         remove TOP from path, already there
#       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", "L2KG10-02")
epicsEnvSet("IOC_NAME", "SIOC:L3B: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-l3b-bc01,BKH_P=DSC:L3B: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

