#==============================================================
#
#  Abs:  EPICS startup script for LI30 Motion Control
#
#  Name: st.cmd
#
#  Side:  Stanford Linear Accelerator Center,
#         developed under contract from Mimetic Software Systems Inc.
#
#  Facility:  LCLS Motion Controls 
#
#  Auth: 17-Sep-2010, Doug Murray   
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#       20-Apr-2016,  K. Luchini      (luchin):
#         load common scripts       
#	14-May-2010  Shantha Condamoor
#         All packages upgraded to match with
#         base-R3-14-8-2-lcls6 and event-R3-2-0.
#         LVDT filter option set to 3 instead of the 
#         default of 2 for WIRES and COLL
#
#==============================================================
#
# Set environment variables
setenv("ENGINEER"   ,"Kristi Luchini")
setenv("LOCATION"   ,"KG30-C0632")
setenv("IOC_NAME"   ,"IOC:LI30:MC01")
setenv("IOC_NODE"   ,"IOC-LI30-MC01")

# Load common startup
cexpsh("../common/st.cmd")

# Load record instances 
dbLoadRecords( "db/IOC-LI30-MC01-lvdt.db")
dbLoadRecords( "db/IOC-LI30-MC01-motor.db")
dbLoadRecords( "db/IOC-LI30-MC01-collimator.db")

# Initalize hardware
# Note: the hytec ip8413 is used to readback position instead 
# of using a highland lvdt module.
cexpsh("iocBoot/ioc-li30-mc01/init_ipac.cmd")

# Setup autosave/restore
cexpsh("iocBoot/common/init_restore.cmd")

# Start EPICS
iocInit()

# Start autosave/restore
cexpsh("iocBoot/common/restore.cmd")

# Change to boot directory
cd(pathSubstitute("iocBoot/%H"))

# Start sequences
cexpsh("init_seq.cmd")
cexpsh("init_db.cmd")

# End of file
